[gtk+/rendering-cleanup-next: 99/153] tooltip: Connect to draw signal



commit d6e0a322c0cc078cec3b7bb1481a73314f7909a1
Author: Benjamin Otte <otte redhat com>
Date:   Wed Sep 8 17:09:12 2010 +0200

    tooltip: Connect to draw signal

 gtk/gtktooltip.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index 9486cd9..e70cd18 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -88,7 +88,10 @@ static void       gtk_tooltip_init                 (GtkTooltip      *tooltip);
 static void       gtk_tooltip_dispose              (GObject         *object);
 
 static void       gtk_tooltip_window_style_set     (GtkTooltip      *tooltip);
-static gboolean   gtk_tooltip_paint_window         (GtkTooltip      *tooltip);
+static gboolean   gtk_tooltip_paint_window         (GtkTooltip      *tooltip,
+                                                    cairo_t         *cr,
+                                                    int              width,
+                                                    int              height);
 static void       gtk_tooltip_window_hide          (GtkWidget       *widget,
 						    gpointer         user_data);
 static void       gtk_tooltip_display_closed       (GdkDisplay      *display,
@@ -149,7 +152,7 @@ gtk_tooltip_init (GtkTooltip *tooltip)
 
   g_signal_connect_swapped (tooltip->window, "style-set",
 			    G_CALLBACK (gtk_tooltip_window_style_set), tooltip);
-  g_signal_connect_swapped (tooltip->window, "expose-event",
+  g_signal_connect_swapped (tooltip->window, "draw",
 			    G_CALLBACK (gtk_tooltip_paint_window), tooltip);
 
   tooltip->box = gtk_hbox_new (FALSE, style->xthickness);
@@ -515,20 +518,19 @@ gtk_tooltip_window_style_set (GtkTooltip *tooltip)
 }
 
 static gboolean
-gtk_tooltip_paint_window (GtkTooltip *tooltip)
+gtk_tooltip_paint_window (GtkTooltip *tooltip,
+                          cairo_t    *cr,
+                          int         width,
+                          int         height)
 {
-  GtkAllocation allocation;
-
-  gtk_widget_get_allocation (tooltip->window, &allocation);
-  gtk_paint_flat_box (gtk_widget_get_style (tooltip->window),
-		      gtk_widget_get_window (tooltip->window),
+  gtk_cairo_paint_flat_box (gtk_widget_get_style (tooltip->window),
+		      cr,
 		      GTK_STATE_NORMAL,
 		      GTK_SHADOW_OUT,
-		      NULL,
 		      tooltip->window,
 		      "tooltip",
 		      0, 0,
-                      allocation.width, allocation.height);
+                      width, height);
 
   return FALSE;
 }



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