summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2015-07-12 15:08:38 +0200
committerinfirit <[email protected]>2015-07-12 16:09:16 +0200
commit0ebac28cb393a12b15c8122dbb85d8a6cb354dad (patch)
tree2ed669f8d78b0f2e0867a7b532b278e7925b6382
parent575cb06d41e46d701b69b77da37817cf69854777 (diff)
downloadmate-screensaver-0ebac28cb393a12b15c8122dbb85d8a6cb354dad.tar.bz2
mate-screensaver-0ebac28cb393a12b15c8122dbb85d8a6cb354dad.tar.xz
slideshow: Cleanup cairo drawing between gtk versions
-rw-r--r--savers/gste-slideshow.c42
1 files changed, 12 insertions, 30 deletions
diff --git a/savers/gste-slideshow.c b/savers/gste-slideshow.c
index 566baab..d515b0b 100644
--- a/savers/gste-slideshow.c
+++ b/savers/gste-slideshow.c
@@ -324,22 +324,7 @@ update_display (GSTESlideshow *show)
cairo_destroy (cr);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_queue_draw (GTK_WIDGET (show));
-#else
- /* paint the image buffer into the window */
- cr = gdk_cairo_create (gtk_widget_get_window (GTK_WIDGET (show)));
-
- cairo_set_source_surface (cr, show->priv->surf, 0, 0);
-
- gs_theme_engine_profile_start ("paint surface to window");
- cairo_paint (cr);
- gs_theme_engine_profile_end ("paint surface to window");
-
- cairo_destroy (cr);
-
- gs_theme_engine_profile_end ("end");
-#endif
}
static gboolean
@@ -890,32 +875,29 @@ gste_slideshow_real_expose (GtkWidget *widget,
#endif
{
GSTESlideshow *show = GSTE_SLIDESHOW (widget);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gboolean handled = FALSE;
-
- update_display (show);
-#endif
#if GTK_CHECK_VERSION (3, 0, 0)
- if (GTK_WIDGET_CLASS (parent_class)->draw)
- {
+ if (GTK_WIDGET_CLASS (parent_class)->draw) {
GTK_WIDGET_CLASS (parent_class)->draw (widget, cr);
}
+#else
+ if (GTK_WIDGET_CLASS (parent_class)->expose_event) {
+ GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
+ }
+
+ cairo_t *cr = gdk_cairo_create (event->window);
+#endif
cairo_set_source_surface (cr, show->priv->surf, 0, 0);
gs_theme_engine_profile_start ("paint surface to window");
cairo_paint (cr);
gs_theme_engine_profile_end ("paint surface to window");
- return TRUE;
-#else
- if (GTK_WIDGET_CLASS (parent_class)->expose_event)
- {
- handled = GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
- }
-
- return handled;
+#if !GTK_CHECK_VERSION (3, 0, 0)
+ cairo_destroy (cr);
#endif
+
+ return TRUE;
}
static gboolean