[gtk+/rendering-cleanup-next: 103/155] filechooserentry: Connect to draw event



commit e38a27e1455c18f874a53271a0db79361246aa4d
Author: Benjamin Otte <otte redhat com>
Date:   Wed Sep 8 20:56:36 2010 +0200

    filechooserentry: Connect to draw event

 gtk/gtkfilechooserentry.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 3f1125e..4ca734f 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -879,26 +879,23 @@ gtk_file_chooser_entry_unmap (GtkWidget *widget)
 }
 
 static gboolean
-completion_feedback_window_expose_event_cb (GtkWidget      *widget,
-					    GdkEventExpose *event,
-					    gpointer        data)
+completion_feedback_window_draw_cb (GtkWidget *widget,
+                                    cairo_t   *cr,
+                                    gpointer   data)
 {
   /* Stolen from gtk_tooltip_paint_window() */
 
   GtkFileChooserEntry *chooser_entry = GTK_FILE_CHOOSER_ENTRY (data);
-  GtkAllocation allocation;
 
-  gtk_widget_get_allocation (chooser_entry->completion_feedback_window, &allocation);
-
-  gtk_paint_flat_box (gtk_widget_get_style (chooser_entry->completion_feedback_window),
-                      gtk_widget_get_window (chooser_entry->completion_feedback_window),
+  gtk_cairo_paint_flat_box (gtk_widget_get_style (chooser_entry->completion_feedback_window),
+                      cr,
 		      GTK_STATE_NORMAL,
 		      GTK_SHADOW_OUT,
-		      NULL,
 		      chooser_entry->completion_feedback_window,
 		      "tooltip",
 		      0, 0,
-                      allocation.width, allocation.height);
+                      gtk_widget_get_allocated_width (widget),
+                      gtk_widget_get_allocated_height (widget));
 
   return FALSE;
 }
@@ -951,8 +948,8 @@ create_completion_feedback_window (GtkFileChooserEntry *chooser_entry)
   gtk_container_add (GTK_CONTAINER (chooser_entry->completion_feedback_window), alignment);
   gtk_widget_show (alignment);
 
-  g_signal_connect (chooser_entry->completion_feedback_window, "expose-event",
-		    G_CALLBACK (completion_feedback_window_expose_event_cb), chooser_entry);
+  g_signal_connect (chooser_entry->completion_feedback_window, "draw",
+		    G_CALLBACK (completion_feedback_window_draw_cb), chooser_entry);
   g_signal_connect (chooser_entry->completion_feedback_window, "realize",
 		    G_CALLBACK (completion_feedback_window_realize_cb), chooser_entry);
   /* FIXME: connect to motion-notify-event, and *show* the cursor when the mouse moves */



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