Open Bug 1690208 Opened 4 years ago Updated 4 years ago

Detect changes to the system default printer, and update our own default printer accordingly (if we were previously defaulting to the system default)

Categories

(Core :: Printing: Setup, task)

task

Tracking

()

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Bug 1685933 describes an interesting problem that I think we could avoid without too much trouble.

The scenario is basically as follows (I'm guessing / filling in some of the under-the-hood details, but I think this is an accurate description of what happens)
(1) User starts their first-ever Firefox print operation.
(2) Firefox notices that it doesn't have any "last used printer" saved, so we ask the system for its default, and we offer that to the user as the default print target.
(3) User clicks through the print dialog (using the default printer that we offered them)
(5) Firefox remembers the printer that was used (in the print_printer about:config preference), based on an assumption that the user will probably want to print to this same printer again.

This remembering would be useful if the printer happens to choose a non-default print target and wants to print another few documents to that same target; however, in this scenario here, let's say they just stuck with their system default.

Now, back to our story:
(6) The user comes along and unplugs their default printer and plugs in a new one, and updates their system default to be the new printer.
(7) The user prints again, and they expect Firefox to use the new system default; after all, we always offered them the system default before (as far as they could tell; they never chose anything different).
(8) Firefox disappoints the user by offering them their no-longer-connected previous-system-default printer, because that's what we've got saved in the print_printer setting.

To move on from this point, I think the user would have to manually choose their new system-default printer from our dropdown-menu and complete a print operation, before we'll start offering them that printer by default for subsequent prints. This is mildly annoying/surprising, and it's much worse if the user has chosen print.always_print_silent (e.g. for a kiosk as in bug 1685933) because then they won't see (and never will have seen) any firefox UI to choose between their available printers.

ROUGH PROPOSED SOLUTION:
(1) When we initiate a print operation, we should record what the system's default printer is, in some about:config pref -- let's say print_printer.system_default or something like that.
(2) When we do this: if we notice that the system's default printer has changed (i.e. the new value of this print_printer.system_default doesn't match the old value), and we notice that print_printer does match the old value, then we should throw away print_printer and offer the user the new system-default printer.

(EDIT: actually there are simpler ways of implementing this; see next comment for an alternative simpler approach)

Phrased more simply:

  • Right now, Firefox always defaults to using the last printer that the user printed to (as recorded in print_printer).

I think we need to add a caveat to that, which is:

  • If the user chose the system-default in the last print operation, AND the system-default has changed (it no longer matches the print_printer that we saved from that last print operation), then we should offer the current system default as the default print target in our print dialog.

This will make things more predictable for users who mostly only ever print to their system-default printer (and who occasionally might change their system default). And it makes things behave reasonably for the print.always_print_silent use-case without forcing users to mess with their about:config settings.

I can think of a few ways to implement this, but perhaps the simplest approach would be to notice when the user has chosen to print to the system-default printer, and clear print_printer (instead of setting it to the printer name) in that situation. That way, users who print to the system-default printer will be offered the system-default printer on their next print operation, even if the system-default has changed between the two print operations.

I'm curious if other folks see any problems with this approach (particularly the suggested implementation strategy of clearing the pref), or have any better ideas for how to address this papercut.

You need to log in before you can comment on or make changes to this bug.