diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-21 10:24:42 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-21 10:24:42 +0400 |
| commit | f5e9b40140e64cf907520aa0d8adf43f7141e1d2 (patch) | |
| tree | c75fb981a43060c4dcdedf96540646fa399b4cdc /src/backend | |
| parent | 5cacd03e859d35e71ff17f0897cdee8a44a8935c (diff) | |
| download | niri-f5e9b40140e64cf907520aa0d8adf43f7141e1d2.tar.gz niri-f5e9b40140e64cf907520aa0d8adf43f7141e1d2.tar.bz2 niri-f5e9b40140e64cf907520aa0d8adf43f7141e1d2.zip | |
tty: Check changes against pending connectors and mode
If we queued some DRM changes, they will be in pending. Also be more
resilient by removing unwrap.
Diffstat (limited to 'src/backend')
| -rw-r--r-- | src/backend/tty.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs index f86851cb..c093d722 100644 --- a/src/backend/tty.rs +++ b/src/backend/tty.rs @@ -1255,12 +1255,11 @@ impl Tty { } // Check if we need to change the mode. - let connector = surface - .compositor - .current_connectors() - .into_iter() - .next() - .unwrap(); + let Some(connector) = surface.compositor.pending_connectors().into_iter().next() + else { + error!("surface pending connectors is empty"); + continue; + }; let Some(connector) = device.drm_scanner.connectors().get(&connector) else { error!("missing enabled connector in drm_scanner"); continue; @@ -1271,7 +1270,7 @@ impl Tty { continue; }; - if surface.compositor.current_mode() == mode { + if surface.compositor.pending_mode() == mode { continue; } |
