glazewm icon indicating copy to clipboard operation
glazewm copied to clipboard

[Bug] focus-follows-mouse incorrectly handles multiple monitors with different scaling

Open freestingo opened this issue 2 years ago • 0 comments

There are three displays in my setup organized as follows:

immagine

I noticed that when the displays do not all have the same Scale percentage setting applied (in this case, display 2 has 150% scaling and others have 125%), focus is applied to the wrong windows if the cursor approaches monitor borders.

focus-follows-mouse

In the video you can see screen 3; every time the browser window loses focus, a window on screen 2 (on the left, outside video frame) gets focused instead, even though the cursor is still within screen 3. It behaves exactly like if the right side of screen 2 overlaps with the left side of screen 3; for what it's worth, I suspect it's a bug of the WindowFromPoint function used inside FocusContainerUnderCursorHandler, because if I set the Scale display setting to be the same in all displays (for example, 125%) focus is instead applied correctly everywhere, as expected, and no bug happens.

Thank you for all your work! I really appreciate it.

freestingo avatar Dec 13 '23 21:12 freestingo