khimaros / smart-auto-move

Smart Auto Move learns the size and position of your application windows and restores them to the correct place on subsequent launches. Supports Wayland.
https://extensions.gnome.org/extension/4736/smart-auto-move/
GNU General Public License v3.0
79 stars 4 forks source link

x11: maximized windows are not restored to correct workspace #32

Open sojusnik opened 1 year ago

sojusnik commented 1 year ago

There seems to be some issue with PWA created by Brave browser, see here for an explanation how to create them.

Those PWA windows only appear in "saved windows", if they aren't maximized, but sometimes you even have to restart Gnome (by alt+f2 and then "r") in order to be seen by your add-on. After adding the chosen PWA windows to "overrides" with "restore" enabled (default sync mode is "ignored"), they aren't restored, like all the other windows from different apps are, so my conclusion is that it has something to do with the Brave browser and the way it creates those PWAs.

Is this a known bug or limitation?

Happens on Ubuntu 22.04 with Gnome 42.2 on X11 (can't use Wayland, because of technical issues).

moore-bryan commented 1 year ago

FWIW, this extension works as expected for me with Brave PWAs on Fedora 36 with Wayland; I wonder if it could be an X11 issue...

khimaros commented 1 year ago

my suspicion is that the Brave windows are running through Xwayland and not native wayland apps. however, X11 apps (such as electron apps) are usually handled and restored correctly even without smart-auto-move.

do the PWAs have a distinct window title? the heuristic smart-auto-move uses is entirely title based, because there is no other way to uniquely identify apps across restarts in gnome-shell.

sojusnik commented 1 year ago

my suspicion is that the Brave windows are running through Xwayland and not native wayland apps. however, X11 apps (such as electron apps) are usually handled and restored correctly even without smart-auto-move.

This only happens when on X11. If a window isn't maximized, then it's restored properly, but if you maximize the window (and it's restored in a maximized state), then it's not working. Also, if you unmaximize the window, then it's suddenly getting restored to the right workspace. So the maximization of the window seems to block the restoration process.

Curiously, if you define on which workspaces apps should be opened with the Auto Move Windows Extension, then they are properly moved to a workspace, even when they are maximized.

On Wayland everything works fine though, so this is an X11 issue.

do the PWAs have a distinct window title?

Yes, since the restoration of those windows actually does work, but not if they are opened in a maximized state.