diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-27 09:46:18 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-27 09:46:18 +0400 |
| commit | e276c906bf4bea27dc8173815ff373d04c20caaf (patch) | |
| tree | 6843e6ab8244f296b89d54d53b2ebfd6e1a16592 /src/ipc | |
| parent | 571768af433b0fdc653f44b7dee0ad2dda6fe344 (diff) | |
| download | niri-e276c906bf4bea27dc8173815ff373d04c20caaf.tar.gz niri-e276c906bf4bea27dc8173815ff373d04c20caaf.tar.bz2 niri-e276c906bf4bea27dc8173815ff373d04c20caaf.zip | |
Expose more info in DisplayConfig impl
Needed for the new xdp-gnome.
Diffstat (limited to 'src/ipc')
| -rw-r--r-- | src/ipc/server.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ipc/server.rs b/src/ipc/server.rs index 102fcb94..dc314734 100644 --- a/src/ipc/server.rs +++ b/src/ipc/server.rs @@ -1,4 +1,3 @@ -use std::collections::HashMap; use std::os::unix::net::{UnixListener, UnixStream}; use std::path::PathBuf; use std::sync::{Arc, Mutex}; @@ -14,6 +13,7 @@ use smithay::reexports::calloop::generic::Generic; use smithay::reexports::calloop::{Interest, LoopHandle, Mode, PostAction}; use smithay::reexports::rustix::fs::unlink; +use crate::backend::IpcOutputMap; use crate::niri::State; pub struct IpcServer { @@ -22,7 +22,7 @@ pub struct IpcServer { struct ClientCtx { event_loop: LoopHandle<'static, State>, - ipc_outputs: Arc<Mutex<HashMap<String, niri_ipc::Output>>>, + ipc_outputs: Arc<Mutex<IpcOutputMap>>, } impl IpcServer { @@ -125,7 +125,11 @@ fn process(ctx: &ClientCtx, buf: &str) -> anyhow::Result<Response> { let response = match request { Request::Outputs => { - let ipc_outputs = ctx.ipc_outputs.lock().unwrap().clone(); + let ipc_outputs = ctx.ipc_outputs.lock().unwrap(); + let ipc_outputs = ipc_outputs + .iter() + .map(|(name, (ipc, _))| (name.clone(), ipc.clone())) + .collect(); Response::Outputs(ipc_outputs) } Request::Action(action) => { |
