Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X.H.ScreenCorners Multi-Monitor Support #919

Open
nilscc opened this issue Jan 2, 2025 · 5 comments
Open

X.H.ScreenCorners Multi-Monitor Support #919

nilscc opened this issue Jan 2, 2025 · 5 comments

Comments

@nilscc
Copy link
Contributor

nilscc commented Jan 2, 2025

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: #918 (comment)

@nilscc
Copy link
Contributor Author

nilscc commented Jan 2, 2025

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

@geekosaur
Copy link
Contributor

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.

@nilscc
Copy link
Contributor Author

nilscc commented Jan 2, 2025

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

@geekosaur
Copy link
Contributor

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

@geekosaur
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants