[gtk+/rendering-cleanup-next: 111/153] imcontextxim: Connect to draw signal



commit aa33865a037d6a9f187e79881031836b202bc15e
Author: Benjamin Otte <otte redhat com>
Date:   Wed Sep 8 22:03:50 2010 +0200

    imcontextxim: Connect to draw signal

 modules/input/gtkimcontextxim.c |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/modules/input/gtkimcontextxim.c b/modules/input/gtkimcontextxim.c
index 02fbfd6..c56c821 100644
--- a/modules/input/gtkimcontextxim.c
+++ b/modules/input/gtkimcontextxim.c
@@ -1770,28 +1770,22 @@ status_window_get (GtkWidget *toplevel)
 /* Draw the background (normally white) and border for the status window
  */
 static gboolean
-on_status_window_expose_event (GtkWidget      *widget,
-			       GdkEventExpose *event)
+on_status_window_draw (GtkWidget *widget,
+                       cairo_t   *cr,
+                       int        width,
+                       int        height)
 {
-  GtkAllocation allocation;
   GtkStyle *style;
-  cairo_t *cr;
 
   style = gtk_widget_get_style (widget);
-  gtk_widget_get_allocation (widget, &allocation);
-
-  cr = gdk_cairo_create (gtk_widget_get_window (widget));
 
   gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_NORMAL]);
-  cairo_rectangle (cr,
-                   0, 0,
-                   allocation.width, allocation.height);
-  cairo_fill (cr);
+  cairo_paint (cr);
 
   gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]);
   cairo_rectangle (cr, 
                    0, 0,
-                   allocation.width - 1, allocation.height - 1);
+                   width - 1, height - 1);
   cairo_fill (cr);
 
   return FALSE;
@@ -1840,8 +1834,8 @@ status_window_make_window (StatusWindow *status_window)
 		    G_CALLBACK (on_status_window_style_set), status_label);
   gtk_container_add (GTK_CONTAINER (window), status_label);
   
-  g_signal_connect (window, "expose-event",
-		    G_CALLBACK (on_status_window_expose_event), NULL);
+  g_signal_connect (window, "draw",
+		    G_CALLBACK (on_status_window_draw), NULL);
   
   gtk_window_set_screen (GTK_WINDOW (status_window->window),
 			 gtk_widget_get_screen (status_window->toplevel));



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