diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-05 09:40:54 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-05 10:03:51 +0300 |
| commit | cd90dfc7be11147936c2b637ae822ff0adf5a7b7 (patch) | |
| tree | fc156451b6c25d454194fbe885eacf455a649c32 /src/backend/tty.rs | |
| parent | a778ab38977b99edb79275cf3ad2ddffa24044f7 (diff) | |
| download | niri-cd90dfc7be11147936c2b637ae822ff0adf5a7b7.tar.gz niri-cd90dfc7be11147936c2b637ae822ff0adf5a7b7.tar.bz2 niri-cd90dfc7be11147936c2b637ae822ff0adf5a7b7.zip | |
Disable laptop panel when the lid is closed
Diffstat (limited to 'src/backend/tty.rs')
| -rw-r--r-- | src/backend/tty.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs index 58face27..5da9a604 100644 --- a/src/backend/tty.rs +++ b/src/backend/tty.rs @@ -783,6 +783,10 @@ impl Tty { debug!("output is disabled in the config"); return Ok(()); } + if !niri.should_enable_laptop_panel(&output_name.connector) { + debug!("output is disabled because it is a laptop panel and the lid is closed"); + return Ok(()); + } for m in connector.modes() { trace!("{m:?}"); @@ -1723,7 +1727,7 @@ impl Tty { .find(&surface.name) .cloned() .unwrap_or_default(); - if config.off { + if config.off || !niri.should_enable_laptop_panel(&surface.name.connector) { to_disconnect.push((node, crtc)); continue; } @@ -1833,7 +1837,7 @@ impl Tty { .cloned() .unwrap_or_default(); - if !config.off { + if !config.off && niri.should_enable_laptop_panel(&output_name.connector) { to_connect.push((node, connector.clone(), crtc)); } } |
