aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/callbacks.c17
-rw-r--r--src/uzbl-core.c15
-rw-r--r--src/uzbl-core.h4
3 files changed, 20 insertions, 16 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index bed4fab..77b7cb6 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -47,15 +47,20 @@ set_authentication_handler() {
void
set_status_background() {
- GdkColor color;
- gdk_color_parse (uzbl.behave.status_background, &color);
/* labels and hboxes do not draw their own background. applying this
* on the vbox/main_window is ok as the statusbar is the only affected
* widget. (if not, we could also use GtkEventBox) */
- if (uzbl.gui.main_window)
- gtk_widget_modify_bg (uzbl.gui.main_window, GTK_STATE_NORMAL, &color);
- else if (uzbl.gui.plug)
- gtk_widget_modify_bg (GTK_WIDGET(uzbl.gui.plug), GTK_STATE_NORMAL, &color);
+ GtkWidget* widget = uzbl.gui.main_window ? uzbl.gui.main_window : GTK_WIDGET (uzbl.gui.plug);
+
+#if GTK_CHECK_VERSION(2,91,0)
+ GdkRGBA color;
+ gdk_rgba_parse (&color, uzbl.behave.status_background);
+ gtk_widget_override_background_color (widget, GTK_STATE_NORMAL, &color);
+#else
+ GdkColor color;
+ gdk_color_parse (uzbl.behave.status_background, &color);
+ gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &color);
+#endif
}
void
diff --git a/src/uzbl-core.c b/src/uzbl-core.c
index 6f75514..e1f042a 100644
--- a/src/uzbl-core.c
+++ b/src/uzbl-core.c
@@ -1622,21 +1622,16 @@ control_stdin(GIOChannel *gio, GIOCondition condition) {
void
create_stdin () {
- GIOChannel *chan = NULL;
- GError *error = NULL;
-
- chan = g_io_channel_unix_new(fileno(stdin));
+ GIOChannel *chan = g_io_channel_unix_new(fileno(stdin));
if (chan) {
if (!g_io_add_watch(chan, G_IO_IN|G_IO_HUP, (GIOFunc) control_stdin, NULL)) {
- g_error ("Stdin: could not add watch\n");
- } else {
- if (uzbl.state.verbose)
- printf ("Stdin: watch added successfully\n");
+ g_error ("create_stdin: could not add watch\n");
+ } else if (uzbl.state.verbose) {
+ printf ("create_stdin: watch added successfully\n");
}
} else {
- g_error ("Stdin: Error while opening: %s\n", error->message);
+ g_error ("create_stdin: error while opening stdin\n");
}
- if (error) g_error_free (error);
}
gboolean
diff --git a/src/uzbl-core.h b/src/uzbl-core.h
index b94b2b0..b58c8fe 100644
--- a/src/uzbl-core.h
+++ b/src/uzbl-core.h
@@ -40,6 +40,10 @@
#include <sys/ioctl.h>
#include <assert.h>
+#if GTK_CHECK_VERSION(2,91,0)
+ #include <gtk/gtkx.h>
+#endif
+
#include "cookie-jar.h"
#define LENGTH(x) (sizeof x / sizeof x[0])