[gtk+/composite-templates] widget: Use gtk_widget_queue_draw() for queueing redraws



commit ca64686bd4ceb38616f38e7e29cd99cb2091c050
Author: Benjamin Otte <otte redhat com>
Date:   Mon Sep 10 13:50:10 2012 +0200

    widget: Use gtk_widget_queue_draw() for queueing redraws
    
    This change is necessary because the old code did not accound for corner
    cases (like translucent child windows), which could stop
    gtk_widget_queue_resize() to not trigger redraws.

 gtk/gtkwidget.c |   30 +++---------------------------
 1 files changed, 3 insertions(+), 27 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 3721464..5fc165f 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -642,7 +642,6 @@ static AtkObject*	gtk_widget_ref_accessible		(AtkImplementor *implementor);
 static void             gtk_widget_invalidate_widget_windows    (GtkWidget        *widget,
 								 cairo_region_t        *region);
 static GdkScreen *      gtk_widget_get_screen_unchecked         (GtkWidget        *widget);
-static void		gtk_widget_queue_shallow_draw		(GtkWidget        *widget);
 static gboolean         gtk_widget_real_can_activate_accel      (GtkWidget *widget,
                                                                  guint      signal_id);
 
@@ -4650,7 +4649,7 @@ gtk_widget_queue_resize (GtkWidget *widget)
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
   if (gtk_widget_get_realized (widget))
-    gtk_widget_queue_shallow_draw (widget);
+    gtk_widget_queue_draw (widget);
 
   _gtk_size_group_queue_resize (widget, 0);
 }
@@ -4773,29 +4772,6 @@ gtk_widget_invalidate_widget_windows (GtkWidget *widget,
 }
 
 /**
- * gtk_widget_queue_shallow_draw:
- * @widget: a #GtkWidget
- *
- * Like gtk_widget_queue_draw(), but only windows owned
- * by @widget are invalidated.
- **/
-static void
-gtk_widget_queue_shallow_draw (GtkWidget *widget)
-{
-  GdkRectangle rect;
-  cairo_region_t *region;
-
-  if (!gtk_widget_get_realized (widget))
-    return;
-
-  gtk_widget_get_allocation (widget, &rect);
-
-  region = cairo_region_create_rectangle (&rect);
-  gtk_widget_invalidate_widget_windows (widget, region);
-  cairo_region_destroy (region);
-}
-
-/**
  * gtk_widget_size_allocate:
  * @widget: a #GtkWidget
  * @allocation: position and size to be allocated to @widget
@@ -5856,7 +5832,7 @@ static gboolean
 gtk_widget_real_focus_in_event (GtkWidget     *widget,
                                 GdkEventFocus *event)
 {
-  gtk_widget_queue_shallow_draw (widget);
+  gtk_widget_queue_draw (widget);
 
   return FALSE;
 }
@@ -5865,7 +5841,7 @@ static gboolean
 gtk_widget_real_focus_out_event (GtkWidget     *widget,
                                  GdkEventFocus *event)
 {
-  gtk_widget_queue_shallow_draw (widget);
+  gtk_widget_queue_draw (widget);
 
   return FALSE;
 }



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