[gtk+/rendering-cleanup-next: 107/203] printunixdialog: Connect to draw signal for collate callback



commit 1d380a0d5c9cb747d4c24727cd60a7dbaf94883d
Author: Benjamin Otte <otte redhat com>
Date:   Wed Sep 8 21:27:34 2010 +0200

    printunixdialog: Connect to draw signal for collate callback

 gtk/gtkprintunixdialog.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index ff8749b..f0bc87f 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -1991,12 +1991,10 @@ paint_page (GtkWidget *widget,
 
 static gboolean
 draw_collate_cb (GtkWidget          *widget,
-                 GdkEventExpose     *event,
+                 cairo_t            *cr,
                  GtkPrintUnixDialog *dialog)
 {
-  GtkAllocation allocation;
   GtkSettings *settings;
-  cairo_t *cr;
   gint size;
   gfloat scale;
   gboolean collate, reverse, rtl;
@@ -2017,12 +2015,6 @@ draw_collate_cb (GtkWidget          *widget,
   scale = size / 48.0;
   text_x = rtl ? 4 : 11;
 
-  cr = gdk_cairo_create (gtk_widget_get_window (widget));
-
-  gtk_widget_get_allocation (widget, &allocation);
-  cairo_translate (cr, allocation.x, allocation.y);
-  gtk_widget_set_allocation (widget, &allocation);
-
   if (copies == 1)
     {
       paint_page (widget, cr, scale, rtl ? 40: 15, 5, reverse ? "1" : "2", text_x);
@@ -2037,8 +2029,6 @@ draw_collate_cb (GtkWidget          *widget,
       paint_page (widget, cr, scale, rtl ? 15 : 40, 15, collate == reverse ? "2" : "1", text_x);
     }
 
-  cairo_destroy (cr);
-
   return TRUE;
 }
 
@@ -2295,7 +2285,7 @@ create_main_page (GtkPrintUnixDialog *dialog)
   gtk_table_attach (GTK_TABLE (table), image,
                     1, 2, 1, 3, GTK_FILL, 0,
                     0, 0);
-  g_signal_connect (image, "expose-event",
+  g_signal_connect (image, "draw",
                     G_CALLBACK (draw_collate_cb), dialog);
 
   label = gtk_label_new (_("General"));



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