summaryrefslogtreecommitdiff
path: root/savers/gs-theme-engine.c
diff options
context:
space:
mode:
authorAlexei Sorokin <[email protected]>2017-01-15 18:24:34 +0300
committerAlexei Sorokin <[email protected]>2017-01-15 18:24:34 +0300
commit6672c9811a6c6fe76810d2c66c69c4727910d91d (patch)
tree50ce812185cd4a4233e2f5effa717101e2c961c1 /savers/gs-theme-engine.c
parent2197434c213600c42b264602c4331eac7761db11 (diff)
downloadmate-screensaver-6672c9811a6c6fe76810d2c66c69c4727910d91d.tar.bz2
mate-screensaver-6672c9811a6c6fe76810d2c66c69c4727910d91d.tar.xz
avoid deprecated gdk_window_set_background functions
Which are completely broken in GTK+ 3.22.
Diffstat (limited to 'savers/gs-theme-engine.c')
-rw-r--r--savers/gs-theme-engine.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/savers/gs-theme-engine.c b/savers/gs-theme-engine.c
index 42097df..84c3682 100644
--- a/savers/gs-theme-engine.c
+++ b/savers/gs-theme-engine.c
@@ -107,34 +107,15 @@ gs_theme_engine_get_property (GObject *object,
}
}
-static void
-gs_theme_engine_clear (GtkWidget *widget)
-{
- GdkRGBA color = { 0.0, 0.0, 0.0, 1.0 };
- GtkStateFlags state;
-
- g_return_if_fail (GS_IS_THEME_ENGINE (widget));
-
- if (! gtk_widget_get_visible (widget))
- {
- return;
- }
-
- state = gtk_widget_get_state_flags (widget);
- gtk_widget_override_background_color (widget, state, &color);
- gdk_window_set_background_rgba (gtk_widget_get_window (widget), &color);
- gdk_flush ();
-}
-
static gboolean
-gs_theme_engine_real_map_event (GtkWidget *widget,
- GdkEventAny *event)
+gs_theme_engine_real_draw (GtkWidget *widget,
+ cairo_t *cr)
{
- gboolean handled = FALSE;
-
- gs_theme_engine_clear (widget);
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_paint (cr);
- return handled;
+ return FALSE;
}
static void
@@ -149,7 +130,7 @@ gs_theme_engine_class_init (GSThemeEngineClass *klass)
object_class->get_property = gs_theme_engine_get_property;
object_class->set_property = gs_theme_engine_set_property;
- widget_class->map_event = gs_theme_engine_real_map_event;
+ widget_class->draw = gs_theme_engine_real_draw;
g_type_class_add_private (klass, sizeof (GSThemeEnginePrivate));
}