-
Notifications
You must be signed in to change notification settings - Fork 104
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
Fix window offsetting with focus stealing prevention #3724
base: main
Are you sure you want to change the base?
Fix window offsetting with focus stealing prevention #3724
Conversation
584bbc4
to
3dd2a30
Compare
There's a bug where a 1280x1024 fullscreen window is returned from |
Check which layer it is in. You're likely seeing the background |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a piece of code that could use and would yield nicely to some unit testing?
if(focus_stealing == FocusStealing::prevent) | ||
try_place_new_window_and_account_for_occlusion(parameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Focus stealing prevention shouldn't be a factor when placing new windows, why wouldn't you just use the same in both cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a piece of code that could use and would yield nicely to some unit testing?
Indeed, just wanted your opinions on the base idea before investing more time into it.
Focus stealing prevention shouldn't be a factor when placing new windows, why wouldn't you just use the same in both cases?
Well. For one: thou shalt not change established behavior. But in all seriousness, this much work isn't really needed when focus stealing prevention is off, you just place the window somewhere according to the old logic and it's going to be on top anyway. If you deem it suitable enough for FSP=off, then I'm okay with that
Closes #3695
Adds occlusion checking when placing down new windows. The checks continue with an increasingly larger radius until no positions around the window fit in the active output or no possible window rectangle overlaps with the active output. The checks are also capped to 16 "iterations" so they don't go on forever, just in case.
Here's how it looks like now:
Screencast.from.2025-01-21.17-58-52.mp4
How it works: