pop-os / cosmic-comp

Compositor for the COSMIC desktop environment
GNU General Public License v3.0
466 stars 83 forks source link

Fullscreen window can lose focus without obvious indication #696

Open KoreshKrasa opened 1 month ago

KoreshKrasa commented 1 month ago

Currently fullscreen window can lose focus if Super+Arrow is pressed but focused window is not shown. Similar happening with maximized window if tiling is enabled. I think in those cases if window is not raised to top than fullscreen/maximized window should not lose focus.

Drakulix commented 1 month ago

Should be fixed by https://github.com/pop-os/cosmic-comp/commit/f9d39144ede8f873736d6c6f3da3df22fc5bc35b and https://github.com/pop-os/cosmic-comp/commit/7660f7aaa9d0730f6cfd72c36f106fc4e514ac06

KoreshKrasa commented 1 month ago

Navigation with Super+Arrows works but issue is not completly solved. I am still able to move focus to other windows.

In tiling mode alt+tab/launcher and workspace view still changes focused window.

Fullscreen window behave strange with workspace view. Window focus got split??? I am still able to type in terminal but super+q was closing text editor (Also F11 was not passed to terminal without change of focus in workspace view).

https://github.com/user-attachments/assets/70419d7b-d67e-4760-b85c-4812d76d53ab

drazil100 commented 2 weeks ago

If you move a window between workspaces (Shift+Super+Arrow) to a workspace with a fullscreen window the focus appears to be on the window you just moved. Super+M fullscreens the just moved window on top of the previous window while the old window is still fullscreened.

KoreshKrasa commented 6 days ago

@Drakulix not sure if this is in line with design plans but maybe full screen windows can be moved to separate workspace exclusive to this full screen window. E.g. if user have 3 worksapces and full screen window opened from first one it will insert separate ful lscreen workspace like: 1,2,3 -> 1,f1,2,3. If more full screen windows are spawned they will go like: 1, f2, f1, 2, 3. And then compositor should just restrict movement of other windows to full screen workspace. Then It will only require launcher to be able to penetrate full screen to switch applications.

Drakulix commented 4 days ago

@Drakulix not sure if this is in line with design plans but maybe full screen windows can be moved to separate workspace exclusive to this full screen window. E.g. if user have 3 worksapces and full screen window opened from first one it will insert separate ful lscreen workspace like: 1,2,3 -> 1,f1,2,3. If more full screen windows are spawned they will go like: 1, f2, f1, 2, 3. And then compositor should just restrict movement of other windows to full screen workspace. Then It will only require launcher to be able to penetrate full screen to switch applications.

That sounds a lot like how MacOS handles fullscreen. Afaik this was considered at some point, but definitely doesn't represent our current designs. Ping for @pop-os/ux just in case we want to reconsider this in general. But in any case the focus issues described in this issue should be fixed regardless.

git-f0x commented 3 days ago

IMO, a fullscreen window should behave mostly like any other window, with its own focus layer (e.g. if an app is opened in the same workspace as the fullscreen window, it would display over it, and would go under if the fullscreen window is focused), or the fullscreen window should minimize when it loses focus to another app (though this might be worse in case a sticky window of another app is used). Though I'm not sure if there are other use cases for fullscreen windows, other than for gaming or increasing screen real-estate. Tiling should also probably have its own focus layer (shared by all tiled apps), so that a floating app can go behind the tiled windows when it's unfocused.

KoreshKrasa commented 22 hours ago

Tested it again. Found one edge-case with fullscreen windows. If there is 2 or more fullscreen windows only one can be accessed.

https://github.com/user-attachments/assets/26b6550b-6813-4512-8aad-496b771fc325

Also there is still issue with maximized windows that focus can be changed from workspace view or launcher/alt+tab

https://github.com/user-attachments/assets/f16069b4-a82d-4303-8324-08c2f52648d5