gardesk/tarmac / 4f254df

Browse files

wire monitor actions, hotplug callback, and default keybinds

Authored by espadonne
SHA
4f254dfd2019fe309219711f9e05320a21a6faf2
Parents
f9975ae
Tree
ef9852d

1 changed file

StatusFile+-
M tarmac/src/main.rs 10 0
tarmac/src/main.rsmodified
@@ -150,6 +150,16 @@ fn main() {
150150
     let ipc_rx = tarmac::ipc::server::start_server();
151151
     IPC_RX.with(|r| *r.borrow_mut() = Some(ipc_rx));
152152
 
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
+
153163
     install_polling_timer();
154164
     run_app();
155165
 }