diff options
-rw-r--r-- | src/eom-print-preview.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/eom-print-preview.c b/src/eom-print-preview.c index 0f5f484..5410ebb 100644 --- a/src/eom-print-preview.c +++ b/src/eom-print-preview.c @@ -559,26 +559,32 @@ eom_print_preview_new (void) #if GTK_CHECK_VERSION (3, 0, 0) static gboolean draw_cb (GtkDrawingArea *drawing_area, - cairo_t *cr, + cairo_t *cr, + gpointer user_data) +{ + update_relative_sizes (EOM_PRINT_PREVIEW (user_data)); + + eom_print_preview_draw (EOM_PRINT_PREVIEW (user_data), cr); + + if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) { + fprintf (stderr, "Cairo is unhappy: %s\n", + cairo_status_to_string (cairo_status (cr))); + } + return TRUE; +} #else static void expose_event_cb (GtkDrawingArea *drawing_area, GdkEventExpose *eev, -#endif gpointer user_data) { GtkWidget *widget; -#if !GTK_CHECK_VERSION (3, 0, 0) cairo_t *cr; -#endif widget = GTK_WIDGET (drawing_area); update_relative_sizes (EOM_PRINT_PREVIEW (user_data)); - -#if !GTK_CHECK_VERSION (3, 0, 0) cr = gdk_cairo_create (gtk_widget_get_window (widget)); -#endif eom_print_preview_draw (EOM_PRINT_PREVIEW (user_data), cr); @@ -586,17 +592,10 @@ expose_event_cb (GtkDrawingArea *drawing_area, fprintf (stderr, "Cairo is unhappy: %s\n", cairo_status_to_string (cairo_status (cr))); } - -#if !GTK_CHECK_VERSION (3, 0, 0) cairo_destroy (cr); - gdk_window_get_pointer (gtk_widget_get_window (widget), NULL, NULL, NULL); -#endif - -#if GTK_CHECK_VERSION (3, 0, 0) - return TRUE; -#endif } +#endif /** * get_current_image_coordinates: |