From ea8248f5cdbb8cb67f515cda14d57dd84c6ea07f Mon Sep 17 00:00:00 2001 From: raveit65 Date: Wed, 1 Jun 2016 19:50:43 +0200 Subject: GTK+3 msd-locate-pointer: port to GtkStyleContext taken from: https://git.gnome.org/browse/gnome-settings-daemon/commit/?id=81cfd0e --- plugins/mouse/msd-locate-pointer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'plugins/mouse') diff --git a/plugins/mouse/msd-locate-pointer.c b/plugins/mouse/msd-locate-pointer.c index a9cb341..8be68fe 100644 --- a/plugins/mouse/msd-locate-pointer.c +++ b/plugins/mouse/msd-locate-pointer.c @@ -55,18 +55,30 @@ locate_pointer_paint (MsdLocatePointerData *data, cairo_t *cr, gboolean composite) { +#if GTK_CHECK_VERSION (3, 0, 0) + GdkRGBA color; + gdouble progress, circle_progress; + gint width, height, i; + GtkStyleContext *context; +#else GdkColor color; gdouble progress, circle_progress; gint width, height, i; GtkStyle *style; +#endif progress = data->progress; width = gdk_window_get_width (data->window); height = gdk_window_get_height (data->window); +#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); +#else style = gtk_widget_get_style (data->widget); color = style->bg[GTK_STATE_SELECTED]; +#endif cairo_set_source_rgba (cr, 1., 1., 1., 0.); cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); @@ -86,9 +98,15 @@ locate_pointer_paint (MsdLocatePointerData *data, if (composite) { cairo_set_source_rgba (cr, +#if GTK_CHECK_VERSION (3, 0, 0) + color.red, + color.green, + color.blue, +#else color.red / 65535., color.green / 65535., color.blue / 65535., +#endif 1 - circle_progress); cairo_arc (cr, width / 2, -- cgit v1.2.1