mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
Monitor size is calculated wrongly when scaled #117
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @markgeejw on GitHub (Jul 16, 2022).
Hi! Thanks for this great project!
I noted that you had implemented cross-monitor focus/move with #165, but it wasn't working for me, which seems to be due to scaling.
Setup:
After digging into the code a little, it seems that the condition for
monitor_index_in_directionwas not being met due to the monitor sizes not lining up. Usingkomorebic state, I noted that my left monitor was reporting{left: -2560, right: 1707}and my right monitor{left: 0, right: 1707}. If I set both monitors scaling to 100%, everything works great, with the monitor sizes being reported correctly and cross-monitor focus working. Seems to be something to do with how Windows is reporting monitor size information.I tried digging into the Windows API a little but couldn't find the problem.
@LGUG2Z commented on GitHub (Jul 16, 2022):
I have just tested this with two monitors at different scaling percentages between 100 and 200 on both monitors and I was able to both
focusandmoveacross monitor boundaries. I typically have 125% on my main monitor and 150% on my secondary monitor and I haven't noticed this before.Running
komorebic state | jq '.monitors.elements[].size'I get the following output:Which matches up with what I see in my display settings (with the array ordering matching the numerical order given in the settings UI):
From reading this, it seems like your left monitor is not being recognized in the display arrangement settings as being the left-most monitor, because
leftis not0.Can you report back with the output of the above command which uses
jqto extract the monitor sizes in order and the numerical order and layout given by Windows in the display settings UI?@markgeejw commented on GitHub (Jul 17, 2022):
I think it's because I use my right monitor as my main display.
But even when I switch the main display to the left monitor it still doesn't work.