Open Bug 1796989 Opened 2 years ago Updated 10 months ago

Firefox opens windows in different desktop from the one it is launched in

Categories

(Firefox :: Session Restore, defect)

Firefox 106
Desktop
All
defect

Tracking

()

Tracking Status
firefox-esr102 --- affected
firefox106 --- affected
firefox107 --- affected
firefox108 --- affected

People

(Reporter: scopelmatt, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0

Steps to reproduce:

Open Firefox while using a desktop environment that supports multiple virtual desktops (i.e. Windows, Linux DEs, perhaps macOS?).

Actual results:

Firefox seemingly doesn't open. After clicking the taskbar icon again, I'm moved to another desktop, where in my previous session I've most likely used Firefox.

This is a problem, because nowadays most desktops (Windows, all Linux DEs, macOS), rely heavily on virtual desktops. The user expects to open an app and have it appear on the current desktop. Instead, Firefox opens in another desktop.

On Windows, I have 3-4-5 desktops at times, where I keep multiple windows with different programs. I don't always open the same app on the same desktop. Now, I cannot predict in which desktop Firefox is going to appear, and every single time I have to drag Firefox's windows to my current desktop.

On Linux Mint, which is running on another computer, this was even worse, as Mint's taskbar by default doesn't show as active apps from desktops other than the currently active. This meant that many times, when launching Firefox, nothing seemingly happened. Actually, everything was working fine: Firefox was just covertly opening on another virtual desktop.

As I don't have computers running macOS or GNOME at hand, I don't know if this happens there as well, but I imagine that it is similar, as they all rely on creating desktops when needed for multitasking.

I believe this is caused by this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1413147

Expected results:

Firefox should have opened on my current desktop, as does every single other software.

Summary: Firefox opens windows in different desktopfrom the one it is launched in → Firefox opens windows in different desktop from the one it is launched in

The Bugbug bot thinks this bug should belong to the 'Firefox::Shell Integration' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Shell Integration

Despite the broad name, the Shell Integration component was originally only intended for bugs related to determining if Firefox is the default browser, setting Firefox as the default browser, and setting the desktop background.

Over time, our team has started putting a few related issues in here, like registering Firefox as the default PDF viewer and making sure files have the correct icons when Firefox is set as the default handler for them. But I still don't think that Shell Integration is the right component for this.

I think that this probably needs to be fixed individually in each operating system. I'm just going to move it to what I think is the correct component to fix it on Windows, for now since I can't easily move this bug into multiple components.

Component: Shell Integration → Widget: Win32
Product: Firefox → Core

Based on bug 372650, this appears to be intentional. Moving to the correct component for further triage.

Component: Widget: Win32 → Session Restore
Product: Core → Firefox

Unfortunately we dont have the environment to test this issue on our side, adding the qa-not-actionable tag for now and we will try to reproduce this issue when we get our hands on a desktop that supports multiple virtual environments.

QA Whiteboard: [qa-not-actionable]

In case, Windows 10 or 11 will do, both support multiple virtual desktops. You can access them and create them using the Task View, accessible through a button on the panel or using the shortcut Win + Tab!

Also, if you are using Linux, all mainstream desktop environments supports virtual desktops. In GNOME, you can access using the Super button. In KDE, you can access them from your panel.

Or, if you're using macOS, you can use Mission Control (three/four finger swipes up on your touchpad). From there, you can create multiple desktops with ease.

Sorry for the double message, I hope this can help you in testing this issue.

Hi @scopelmatt, Thank you for the previous information, I thought I might need multiple Oracle VM or other types of Virtual Machines. I tried to reproduce this issue on a Windows 10 using Windows+Tab keys, creating multiple desktops and then just opening Firefox in each of them but Firefox always started on my end in the desktop environment I used.

The only thing I did notice was that if I Double click on the Firefox icon from the Taskbar and then Immediately change desktops, the Firefox Icon from a second Desktop would flash as if it was trying to open, and clicking it will always redirect me to the Desktop I launched it first, maybe on your end Firefox might start with a delay for some reason and switching desktops before it launches and then clicking the Taskbar icon will always redirect you to the first environment where it tried to launch the first time ?

Does Firefox never start in a different Desktop on your end ? or does this issue occur after you restart your machine and immediately trying to launch Firefox in Desktop 2 or 3 ?

Flags: needinfo?(scopelmatt)

I was able to reproduce this issue as well on my end, it seems that the issue is the "Open Previous Tabs and Windows" set in Settings.

Launch Firefox in Virtual Desktop 1 and Check the "Open Previous Tabs and Windows" in Settings.
Reach any website and close the Firefox Window.
Reach Virtual Desktop 2 and launch Firefox from taskbar.

The Firefox window will always launch in the first Virtual desktop.
Hitting The Firefox icon again will just open a fresh new Window in the 2nd Virtual Desktop while in the First Virtual desktop previous window and tabs have been restored.

Thanks scopelmatt for the extra info :)

Severity: -- → S3
Status: UNCONFIRMED → NEW
QA Whiteboard: [qa-not-actionable]
Ever confirmed: true
Flags: needinfo?(scopelmatt)
OS: Unspecified → All
Hardware: Unspecified → Desktop
See Also: → 1795531

I recently turned on the "Open Previous Tabs and Windows" option and also have this problem now in Linux using openbox window manager and also KDE Plasma.

I also noticed that with "open previous tabs and windows" disabled, pressing the CTRL-SHIFT-T shortcut after starting Firefox will move the Firefox window to whatever the last desktop was.

I wanted to add that now, after the introduction of Wayland support, Firefox's behavior is inconsistent across platforms. Currently, on Windows, Firefox opens on the same virtual desktop as when it was last closed, a behavior that no other app follows and that is not standard on the platform. On Wayland, as per (#1795531)[https://bugzilla.mozilla.org/show_bug.cgi?id=1795531], managing a window's position is up to the compositor, and not to Firefox.

Making Firefox behave like every other software would be so nice. Currently, every single day, when I open Firefox, I have to go find on which virtual desktop it ended up being this time, and move it to where I was.

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