GNOME Bugzilla – Bug 577642
Selected Printer Does Not Stick Between Sessions
Last modified: 2018-04-15 00:29:31 UTC
The printer settings are not restored in the print dialog if there are a lot of printers configured. A downstream bug was filed in evolution for the same. The description goes as follows, Patch was applied to Evolution 2.6 and we need to get something similar into 2.24. When the user prints, that same printer needs to be striped and selected all future attempts to print. We have over 50 printers, and the users cannot be scrolling through the list each time. https://bugzilla.novell.com/show_bug.cgi?id=479152 .
Created attachment 131864 [details] [review] Fixes the bug
ping, anyone up for patch review ?
Marek, can you look at this ?
This makes sense to me, since that call to selected_printer_changed isn't user-initiated, it's triggered by the printer status changing.
Hi chenthill, I'm sorry about the long response. Is the problem that the printer is not selected or that the printer is selected but the list of printers is not scrolled correctly to the selected printer or that settings values given to the print dialog are not shown in the print dialog? Or, is it about selecting default printer? Do you have number of the evolution bug? Regards Marek
Could someone look at this patch? (I have no idea whether Marek is still the person to look at it.) The behavior is the same in 3.9.90. Anyway, in gtk_print_unix_dialog_set_settings, we call set_active_printer(), passing it the printer returned by gtk_print_settings_get_printer(). Later, cups_request_printer_list_cb gets called (if the cups back end is being used). Printers are added, and then a printer-status-changed signal is sent for the new printer, calling printer_status_cb in gtkprintunixdialog.c. printer_status_cb calls selection_changed_cb, which has a comment saying that it stops looking for a default printer when the user changes the selection. But, as Gabriel commented earlier, this change isn't triggered by a user action--it is triggered by a reply from cups in response to a request for the list of printers--so the patch looks right to me. I'm pretty sure the downstream bug being referred to is https://bugzilla.novell.com/show_bug.cgi?id=479152, which was filed against SLED and is unfortunately not public, but this bug's description contains the gist of it, and I can reproduce it with, say, gedit. Ie, with the patch, printing defaults to the last printer that was used.
Comment on attachment 131864 [details] [review] Fixes the bug Hi, thank you for the patch, it fixes the problem for me. I've just pushed it to master. Btw, I'm investigating similar problem now. There is the same problem with printers which show after acquiring of details for default printer. These are mainly avahi printer for me. Similar fix, applied in printer_details_acquired(), works partially for this problem because a callback which returns information about color profile changes an option which is interpreted as a change initiated by user and hence the default printer is kept selected. Unfortunately, it seems to me that this problem will need an API change. I'll return to this later. Regards Marek
Can we push this to gtk-2-24 as well? The bug was originally reported against gtk 2.
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new