GNOME Bugzilla – Bug 693186
GNOME Printer Setup Tool: HP printers discovered by both usb and hp CUPS backends -> prefer hp backend
Last modified: 2015-07-13 10:11:23 UTC
I have several HP printers. If I connect one of them via USB and click the "+" button to add a new printer in GNOME's printer setup tool, I get two entries where a user will not see the difference: HP-LaserJet-3390 HP-LaserJet-3390-2 To find out why I got two entries, I added two print queues, one using the first entry, another using the second entry. Then I ran the command lpstat -v and got device for HP-LaserJet-3390: usb://HP/LaserJet%203390?serial=00CNMJP81545 device for HP-LaserJet-3390-2: hp:/usb/HP_LaserJet_3390?serial=00CNMJP81545 So the first comes from the HP LaserJet 3390 discovered via the "usb" CUPS backend and the second from the same printer via the "hp" backend. The preferred backend is the latter, as it is made by HP especially for HP printers. Therefore there should be only one entry, using the "hp" backend. system-config-printer does this correctly, so using the D-Bus service of system-config-printer one should be able to join these entries to one using the "hp" backend. Note that this is not a duplicate of bug 693183. That bug is about making duplicate entries distinguishable, this bug is about making the "hp" backend used with HP printers. Also reported at Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1115701
sounds like a bug in the printing system (ie cups) - if the there is a preferred backend, it should be used. We don't want to let the user play guessing games as to which driver to use.
Problem is that CUPS runs all backends in turn and lists all the backend's discovery results. There is no information about what has priority. system-config-printer knows the priorities and joins the entries coming from the same printers and selects the preferred entry as default. Using the D-Bus service of system-config-printer one should be able to join the two entries to one using the hp backend.
Created attachment 303922 [details] [review] Don't show the same device multiple times The 'New printer dialog' already uses the 'GroupPhysicalDevices' method but the list of devices passed into it was wrong. Attached patch fixes the problem by passing all discovered devices to it and by replacing an existing device in the list by a better alternative if there is any. Another problem related to this could be the one from https://bugzilla.gnome.org/show_bug.cgi?id=749830.
Review of attachment 303922 [details] [review]: Looks fine to me. Don't forget to cherry-pick in earlier versions.
Comment on attachment 303922 [details] [review] Don't show the same device multiple times (In reply to Bastien Nocera from comment #4) > Review of attachment 303922 [details] [review] [review]: > > Looks fine to me. Don't forget to cherry-pick in earlier versions. Thank you for the review. I've pushed the patch into master, 3.16 and 3.14.