summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-01 20:49:34 +0200
committerraveit65 <[email protected]>2016-06-05 11:02:36 +0200
commitce80f542043dd031e055c7c24d6d2f9e299cb2f9 (patch)
treeacbc679db4ad57d4e781306a97b79945a694dc91 /plugins
parentea8248f5cdbb8cb67f515cda14d57dd84c6ea07f (diff)
downloadmate-settings-daemon-ce80f542043dd031e055c7c24d6d2f9e299cb2f9.tar.bz2
mate-settings-daemon-ce80f542043dd031e055c7c24d6d2f9e299cb2f9.tar.xz
GTK+3 mouse: fix deprecated gtk_style_context_get_background_color
taken from mate-notification-daemon
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mouse/msd-locate-pointer.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/plugins/mouse/msd-locate-pointer.c b/plugins/mouse/msd-locate-pointer.c
index 8be68fe..a480a6a 100644
--- a/plugins/mouse/msd-locate-pointer.c
+++ b/plugins/mouse/msd-locate-pointer.c
@@ -50,6 +50,26 @@ struct MsdLocatePointerData
static MsdLocatePointerData *data = NULL;
+#if GTK_CHECK_VERSION(3, 0, 0)
+static void
+msd_get_background_color (GtkStyleContext *context,
+ GtkStateFlags state,
+ GdkRGBA *color)
+{
+ GdkRGBA *c;
+
+ g_return_if_fail (color != NULL);
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ gtk_style_context_get (context,
+ state,
+ "background-color", &c,
+ NULL);
+ *color = *c;
+ gdk_rgba_free (c);
+}
+#endif
+
static void
locate_pointer_paint (MsdLocatePointerData *data,
cairo_t *cr,
@@ -74,7 +94,7 @@ locate_pointer_paint (MsdLocatePointerData *data,
#if GTK_CHECK_VERSION (3, 0, 0)
context = gtk_widget_get_style_context (data->widget);
- gtk_style_context_get_background_color (context, GTK_STATE_FLAG_SELECTED, &color);
+ msd_get_background_color (context, GTK_STATE_FLAG_SELECTED, &color);
#else
style = gtk_widget_get_style (data->widget);
color = style->bg[GTK_STATE_SELECTED];