Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window offsetting shouldn't assume new windows are automatically focused #3695

Open
tarek-y-ismail opened this issue Dec 6, 2024 · 0 comments · May be fixed by #3724
Open

Window offsetting shouldn't assume new windows are automatically focused #3695

tarek-y-ismail opened this issue Dec 6, 2024 · 0 comments · May be fixed by #3724
Labels
triaged Triage into JIRA to plan it in

Comments

@tarek-y-ismail
Copy link
Contributor

tarek-y-ismail commented Dec 6, 2024

Related: #2586, #3693

Our current implementation of window offsetting assumes that the offset is applied relative to the position of the currently focused window. This works when automatically focusing newly opened windows as each window is offset slightly from the one before it. But with focus stealing prevention, that is not the case as multiple windows could be spawned without changing focus, stacking on top of each other.

This might potentially cause clients that don't support xdg-activation to open behind the currently focused window, being completely occluded; or in the case of similarly sized windows, to completely occlude the windows behind them.

A reasonable implementation should take into account all visible windows and make an attempt to position new windows such that they don't occlude existing windows. In case this is not possible (fullscreen application, too many windows open), it would be acceptable to occlude an existing window.

github-merge-queue bot pushed a commit that referenced this issue Jan 20, 2025
Closes #2586.

Adds a new constructor to `FloatingWindowManagerPolicy` to control focus
stealing prevention. This in a nutshell stops new windows from being
focused and raised. When used with xdg-activation-v1, this improves
security as external actors can't just steal focus by opening a new
window (in addition to the niceties xdg-activation-v1 adds to
usability).

TODO:
- [ ] ~Fix window offsetting. This is built off the position of the
focused window, so all windows after the second one open in the same
(x,y) position.~
Split off to #3695
- [ ] ~Fix windows closing in the order of opening instead of front to
back. see
#3693 (comment)
Moved to #3694
- [ ] ~Make sure Xwayland applications work properly. My focus has been
on Wayland applications so far.~
Xwayland doesn't seem to support xdg-activation at the moment?
- [x] Alt + tab predictably broken :/
Have to focus other applications before they work with alt + tab
- [x] Decorations are not pushed behind the focused window
- [ ] ~Need some way to focus applications launched via Mir
(Ctrl-Alt+t/T for example)~
Will be in its own PR (#3703)
@tarek-y-ismail tarek-y-ismail added the triaged Triage into JIRA to plan it in label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Triage into JIRA to plan it in
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant