fix fullscreen using pointer on several monitors - #2049
Conversation
Davidy22
left a comment
There was a problem hiding this comment.
We do have tests for some things, this specific case is not one of the things covered by the test suite among other multi-monitor things. Might be nice to have. For now, the code looks alright and works for me as well, just want to check one thing before merging.
| dest_screen = screen.get_primary_monitor() | ||
|
|
||
| # Use primary display if configured | ||
| if dest_screen == ALWAYS_ON_PRIMARY: |
There was a problem hiding this comment.
I believe the always on primary option in the "Appear on display" drop-down is for using the system configured primary display if chosen, while other options in the drop-down let the user override with a specific monitor. Looks like the explicit check is removed here in favor of a catch-all if the search for a specific monitor falls through. Not noticing adverse side effects from the removal of this, raising this in case any potential edge case comes to mind.
There was a problem hiding this comment.
I don't see any side effects as well as it merges the behavior of lines 309 and 313.
I can add it back if you want to.
There was a problem hiding this comment.
Looked fine, just wanted to make sure we didn't accidentally kill any of the defined monitor options.
This PR fixes the problem described in #928 (at least on my computer)
I'm using several monitors with dock bar on all monitors and top bar on the main monitor.
It seems that when the guake's window height is larger than the height of the monitor excluding top/dock bars height, the monitor is sometimes "ignored" by gdk. If I'm resizing the guake window to be smaller than this height, it works.
The bug is at
screen.get_monitor_at_point(x, y).It returns the number of the wrong monitor when I'm encountering the problem.
In this PR, I've reworked the method
get_final_window_monitorto use latest gdk APIs (as pointed out by the TODO in the code) and instead of using.get_geometry(), I'm using method.get_workarea()which seems to return the rectangle "usable" by an application (without dock / top bars or else)I've also tested manually all guake's options of "Appear on mouse display" on single/multiple monitors and it works as expected.
I'm not used to guake and gdk libs so I don't know if it can break things or if you have specific "integration" tests to do other than tests in the lib ?