regolith-linux / regolith-desktop

Meta package for the Regolith Desktop Environment
1.48k stars 31 forks source link

wayland session: Laptop display remains active after laptop lid is shut or never opened #845

Open kgilmer opened 1 year ago

kgilmer commented 1 year ago

image

This machine is a laptop with 2 physical monitors attached. The lid is closed. The last one in this screenshot is invalid.

kgilmer commented 1 year ago

Appears in both regolith-control-center and gnome-control-center.

kgilmer commented 1 year ago

UI actions from gnome-control-center to disable invalid monitor don't appear to make any lasting changes.

kgilmer commented 1 year ago

IMO this presents a blocker-level severity as the invalid monitor consumes a workspace.

kgilmer commented 1 year ago

Steps to reproduce:

  1. install regolith 3 from unstable on Ubuntu Lunar with sway session.
  2. Login to sway session
  3. open a control center, go to displays tab

expected behavior: only active monitors are present actual behavior: additional monitor is present, cannot be disabled via settings UI

kgilmer commented 1 year ago

I realized the 3rd display is the laptop's built-in display. Normally I keep it closed and use two external displays when working. Opening the lid shows the monitor active and running. I'm unable to cause any changes when opening closing the lid.

SoumyaRanjanPatnaik commented 1 year ago

Currently, Sway has no way to identify built-in monitors. One way to do this is to use XResources to specify the built-in monitor. Alternatively, we could add a panel to regolith-control-center, or at least a script that allows the user to select the laptop’s built-in display. We would need to add a config partial to the regolith-wm-config package that handles the lid close action (which should be disabled by default for the built-in display).

SoumyaRanjanPatnaik commented 1 year ago

I'll create and push the required config partial to regolith-wm-config. It would check the variable regolith.sway.laptop_lid_display in XResources to identify the built-in display. Then, either the user can manually set the variable or we can discuss an easier way for the user to set the laptop's inbuilt display.

kgilmer commented 1 year ago

Currently, Sway has no way to identify built-in monitors.

Hmm ok.

One way to do this is to use XResources to specify the built-in monitor.

Better than nothing but requiring users to do this seems undesirable IMO.

add a config partial to the regolith-wm-config package that handles the lid close action

Nice, yes this is the root issue I believe.

Surely there is something in the desktop stack that knows that a given display is "built-in"...otherwise how would X11 be able to do this without user specification of the specific built-in monitor?

SoumyaRanjanPatnaik commented 1 year ago

Take a look at this: https://unix.stackexchange.com/questions/419755/how-to-detect-built-in-laptop-display. I'm not sure if this is true for all laptops, but I can probably add a line to the regolith-ftue / regolith-session-wayland scripts that detects the built in monitor based on the connector.

JohnCHarrington commented 1 year ago

I have a possibly related issue that is essentially the opposite: External monitor remains detected and consumes a workplace even after being unplugged.

I also can't make any changes in the Screen Display settings - after I hit apply it just resets itself.