[gtk+/rendering-cleanup-next: 112/155] imcontextxim: Connect to draw signal



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

    imcontextxim: Connect to draw signal

 modules/input/gtkimcontextxim.c |   21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)
---
diff --git a/modules/input/gtkimcontextxim.c b/modules/input/gtkimcontextxim.c
index 02fbfd6..de16e89 100644
--- a/modules/input/gtkimcontextxim.c
+++ b/modules/input/gtkimcontextxim.c
@@ -1770,28 +1770,21 @@ 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)
 {
-  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);
+                   gtk_widget_get_allocated_width (widget) - 1,
+                   gtk_widget_get_allocated_height (widget) - 1);
   cairo_fill (cr);
 
   return FALSE;
@@ -1840,8 +1833,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]