[gtk+] gtk: remove function gtk_entry_queue_draw() and call gtk_widget_queue_draw()



commit 858ba35873608426d16bf68c7514c2a7a0e4e0e3
Author: Michael Natterer <mitch gimp org>
Date:   Sat Feb 5 23:52:19 2011 +0100

    gtk: remove function gtk_entry_queue_draw() and call gtk_widget_queue_draw()
    
    the old function was a leftover from when GtkEntry had a window
    and was now invalidating the entire toplevel on each entry change.

 gtk/gtkentry.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index c437dbb..c9f3e7b 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -515,7 +515,6 @@ static void         gtk_entry_draw_cursor              (GtkEntry       *entry,
 static PangoLayout *gtk_entry_ensure_layout            (GtkEntry       *entry,
                                                         gboolean        include_preedit);
 static void         gtk_entry_reset_layout             (GtkEntry       *entry);
-static void         gtk_entry_queue_draw               (GtkEntry       *entry);
 static void         gtk_entry_recompute                (GtkEntry       *entry);
 static gint         gtk_entry_find_position            (GtkEntry       *entry,
 							gint            x);
@@ -1866,7 +1865,6 @@ gtk_entry_set_property (GObject         *object,
 {
   GtkEntry *entry = GTK_ENTRY (object);
   GtkEntryPrivate *priv = entry->priv;
-  GtkWidget *widget;
 
   switch (prop_id)
     {
@@ -1880,7 +1878,8 @@ gtk_entry_set_property (GObject         *object,
 
         if (new_value != priv->editable)
 	  {
-            widget = GTK_WIDGET (entry);
+            GtkWidget *widget = GTK_WIDGET (entry);
+
 	    if (!new_value)
 	      {
 		_gtk_entry_reset_im_context (entry);
@@ -1896,7 +1895,7 @@ gtk_entry_set_property (GObject         *object,
 	    if (new_value && gtk_widget_has_focus (widget))
 	      gtk_im_context_focus_in (priv->im_context);
 
-	    gtk_entry_queue_draw (entry);
+	    gtk_widget_queue_draw (widget);
 	  }
       }
       break;
@@ -5370,8 +5369,8 @@ recompute_idle_func (gpointer data)
   if (gtk_widget_has_screen (GTK_WIDGET (entry)))
     {
       gtk_entry_adjust_scroll (entry);
-      gtk_entry_queue_draw (entry);
-      
+      gtk_widget_queue_draw (GTK_WIDGET (entry));
+
       update_im_cursor_location (entry);
     }
 
@@ -5845,14 +5844,6 @@ gtk_entry_draw_cursor (GtkEntry  *entry,
     }
 }
 
-static void
-gtk_entry_queue_draw (GtkEntry *entry)
-{
-  if (gtk_widget_is_drawable (GTK_WIDGET (entry)))
-    gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET (entry)),
-                                NULL, FALSE);
-}
-
 void
 _gtk_entry_reset_im_context (GtkEntry *entry)
 {



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