xmonad-contrib
xmonad-contrib copied to clipboard
X.H.ScreenCorners Multi-Monitor Support
Problem Description
- The
ScreenCornershook currently uses the entire X11Screenrectangle, which causes multi monitor setups with non-consistent resolutions (e.g. laptop + external, or vertical + landscape monitor) to have inaccessible corners. - If the screen layout changes (hotplugging monitors, for example) you need to restart xmonad with mod-q to fix the screen corners. (thanks @geekosaur)
See also discussions on: https://github.com/xmonad/xmonad-contrib/pull/918#issuecomment-2567939389
The function getCleanedScreenInfo should deliver the correct screen rectangles...
Given that a redesign will necessarily need to take in all monitors instead of an active one, perhaps it should use logHook instead of being a layout.
We could still remain backwards compatible and default to the first screen with the current addScreenCorner functions. This way single screen setups would not need to be changed. Additionally I would introduce a addScreenCornerOn :: Rectangle -> ScreenCorner -> X() -> X() method (or something equivalent) and have the addScreenCorner be something like:
addScreenCorner corner x = do
(rect:_) <- withDisplay getCleanedScreenInfo
addScreenCornerOn rect corner x
As I see it currently we simply need to fix the internal createWindowAt method to receive another argument with the correct screen dimensions...
That sounds wrong, if you use the current screen dimensions then you get the current bad corners (the asterisks in my example here)?
Also I must amend my earlier (in the linked comment) statement about my local screen behavior: I've replaced the screen in my laptop with a higher resolution one (yes, I have one of those fancy user-upgradeable laptops now) and now X11 thinks the laptop panel is larger than the other two, so I no longer see the "stuck" behavior when I was seeing it before; instead, if the mouse is in the lower ¼ of the laptop panel, it can't move into either external monitor.