GNOME Bugzilla – Bug 473923
PrintOperation not work
Last modified: 2007-10-05 10:17:38 UTC
Please describe the problem: When use Gtk::PrintOperation with gtk version>=2.10.13, It is not work at all. But when down gtk version to 2.10.11, It works well. And pygtk and gtk program print works well for all gtk version. Test Env: 1> debian sid with: gtk 2.10.13-1, gtkmm 2.10.10-0.2, glibmm 2.12.10-0.1 (Not work env) 2>debian sid with: gtk 2.10.11 gtkmm 2.10.10-0.2, glibmm 2.12.10-0.1 (work env) 3>winxp with:gtk 2.10.13-1(get from gimp-win32), gtkmm-2.10.8 (Not work env) 4>winxp with:gtk 2.10.11 (get from glade-win32) gtkmm-2.10.8 (Work env) Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
I can confirm this with the latest gtkmm (2.12.0)
I checked the 2.10 branch http://svn.gnome.org/viewcvs/gtk%2B/branches/gtk-2-10/ This is the problematic commit: svn diff -r17698:17703 gtk/gtkprintoperation.c ChangeLog Index: gtk/gtkprintoperation.c =================================================================== --- gtk/gtkprintoperation.c (revision 17698) +++ gtk/gtkprintoperation.c (revision 17703) @@ -2063,7 +2063,8 @@ goto out; } - if (g_signal_has_handler_pending (data->op, signals[PAGINATE], 0, FALSE)) + if (GTK_PRINT_OPERATION_GET_CLASS (data->op)->paginate != NULL || + g_signal_has_handler_pending (data->op, signals[PAGINATE], 0, FALSE)) { gboolean paginated = FALSE; Index: ChangeLog =================================================================== --- ChangeLog (revision 17698) +++ ChangeLog (revision 17703) @@ -2,6 +2,14 @@ Merge from trunk: + * gtk/gtkprintoperation.c (print_pages_idle): Also check + the default handler when deciding whether to emit the + paginate signal. (#345345, Yevgen Muntyan) + +2007-04-29 Matthias Clasen <mclasen@redhat.com> + + Merge from trunk: + * gtk/gtkpagesetupunixdialog.c (gtk_page_setup_unix_dialog_finalize): Free the custom paper list. (#403267, Felix Riemann) I don't have enough Gtk knowledge to debug farther. Any clue ?
Yes, that makes sense. paginate will never be NULL in gtkmm. I added a GTK+ bug: #482089.
Created attachment 96645 [details] [review] gtk_printop_paginate.patch Does this GTK+ patch really fix it for you? The gtkmm printing examples don't work for me now, either with or without this patch. When doing a print preview I get: murrayc@murrayc-desktop:~/svn/gnome220/gtkmm-documentation/trunk/examples/book/printing/simple$ ./example (example:31904): Gtk-CRITICAL **: gtk_print_context_get_cairo_context: assertion `GTK_IS_PRINT_CONTEXT (context)' failed Gtk-ERROR **: You must set a cairo context on the print context aborting... Aborted (core dumped) And when printing I get: murrayc@murrayc-desktop:~/svn/gnome220/gtkmm-documentation/trunk/examples/book/printing/simple$ ./example (example:31909): GLib-GObject-CRITICAL **: g_value_type_compatible: assertion `G_TYPE_IS_VALUE (src_type)' failed (example:31909): GLib-GObject-WARNING **: gsignal.c:2180: invalid object type `void' for value type `GtkPrintContext' (example:31909): Gtk-CRITICAL **: _gtk_print_context_set_page_setup: assertion `GTK_IS_PRINT_CONTEXT (context)' failed (example:31909): Gtk-CRITICAL **: gtk_print_context_get_cairo_context: assertion `GTK_IS_PRINT_CONTEXT (context)' failed Segmentation fault (core dumped)
The simple example works fine with a locally compiled 2.12 after patching it. Debian testing with gtkmm 2.10.10-0.2
Yes, I notice this too. I've made the correction in GTK+. gtkmm 2.10 didn't have the refcount bug. I've fixed it in 2.12 too.
Cool. Thanks :-) Time to try pushing this patch to Debian ;-)