-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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_get_current_screen for X11 display server #42117
Fix window_get_current_screen for X11 display server #42117
Conversation
How does this PR compare to the older #37506? |
Both are potentially valid changes. This PR just fixes the way the screen is selected for a given window position on Linux, to make it more reliable, and consistent with Windows platform. It might supersede the X11 part of #37506 but I'm not 100% sure. #37506 does more general improvements on multi-screen configurations for all platforms. It was done before some heavy changes in the display servers and popup windows, so it would need to be checked again to make sure the way it's implemented still makes sense. |
044fa95
to
1dfc434
Compare
Rebased. |
Is this still relevant for current |
1dfc434
to
676942e
Compare
@akien-mga Yes, I've just rebased and re-tested and it's still relevant on master. It fixes a bug where a popup appears on the wrong screen if the top-left corner of the window is outside of the screen. With this PR the result is identical between Linux and Windows. I agree it could help to merge for the alpha so we have more time for user testing. |
This method used to check which screen contains the top-left corner of the window (and default to the first screen in case none is found), which is not accurate in some cases. Now the area of overlap with each screen is calculated, so we can get the best candidate based on the window's position. This makes window_get_current_screen consistent with Windows platform, and fixes an issue where popups appear on the main screen when the main window is slightly moved outside of the desktop on the top or left.
676942e
to
b34480b
Compare
Thanks! |
This method used to check which screen contains the top-left corner of the window (and default to the first screen in case none is found), which is not accurate in some cases.
Now the area of overlap with each screen is calculated, so we can get the best candidate based on the window's position.
This makes window_get_current_screen consistent with Windows platform, and fixes an issue where popups appear on the main screen when the main window is slightly moved outside of the desktop on the top or left.