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 637069 - Custom print settings set in custom-widget-apply are lost
Custom print settings set in custom-widget-apply are lost
Product: gtk+
Classification: Platform
Component: Printing
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks: 616883
Reported: 2010-12-12 11:56 UTC by Carlos Garcia Campos
Modified: 2010-12-20 20:12 UTC
See Also:
GNOME target: ---
GNOME version: ---

Set new print operation settings before emitting custom-widget-apply signal (1.29 KB, patch)
2010-12-12 12:00 UTC, Carlos Garcia Campos
none Details | Review

Description Carlos Garcia Campos 2010-12-12 11:56:53 UTC
The problem is in gtkprintoperation-unix.c (handle_print_response). When operation is apply:

1.- a new settings object is created by gtk_print_unix_dialog_get_settings(), 
2.- custom-widget-apply is emitted, in the callback we get the current settings from the print operation object to save our custom settings.
At this point we have two different settings, the new one with the options selected by the user in the print dialog, and the old one with the custom settings.
3.- finish_print() calls gtk_print_operation_set_print_settings() with the new settings, so that current print operation settings are lost.

We have this problem in Evince, see bug 616883, and I found the issue when implemented custom options in poppler print demo, see
Comment 1 Carlos Garcia Campos 2010-12-12 12:00:59 UTC
Created attachment 176277 [details] [review]
Set new print operation settings before emitting custom-widget-apply signal

We can just set the print operation settings before emitting the custom-widget-apply signal. Since finish_print() can be called from other places we can still set the settings there, gtk_print_operation_set_print_settings() checks whether priv->settings == settings, so calling it multiple times with the same settings is not a problem.
Comment 2 Matthias Clasen 2010-12-20 18:54:52 UTC
Looks ok to me.
Comment 3 Carlos Garcia Campos 2010-12-20 20:12:36 UTC
Pushed to both gtk-2-24 and master branches.