wire monitor actions, hotplug callback, and default keybinds
- SHA
4f254dfd2019fe309219711f9e05320a21a6faf2- Parents
-
f9975ae - Tree
ef9852d
4f254df
4f254dfd2019fe309219711f9e05320a21a6faf2f9975ae
ef9852d| Status | File | + | - |
|---|---|---|---|
| M |
tarmac/src/main.rs
|
10 | 0 |
tarmac/src/main.rsmodified@@ -150,6 +150,16 @@ fn main() { | ||
| 150 | 150 | let ipc_rx = tarmac::ipc::server::start_server(); |
| 151 | 151 | IPC_RX.with(|r| *r.borrow_mut() = Some(ipc_rx)); |
| 152 | 152 | |
| 153 | + // Register display hotplug callback | |
| 154 | + tarmac::platform::display::register_display_change_callback(Box::new(|| { | |
| 155 | + tracing::info!("display configuration changed, refreshing monitors"); | |
| 156 | + WM_STATE.with(|s| { | |
| 157 | + if let Some(state) = s.borrow_mut().as_mut() { | |
| 158 | + state.refresh_monitors(); | |
| 159 | + } | |
| 160 | + }); | |
| 161 | + })); | |
| 162 | + | |
| 153 | 163 | install_polling_timer(); |
| 154 | 164 | run_app(); |
| 155 | 165 | } |