[Xfce4-commits] [apps/xfce4-screensaver] 193/425: slideshow: Cleanup cairo drawing between gtk versions
noreply at xfce.org
noreply at xfce.org
Mon Oct 15 01:50:40 CEST 2018
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-screensaver.
commit 0ebac28cb393a12b15c8122dbb85d8a6cb354dad
Author: infirit <infirit at gmail.com>
Date: Sun Jul 12 15:08:38 2015 +0200
slideshow: Cleanup cairo drawing between gtk versions
---
savers/gste-slideshow.c | 42 ++++++++++++------------------------------
1 file 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
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list