diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-27 14:54:24 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-27 14:54:24 +0400 |
| commit | cf87a185a90aeacf7c15d27ddba23bc493d9c2dd (patch) | |
| tree | e8625c61105821b8d552db86f70839b1282151b4 /src/backend/tty.rs | |
| parent | e276c906bf4bea27dc8173815ff373d04c20caaf (diff) | |
| download | niri-cf87a185a90aeacf7c15d27ddba23bc493d9c2dd.tar.gz niri-cf87a185a90aeacf7c15d27ddba23bc493d9c2dd.tar.bz2 niri-cf87a185a90aeacf7c15d27ddba23bc493d9c2dd.zip | |
Add logical output info and preferred modes to IPC
Diffstat (limited to 'src/backend/tty.rs')
| -rw-r--r-- | src/backend/tty.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs index a90182a3..783db022 100644 --- a/src/backend/tty.rs +++ b/src/backend/tty.rs @@ -60,7 +60,7 @@ use crate::frame_clock::FrameClock; use crate::niri::{Niri, RedrawState, State}; use crate::render_helpers::renderer::AsGlesRenderer; use crate::render_helpers::{shaders, RenderTarget}; -use crate::utils::get_monotonic_time; +use crate::utils::{get_monotonic_time, logical_output}; const SUPPORTED_COLOR_FORMATS: &[Fourcc] = &[Fourcc::Argb8888, Fourcc::Abgr8888]; @@ -1370,6 +1370,7 @@ impl Tty { width: m.size().0, height: m.size().1, refresh_rate: Mode::from(*m).refresh as u32, + is_preferred: m.mode_type().contains(ModeTypeFlags::PREFERRED), } }) .collect(); @@ -1384,14 +1385,14 @@ impl Tty { } } - let output = niri + let logical = niri .global_space .outputs() .find(|output| { let tty_state: &TtyOutputState = output.user_data().get().unwrap(); tty_state.node == *node && tty_state.crtc == crtc }) - .cloned(); + .map(logical_output); let ipc_output = niri_ipc::Output { name: connector_name.clone(), @@ -1400,9 +1401,10 @@ impl Tty { physical_size, modes, current_mode, + logical, }; - ipc_outputs.insert(connector_name, (ipc_output, output)); + ipc_outputs.insert(connector_name, ipc_output); } } |
