alex-courtis / way-displays

way-displays: Auto Manage Your Wayland Displays
MIT License
240 stars 12 forks source link

Possible to configure monitor to never be disabled #120

Closed Cloudef closed 11 months ago

Cloudef commented 11 months ago

Currently compositors do not recover well from a state where there exists no monitors. I'd like the primary monitor to never get disabled to avoid these problems.

alex-courtis commented 11 months ago

When the laptop monitor is the last enabled one it is not disabled, for smoother sleeping.

We could do something similar, however I'm not sure how such a situation occurs: what's your use case?

  1. headless: no monitors ever plugged in
  2. all monitors are unplugged

I'll try 2 under sway and river, however I think the monitor will be unavailable to way-displays after unplug.

Cloudef commented 11 months ago

The scenario is 2. I switch the output of my primary monitor, if I use way-displays it will actually disable the monitor when I'm switched to another output and the compositor will kill all the active programs, without way-displays the clients will survive as the actual DRM context doesn't die. Reading the compositor source code, and unless I'm misunderstood at least with wlroots based compositors it's difficult to avoid this, as even the "headless" outputs need active DRM context to allocate and bind client resources to, and without outputs there are none. Not sure if this limitation could be fixed by using a render node (/dev/dri/renderD*) instead.

alex-courtis commented 11 months ago

Yes, that's difficult. I think river and sway have differing behaviour.

Please post the logs and describe what you're doing with the monitors with a time in the log.

The logs will be wherever the output of way-displays server is sent, see https://github.com/alex-courtis/way-displays#quick-start

Cloudef commented 11 months ago

Hmm, not sure why but it seems to work now :sweat_smile: