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

When using two monitors, switcher straddles both #47

Closed
eater opened this issue Feb 20, 2018 · 11 comments
Closed

When using two monitors, switcher straddles both #47

eater opened this issue Feb 20, 2018 · 11 comments

Comments

@eater
Copy link
Contributor

eater commented Feb 20, 2018

I have two monitors connected to my desktop. When I invoke Alttab, the switcher window appears right in the middle of the two, half on one and half on the other.

@eater
Copy link
Contributor Author

eater commented Feb 20, 2018

Correction: when the mouse pointer is on the first display when I invoke Alttab, the switcher appears correctly, right in the middle of that monitor. When the mouse pointer is on the second display, though, the switcher appears straddling the two monitors.

sagb added a commit that referenced this issue Feb 22, 2018
@sagb
Copy link
Owner

sagb commented Feb 22, 2018

Thank you for reporting this.
Could you perform any of the following?

  1. Update to latest master, run alttab like

alttab -v 2>&1 | grep "uiwin "

and post the output here.

  1. (probably hard) Find an example program with expected behaviour, i.e. any window positioned in the way which you expect from alttab, then run xprop for this window and post full output here.

technical notes

for centering in different WMs, alttab uses the following altogether:
explicit position/size hints,
_NET_WM_WINDOW_TYPE_DIALOG property,
WM_TRANSIENT_FOR hint,
USPosition/USSize hints,
PPosition/PSize hints.

@eater
Copy link
Contributor Author

eater commented Feb 22, 2018

OK. I upgraded to the latest master -- previously I had installed from AUR. Now in both displays, the switcher appears in the bottom right, not the center as before, and extends off the right edge.

  1. $ alttab -v 2>&1 | grep "uiwin "
    first display (1680 x 1050) :
no icon in WM hints ( alttab -v 2>&1 | grep "uiwin ")
0: c0f80d (lvl 0, icon 12814049 (512x512)):  alttab -v 2>&1 | grep "uiwin "
uiwin w=848 h=144, x=956 y=888, scr w=2760 h=1920, default was 0 now 0

second display (1920x1080):
uiwin w=728 h=144, x=1016 y=888, scr w=2760 h=1920, default was 0 now 0

  1. xprop
WM_CLIENT_MACHINE(STRING) = "falk"
_NET_WM_PID(CARDINAL) = 11563
_NET_STARTUP_ID(UTF8_STRING) = "i3/rofi/8985-62-falk_TIME330154383"
WM_CLASS(STRING) = "rofi", "Rofi"
WM_NAME(STRING) = "rofi"
_NET_WM_NAME(UTF8_STRING) = "rofi"
_NET_WM_STATE(ATOM) = _NET_WM_STATE_ABOVE

Let me know if I can do anything more to help -- I'd love to get this (and #48) working!

@sagb
Copy link
Owner

sagb commented Feb 22, 2018

Please pull again and show:

alttab -vv 2>&1 | grep "uiwin "

(note two "v")

@eater
Copy link
Contributor Author

eater commented Feb 22, 2018

Pulled again. First display:

no icon in WM hints ( alttab -vv 2>&1 | grep "uiwin ")
[5]  alttab -vv 2>&1 | grep "uiwin "
[5]  alttab -vv 2>&1 | grep "uiwin "
5: c0f80d (lvl 0, icon 12814049 (512x512)):  alttab -vv 2>&1 | grep "uiwin "
uiwin 848x144 +956+888, 1 screen(s): [2760x1920] 

Second display:
uiwin 848x144 +956+888, 1 screen(s): [2760x1920]

@sagb
Copy link
Owner

sagb commented Feb 22, 2018

1 screen(s): [2760x1920]

Unfortunately, alttab only sees this single combined screen (of ridiculous dimensions, is your second monitor rotated 90 degrees?), and behaves as expected.
Perhaps Xinerama or xRandr would be useful here, but this will complicate the code and bring new dependencies. Let's try one of the following instead:

  1. An option to disable centering at all. The switcher will be placed at the position where your WM usually places dialog windows.
  2. An option to explicitly specify coordinates of center of the switcher. This way, you may specify the single exact position like "the center of the first monitor".

Which option do you think is more suitable for you and perhaps other multi-monitor users?

@sagb
Copy link
Owner

sagb commented Feb 22, 2018

I believe rofi does nothing on this matter, so it's equivalent to (1).

@eater
Copy link
Contributor Author

eater commented Feb 22, 2018

Haha, yes, just this morning I rotated the second monitor. I think option 1 should work well.

sagb added a commit that referenced this issue Feb 22, 2018
@sagb
Copy link
Owner

sagb commented Feb 22, 2018

I've implemented both. Pull and try:

alttab -p none
alttab -p +100+100

@eater
Copy link
Contributor Author

eater commented Feb 22, 2018

Perfect! Both methods work. Because my two displays are different resolutions (and now different orientations as well) it's hard to find absolute coordinates that give a nice positioning depending on which display is focused, so I'm happiest with -p none.

@eater eater closed this as completed Feb 22, 2018
@sagb
Copy link
Owner

sagb commented Mar 19, 2018

eater, did you ever see such a clipping in your i3 multi-monitor configuration? #54, see screenshots.
Please comment there if you have any suggestions.

sagb added a commit that referenced this issue Mar 27, 2018
introduce XRANDR
-vp [focus|pointer]  to limit GUI viewport
-sc  for selection windows by screen
numerous bug fixes
related: #54, #47
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