After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 473923 - PrintOperation not work
PrintOperation not work
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.10.x
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2007-09-05 14:11 UTC by elecboy
Modified: 2007-10-05 10:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk_printop_paginate.patch (508 bytes, patch)
2007-10-04 15:36 UTC, Murray Cumming
none Details | Review

Description elecboy 2007-09-05 14:11:51 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:
Comment 1 Mohammed Sameer 2007-09-28 23:10:43 UTC
I can confirm this with the latest gtkmm (2.12.0)
Comment 2 Mohammed Sameer 2007-09-29 00:12:32 UTC
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 ?
Comment 3 Murray Cumming 2007-10-01 08:20:22 UTC
Yes, that makes sense. paginate will never be NULL in gtkmm. I added a GTK+ bug: #482089.
Comment 4 Murray Cumming 2007-10-04 15:36:22 UTC
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)
Comment 5 Mohammed Sameer 2007-10-04 17:25:24 UTC
The simple example works fine with a locally compiled 2.12 after patching it.

Debian testing with gtkmm 2.10.10-0.2
Comment 6 Murray Cumming 2007-10-05 08:20:52 UTC
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.
Comment 7 Mohammed Sameer 2007-10-05 10:17:38 UTC
Cool. Thanks :-)

Time to try pushing this patch to Debian ;-)