Bug 427003 - Firefox always opens in the same virtual desktop where I last closed it, despite not being any window rule saying so
Summary: Firefox always opens in the same virtual desktop where I last closed it, desp...
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: rules (show other bugs)
Version: 5.19.5
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 422657 434818 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-26 18:35 UTC by David de Cos
Modified: 2021-06-10 20:25 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David de Cos 2020-09-26 18:35:02 UTC
I have had 4 virtual desktops arranged in a 2x2 grid for at least a decade. All the applications have always been opened in the active virtual desktop (which is the default behavior, as far as I know). However, three or four months ago Firefox started opening in the VD where I closed it for the last time.

There is no window rule regarding Firefox, either in systemsettings or ~/.config/kwinrulesrc. I have two rules that affect two other applications, but none of them has anything to do with remembering the VD where they were closed (I can't even find that specific setting in the window rules menu).

A couple of things I have noticed:

- Logging off doesn't make it forget where it closed for the last time.

- Let's say I'm in VD 1, but last time I closed Firefox I was in VD 4. If I launch Firefox, about 90% of the times it will open in VD 4, so I have to go to VD 4 manually in order to get the Firefox window. However, about 10% of the times, the desktop cube will rotate automatically and take me to VD 4, without me doing anything.

I don't expect people being able to reproduce this, because if this happened to everyone, it would have been noticed (and surely fixed) a long time ago. But I would be very grateful if someone could point me to the setting, configuration file or whatever, where this window rule might be hiding. Whatever it is, since it doesn't show up in the Window Rules list, I believe this to be a proper bug.

SOFTWARE/OS VERSIONS
OS: OpenSUSE Leap 15.2 (but this started back when I was using Neon)
KDE Plasma Version: 5.19.5 (might have started after updating to 5.19.0, but I'm not sure)
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1
Comment 1 Ismael Asensio 2020-09-26 19:04:11 UTC
Hi David, 

This is probably Firefox itself which remembers the VD and position it was closed, and sets it up again on opening. It also overrides a kwin rule that it's set as "apply initially", since the application sets the VD *after* the rule has effect, so there is not much that can be done on kwin side.

If you open a second firefox instance it should go to your current VD, since now the application doesn't try to restore its saved session information.

The fact that most of the times the view doesn't move to the VD where the new instance is open is also probably due to "focus stealing prevention".
Comment 2 David de Cos 2020-09-26 21:51:09 UTC
Hi, Ismael:

You're absolutely right! After doing some research, this behavior was intentionally implemented in Firefox 75. It got reported as a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1628742), and was resolved by adding the possibility of setting the variable widget.disable-workspace-management to TRUE in about:config. I just did it and it worked.

Thank you very much!
Comment 3 Patrick Silva 2021-06-06 12:03:04 UTC
*** Bug 434818 has been marked as a duplicate of this bug. ***
Comment 4 Patrick Silva 2021-06-10 20:25:39 UTC
*** Bug 422657 has been marked as a duplicate of this bug. ***