xmonad-contrib icon indicating copy to clipboard operation
xmonad-contrib copied to clipboard

X.H.ScreenCorners Multi-Monitor Support

Open nilscc opened this issue 11 months ago • 5 comments

Problem Description

  • The ScreenCorners hook currently uses the entire X11 Screen rectangle, 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

nilscc avatar Jan 02 '25 17:01 nilscc

The function getCleanedScreenInfo should deliver the correct screen rectangles...

nilscc avatar Jan 02 '25 17:01 nilscc

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.

geekosaur avatar Jan 02 '25 17:01 geekosaur

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...

nilscc avatar Jan 02 '25 18:01 nilscc

That sounds wrong, if you use the current screen dimensions then you get the current bad corners (the asterisks in my example here)?

geekosaur avatar Jan 02 '25 20:01 geekosaur

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.

geekosaur avatar Jan 02 '25 23:01 geekosaur