[gtk+] widget: Use gtk_widget_queue_draw()



commit 0cf4fdcb86567d21fdcdf4fbfab20f7f6b1acbbe
Author: Benjamin Otte <otte redhat com>
Date:   Fri Oct 21 05:00:58 2016 +0200

    widget: Use gtk_widget_queue_draw()

 gtk/gtkwidget.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index a815230..430c0f9 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4475,14 +4475,10 @@ gtk_widget_show_all (GtkWidget *widget)
 void
 gtk_widget_map (GtkWidget *widget)
 {
-  GtkWidgetPrivate *priv;
-
   g_return_if_fail (GTK_IS_WIDGET (widget));
   g_return_if_fail (_gtk_widget_get_visible (widget));
   g_return_if_fail (_gtk_widget_get_child_visible (widget));
 
-  priv = widget->priv;
-
   if (!_gtk_widget_get_mapped (widget))
     {
       gtk_widget_push_verify_invariants (widget);
@@ -4493,7 +4489,7 @@ gtk_widget_map (GtkWidget *widget)
       g_signal_emit (widget, widget_signals[MAP], 0);
 
       if (!_gtk_widget_get_has_window (widget))
-        gdk_window_invalidate_rect (priv->window, &priv->clip, FALSE);
+        gtk_widget_queue_draw (widget);
 
       gtk_widget_pop_verify_invariants (widget);
     }
@@ -4509,19 +4505,15 @@ gtk_widget_map (GtkWidget *widget)
 void
 gtk_widget_unmap (GtkWidget *widget)
 {
-  GtkWidgetPrivate *priv;
-
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  priv = widget->priv;
-
   if (_gtk_widget_get_mapped (widget))
     {
       g_object_ref (widget);
       gtk_widget_push_verify_invariants (widget);
 
       if (!_gtk_widget_get_has_window (widget))
-       gdk_window_invalidate_rect (priv->window, &priv->clip, FALSE);
+       gtk_widget_queue_draw (widget);
       _gtk_tooltip_hide (widget);
 
       g_signal_emit (widget, widget_signals[UNMAP], 0);
@@ -5608,7 +5600,7 @@ gtk_widget_size_allocate_with_baseline (GtkWidget     *widget,
          cairo_region_t *invalidate = cairo_region_create_rectangle (&priv->clip);
          cairo_region_union_rectangle (invalidate, &old_clip);
 
-         gdk_window_invalidate_region (priv->window, invalidate, FALSE);
+         gtk_widget_queue_draw_region (widget, invalidate);
          cairo_region_destroy (invalidate);
        }
 


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