pop-os / cosmic-comp

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

[FEATURE REQUEST] Grab focus without raising the window #863

Open BrodieRobertson opened 2 months ago

BrodieRobertson commented 2 months ago

Continuing on from a discussion in https://github.com/pop-os/cosmic-settings/issues/566

Currently when a window is given focus that window is placed above all of the other windows, this makes sense for dialogs and other such windows that demand focus but for many others can be quite disruptive if you tend to overlap windows, especially so when using focus follows cursor. KDE Plasma and a lot of window managers addresses this by allowing the user to separate focus and window raising into 2 separate actions if they desire.

As an example, in this video the window with the red border currently has focus, I have it so window raise only occurs after you click on a window.

https://github.com/user-attachments/assets/51084c23-ec55-48a0-b776-735781bf4ba4

WatchMkr commented 1 month ago

If you have to click, how is this different than Focus follow cursor being off? Is there more to it than an outline showing what will have focus when clicking?

This suggestion might be related. https://github.com/pop-os/cosmic-comp/issues/876

My suggestion there is to raise the window when cursor stops so as to not erroneously raise other windows.

BrodieRobertson commented 1 month ago

If a window is in focus but not raised you should still be able to type on that window

https://github.com/user-attachments/assets/1b22ac0b-a104-4b1a-8da3-05c93d7df64a

skewballfox commented 1 month ago

Just adding a bit of context. Right now, focus follows mouse, causes things windows like steam settings (x11) and chrome captions (wayland) to be hidden behind the parent window.

Not sure what the approach should be.

My suggestion there is to raise the window when cursor stops so as to not erroneously raise other windows.

That's the approach gnome takes. Though there are situations where you want a window to remain on top even if it doesn't have keyboard focus.