Open Bug 1812489 Opened 2 years ago Updated 3 hours ago

Firefox Session Restore onto other virtual desktops may be confusing

Categories

(Core :: Widget: Win32, enhancement, P3)

Desktop
Windows
enhancement

Tracking

()

ASSIGNED

People

(Reporter: rkraesig, Assigned: gstoll)

References

Details

(Whiteboard: [win:multimonitors])

If you close Firefox with one or more windows open, then move to a virtual desktop where no Firefox windows were open, then restart Firefox, nothing will appear to happen. (Some Firefox windows may briefly flicker into existence.)

This is because windows are restored to their previous locations, including their associated virtual desktop; this is desired behavior. However, we could probably improve behavior in this context; Chrome and Edge, for example, switch to a(n arbitrary?) desktop to which one of their windows was restored.

(I'm not entirely sure how, though: there's no public Windows API to allow switching to another virtual desktop programmatically. Chrome doesn't appear to be using Windows' own undocumented unstable interfaces, so presumably there is a legitimate way.)

Stretching the whiteboard definition of [win:multimonitors] a bit here to include virtual desktops.

Severity: -- → S3
Priority: -- → P3
Whiteboard: [win:multimonitors]

I filed the 1811909 bug . More data points.
This issue of disappearing firefox windows become very prevalent if you do frequent windows update which require a restart.

(In reply to pratik.preet from comment #2)

I filed the 1811909 bug . More data points.
This issue of disappearing firefox windows become very prevalent if you do frequent windows update which require a restart.

It is unfortunate that your [1811909] (https://bugzilla.mozilla.org/show_bug.cgi?id=1811909) bug was closed, as this behavior is very annoying and clearly wrong (no other application behaves like this). The issue is prevalent even without restarts, if you frequently start and exit Firefox instances in different virtual desktops.

For reference, also see Microsoft recommendation: https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-ivirtualdesktopmanager "applications should avoid automatically switching the user from one virtual desktop to another. Only the user should instigate that change. In order to support this, newly created windows should appear on the currently active virtual desktop. In addition, if an application can reuse currently active windows, it should only reuse windows if they are on the currently active virtual desktop. Otherwise, a new window should be created."

Therefore solution is clear to me: if you are in VD A and start Firefox (with no other Firefox instance running), it should open in VD A. Even in case when it was running in VD B when it last ran, and even in case when it is already running in VD B. Opening it in VD B (current behavior) is not correct, neither would be doing it with switching user to VD B.

In other words, look at what others are doing (see Edge for example) and replicate the same behavior.

If someone can suggest how to give this bug a higher attention, please let me know. Best would be to re-open [1811909] (https://bugzilla.mozilla.org/show_bug.cgi?id=1811909) but not sure if that's possible, or filing a duplicate ticket?

(In reply to martin.pozor from comment #3)

Therefore solution is clear to me: if you are in VD A and start Firefox (with no other Firefox instance running), it should open in VD A. Even in case when it was running in VD B when it last ran, and even in case when it is already running in VD B. Opening it in VD B (current behavior) is not correct, neither would be doing it with switching user to VD B.

And what if Firefox was open on virtual desktops C and D when it closed, and the user shut down the system from desktop B and then restarted Firefox from desktop A?

(That's not a hypothetical question. I did exactly this yesterday.)

Now that I have a fix for bug 1423768, I'm going to take a look at this.

Assignee: nobody → gstoll
Status: NEW → ASSIGNED
See Also: → 1423768

Testing with Chrome and Edge, they seem to behave the way that this bug thinks we should - if Chrome/Edge are closed with a window on Virtual Desktop 1, then the user switches to Virtual Desktop 2 and launches Chrome/Edge, the window is restored to Virtual Desktop 1 and focus is taken there.

There's some documentation on what Chromium does here, which may be helpful.

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