[gtk+] toolitemgroup: Use gtk_widget_queue_draw()



commit b9aef64f09ab6d59ae57e2d6c22e1dc1c854e908
Author: Benjamin Otte <otte redhat com>
Date:   Wed Oct 19 22:27:43 2016 +0200

    toolitemgroup: Use gtk_widget_queue_draw()

 gtk/gtktoolitemgroup.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index ab6534b..27ef6df 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -1097,8 +1097,7 @@ gtk_tool_item_group_size_allocate (GtkWidget     *widget,
 {
   gtk_tool_item_group_real_size_allocate (widget, allocation);
 
-  if (gtk_widget_get_mapped (widget))
-    gdk_window_invalidate_rect (gtk_widget_get_window (widget), NULL, FALSE);
+  gtk_widget_queue_draw (widget);
 }
 
 static void
@@ -1832,17 +1831,15 @@ gtk_tool_item_group_force_expose (GtkToolItemGroup *group)
     {
       GtkAllocation frame_allocation;
       GtkWidget *frame = gtk_tool_item_group_get_frame (group);
-      GdkRectangle area;
 
-      /* Find the header button's arrow area... */
+      /* Find the header button's arrow area and
+       * invalidate it to get it animated. */
       gtk_widget_get_allocation (frame, &frame_allocation);
-      area.x = frame_allocation.x;
-      area.y = frame_allocation.y + (frame_allocation.height - priv->expander_size) / 2;
-      area.height = priv->expander_size;
-      area.width = priv->expander_size;
-
-      /* ... and invalidated it to get it animated. */
-      gdk_window_invalidate_rect (gtk_widget_get_window (priv->header), &area, TRUE);
+      gtk_widget_queue_draw_area (priv->header,
+                                  frame_allocation.x,
+                                  frame_allocation.y + (frame_allocation.height - priv->expander_size) / 2,
+                                  priv->expander_size,
+                                  priv->expander_size);
     }
 
   if (gtk_widget_get_realized (widget))


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