+static GtkStyleContext *style;
+/* Foreground color of the current desktop theme */
+static GdkRGBA theme_fg_color;
+/* Background color of the current desktop theme */
+static GdkRGBA theme_bg_color;
+
+static void update_theme(GtkWidget *w)
+{
+ style = gtk_widget_get_style_context(w);
+
+ gtk_style_context_get_background_color(style,
+ GTK_STATE_FLAG_NORMAL,
+ &theme_bg_color);
+ gtk_style_context_get_color(style,
+ GTK_STATE_FLAG_NORMAL,
+ &theme_fg_color);
+}
+