srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/platform/src
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2024-08-21 20:03:00 +0200
committersrdusr <[email protected]>2024-08-21 20:03:00 +0200
commit8d94ca5d77d6e2a189d299b8b88a461ba2e621c6 (patch)
tree0f9d22415dc741b111882072ace9a533f882d29a /crates/platform/src
parentbb59ecfa2f1329d978fcfa8b7455db649f019f85 (diff)
downloadsrdwm-8d94ca5d77d6e2a189d299b8b88a461ba2e621c6.tar.gz
srdwm-8d94ca5d77d6e2a189d299b8b88a461ba2e621c6.zip
Add toggle_maximize/toggle_fullscreen IPC dispatch actions
Same shape as the existing toggle_visibility/focus/close dispatch actions - lets an external script (or a live diagnostic check) drive either without a keybinding already existing to trigger it. Immediately useful for verifying the maximize/fullscreen contract on a live session without synthesizing any input at all.
Diffstat (limited to 'crates/platform/src')
-rw-r--r--crates/platform/src/ipc.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/platform/src/ipc.rs b/crates/platform/src/ipc.rs
index 098593b..2b75b8e 100644
--- a/crates/platform/src/ipc.rs
+++ b/crates/platform/src/ipc.rs
@@ -394,6 +394,20 @@ fn handle_request(line: &[u8], wm: &std::rc::Rc<std::cell::RefCell<WindowManager
wm.borrow_mut().close_window(id);
(ok(), true)
}
+ // `srd.window.maximize()`/`.fullscreen()`'s exact IPC-side
+ // equivalents - lets an external script (or a live diagnostic
+ // check, same as `toggle_visibility`/`focus`/`close` already allow)
+ // drive either without needing a keybinding to already exist.
+ "toggle_maximize" => {
+ let Some(id) = id else { return (err("missing id"), false) };
+ wm.borrow_mut().toggle_maximize(id);
+ (ok(), true)
+ }
+ "toggle_fullscreen" => {
+ let Some(id) = id else { return (err("missing id"), false) };
+ wm.borrow_mut().toggle_fullscreen(id);
+ (ok(), true)
+ }
_ => (err("unknown command"), false),
}
}