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

Monitor hotplugging #960

Closed
main-- opened this issue Oct 25, 2016 · 9 comments
Closed

Monitor hotplugging #960

main-- opened this issue Oct 25, 2016 · 9 comments

Comments

@main--
Copy link

main-- commented Oct 25, 2016

Sway gets very confused whenever I connect or disconnect one of my monitors.

The most common issues are:

  • I expect a dead output's workspaces to be moved to any of the remaining screens (and I'm pretty sure that's how i3 handles it). Instead, the workspace usually still exists but there's no way to view it. Sometimes the whole workspace just disappears. In that case the applications may or may not die.
  • When connecting my second monitor, sway starts rendering all workspaces on the wrong display: When I select a workspace from the left screen, the left bar highlights it correctly but the actual windows appear on the right screen and vice versa. It's fully inverted.
  • Monitor hotplug can sometimes make the bar disappear.
  • When disconnecting the last monitor, sway drops all windows and workspaces. Upon reconnecting, the windows will be behind everything, just like swaybg usually is. Even mouse interaction is still possible. This is especially annoying as there is no workaround - I have to exit sway every time I switch both monitors to my Windows VM (gpu passthrough).
@ddevault
Copy link
Contributor

Most of these problems almost certainly originate from wlc.

@craigcabrey
Copy link

When I plug in an external monitor, my laptop display goes black and the external monitor shows a new workspace. Unplugging the display does not bring back my laptop's screen. I am forced to hard reset my machine. Is this a wlc issue?

@MrSorcus
Copy link

Confirm, i get black screen too...
https://gist.github.com/DebugReport/2448323415a554ac971ba60925e9d9bb

@main--
Copy link
Author

main-- commented Dec 1, 2016

So after some more extensive testing (aka everyday use), here's what I can reproduce reliably. Note that I have two displays, one 2K monitor that's connected via HDMI and one 4K monitor via DP.

  • Disconnecting the second (DP) monitor works fine. Only when I reconnect it, the bar always becomes inverted and the new monitor's background is black.
  • Launching sway on the first (HDMI) monitor and only then connecting the other one works fine - no issue with the bars. However, many applications (emacs, mumble, etc) start rendering text (and only the text) in a bigger font size. Interestingly, this would be exactly what I want on my 4K monitor but it appears to be distinct from sway's actual highdpi support (I disabled that because I don't like the blurriness you get from scaling).
  • Disconnecting the first monitor does not work. Sway never notices that it's gone and just keeps pretending it's still there until I reattach it. At least for my usecase (gpu passthrough) this is actually better as I don't usually want my window manager to move workspaces away from a display just because I temporarily switched it to Windows. Given that it still shows up as connected in /sys/class/drm I guess this is just the kernel being weird though.

The problem @craigcabrey and @DebugReport mention where the first monitor blacks out when I reconnect the second one did happen a few times on my system but I'm not able to reproduce it reliably. The same goes for the disappearing bar.

@SirCmpwn Which of these do you think are wlc issues? If it helps, here are the logs.

@main--
Copy link
Author

main-- commented Dec 13, 2016

The bar reliably disappears (crashes?) whenever I try to scroll through it (with mousewheel) once it's inverted.

@ddevault
Copy link
Contributor

Open an issue in wlc's tracker please.

@arouene
Copy link

arouene commented Jan 14, 2019

I had the same issues, with my workspaces configured like this :

  workspace 1 output eDP-1
  workspace 2 output HDMI-A-2
  workspace 3 output eDP-1

eDP-1 and HDMI-A-2 is what I get from swaymsg -t get_outputs

  Output eDP-1 'Unknown 0x272D 0x00000000'
  ...
  Output HDMI-A-2 'Samsung Electric Company U28E590 HTPJ202323' (focused)
  ...

But no more problems with :

  workspace 1 output XWAYLAND0
  workspace 2 output XWAYLAND1
  workspace 3 output XWAYLAND0

XWAYLAND0 and XWAYLAND1 is what I get from xrandr

Screen 0: minimum 320 x 200, current 5760 x 2160, maximum 8192 x 8192
XWAYLAND0 connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 293mm x 165mm
   1920x1080     59.96*+
XWAYLAND1 connected 3840x2160+0+0 (normal left inverted right x axis y axis) 608mm x 345mm
   3840x2160     29.98*+

@emersion
Copy link
Member

XWAYLAND0 and XWAYLAND1 is what I get from xrandr

Don't do that, it doesn't work.

@arouene
Copy link

arouene commented Jan 14, 2019

@emersion yes thx, I saw that after posting... I will just "unpin" my workspaces.

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

No branches or pull requests

6 participants