[gnome-screensaver] slideshow: drop expose-event in favor of draw



commit 9305847cb0cb99f7115b4703b832513856aaace1
Author: Ray Strode <rstrode redhat com>
Date:   Thu Sep 30 00:32:12 2010 -0400

    slideshow: drop expose-event in favor of draw

 savers/gste-slideshow.c |   34 +++++++++++++---------------------
 1 files changed, 13 insertions(+), 21 deletions(-)
---
diff --git a/savers/gste-slideshow.c b/savers/gste-slideshow.c
index 40ada01..083a6a2 100644
--- a/savers/gste-slideshow.c
+++ b/savers/gste-slideshow.c
@@ -301,18 +301,7 @@ update_display (GSTESlideshow *show)
 
         cairo_destroy (cr);
 
-        /* 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");
+        gtk_widget_queue_draw (GTK_WIDGET (show));
 }
 
 static gboolean
@@ -806,19 +795,22 @@ gste_slideshow_real_show (GtkWidget *widget)
 }
 
 static gboolean
-gste_slideshow_real_expose (GtkWidget      *widget,
-                            GdkEventExpose *event)
+gste_slideshow_real_draw (GtkWidget      *widget,
+                          cairo_t        *cr)
 {
         GSTESlideshow *show = GSTE_SLIDESHOW (widget);
-        gboolean       handled = FALSE;
-
-        update_display (show);
 
-        if (GTK_WIDGET_CLASS (parent_class)->expose_event) {
-                handled = GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
+        if (GTK_WIDGET_CLASS (parent_class)->draw) {
+                GTK_WIDGET_CLASS (parent_class)->draw (widget, cr);
         }
 
-        return handled;
+        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;
 }
 
 static gboolean
@@ -872,7 +864,7 @@ gste_slideshow_class_init (GSTESlideshowClass *klass)
         object_class->set_property = gste_slideshow_set_property;
 
         widget_class->show = gste_slideshow_real_show;
-        widget_class->expose_event = gste_slideshow_real_expose;
+        widget_class->draw = gste_slideshow_real_draw;
         widget_class->configure_event = gste_slideshow_real_configure;
 
         g_type_class_add_private (klass, sizeof (GSTESlideshowPrivate));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]