Re: [hackers] [slock][PATCH] Fix resize with multiple monitors and portrait mode

From: Bob Uhl <buhl_AT_zvelo.com>
Date: Tue, 22 Nov 2016 11:24:13 -0700

Markus Teich <markus.teich_AT_stusta.mhn.de> writes:
>
>> When connecting/disconnecting a portrait monitor, the
>> XRRScreenChangeNotifyEvent height & width are reversed due to the XRandR
>> rotation; detect this and DTRT.
>
> I cannot reproduce your issue. I have a script which switches to my
> dock-connected display when I dock my laptop and added a "--rotate left" to the
> xrandr command, but slock still covers the whole screen correctly without your
> patch.

(sorry for the delay; I've been out of the office)

Did you try connecting/disconnecting the monitor?

To give an idea of how my desktop is arranged, here's a screenshot of
the whole thing: <https://i.imgsafe.org/489c1a5249.png>. The external
portrait monitor is the left-hand screen, and the laptop monitor is the
right-hand screen.

In case it helps in reproducing the issue, here's my xrandr command
line:

  xrandr --output HDMI1 --mode 2560x1440 --pos 0x0 --rotate left \
  --output eDP1 --mode 1366x768 --pos 1440x664 --rotate normal \
  --output VGA1 --off

And here's a screenshot of the effect when slock is invoked, and I then
disconnect the external screen: <https://i.imgsafe.org/48a1aab15a.png>.
As you can see, the right hand of the screen is not covered by slock.

I did some experimentation, and found that the height and width are
switched when the screen is rotated. A few printf statements revealed
that was indeed the case.

A similar patch for a different project is found at:

  https://bugs.freedesktop.org/attachment.cgi?id=2994&action=edit

Bob Uhl
Received on Tue Nov 22 2016 - 19:24:13 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 22 2016 - 19:36:16 CET