2009-11-21 [holger] 3.7.3cvs19
authorHolger Berndt <hb@claws-mail.org>
Sat, 21 Nov 2009 02:41:37 +0000 (02:41 +0000)
committerHolger Berndt <hb@claws-mail.org>
Sat, 21 Nov 2009 02:41:37 +0000 (02:41 +0000)
* src/printing.c
Modify cairo clip handling in preview windows,
to prevent print preview windows from being blank
with GTK+ 2.18. Follow recommendation of the GTK+
documentation (section "Migrating to client side windows")
and create a new cairo context for each expose event.

ChangeLog
PATCHSETS
configure.ac
src/printing.c

index cb4b6b0..dd83a40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-11-21 [holger]    3.7.3cvs19
+
+       * src/printing.c
+               Modify cairo clip handling in preview windows,
+               to prevent print preview windows from being blank
+               with GTK+ 2.18. Follow recommendation of the GTK+
+               documentation (section "Migrating to client side windows")
+               and create a new cairo context for each expose event.
+
 2009-11-19 [pawel]     3.7.3cvs18
 
        * Makefile.am
index 87a2043..f52dfc1 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.2.2.31 -r 1.2.2.32 src/news_gtk.c;  ) > 3.7.3cvs16.patchset
 ( cvs diff -u -r 1.2.2.32 -r 1.2.2.33 src/news_gtk.c;  ) > 3.7.3cvs17.patchset
 ( cvs diff -u -r 1.24.2.27 -r 1.24.2.28 Makefile.am;  ) > 3.7.3cvs18.patchset
+( cvs diff -u -r 1.1.2.27 -r 1.1.2.28 src/printing.c;  ) > 3.7.3cvs19.patchset
index 009320f..4e70ba5 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=18
+EXTRA_VERSION=19
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index e3cad4d..418196a 100644 (file)
@@ -77,6 +77,7 @@ typedef struct {
        gboolean rendering;
        gint page_width;
        gint page_height;
+       GtkPrintContext *context;
 } PreviewData;
 
 /* callbacks */
@@ -619,6 +620,7 @@ static void cb_preview_ready(GtkPrintOperationPreview *preview,
 
        preview_data->pages_to_print = g_list_reverse(preview_data->pages_to_print);
        preview_data->current_page = preview_data->pages_to_print;
+       preview_data->context = context;
 
        g_signal_connect(preview_data->area, "expose_event",
                         G_CALLBACK(cb_preview_expose),
@@ -663,6 +665,7 @@ static gboolean cb_preview_expose(GtkWidget *widget, GdkEventExpose *event,
        GdkColor white;
        GdkColor black;
        GdkColor gray;
+       cairo_t *cr;
 
        debug_print("preview_expose (current %p)\n", preview_data->current_page);
        gdk_window_clear(preview_data->area->window);
@@ -700,6 +703,10 @@ static gboolean cb_preview_expose(GtkWidget *widget, GdkEventExpose *event,
 
        g_object_unref(gc);
 
+       cr = gdk_cairo_create(preview_data->area->window);
+       gtk_print_context_set_cairo_context(preview_data->context, cr, PREVIEW_SCALE, PREVIEW_SCALE);
+       cairo_destroy(cr);
+
        if (preview_data->current_page) {
                preview_data->rendering = TRUE;
                gtk_widget_set_sensitive(preview_data->close, FALSE);