feat(cli): add toggle-window-based-work-area-offset cmd

This commit adds a command to toggle the application of a monitor's
window-based work area offset for the focused workspace.

resolve #1285
This commit is contained in:
LGUG2Z
2025-02-20 20:38:10 -08:00
parent c095f8ae9f
commit 30c22f51c9
5 changed files with 27 additions and 0 deletions
+1
View File
@@ -185,6 +185,7 @@ pub enum SocketMessage {
StackbarFontFamily(Option<String>),
WorkAreaOffset(Rect),
MonitorWorkAreaOffset(usize, Rect),
ToggleWindowBasedWorkAreaOffset,
ResizeDelta(i32),
InitialWorkspaceRule(ApplicationIdentifier, String, usize, usize),
InitialNamedWorkspaceRule(ApplicationIdentifier, String, String),
+8
View File
@@ -1458,6 +1458,14 @@ impl WindowManager {
self.retile_all(false)?;
}
}
SocketMessage::ToggleWindowBasedWorkAreaOffset => {
let workspace = self.focused_workspace_mut()?;
workspace.set_apply_window_based_work_area_offset(
!workspace.apply_window_based_work_area_offset(),
);
self.retile_all(false)?;
}
SocketMessage::QuickSave => {
let workspace = self.focused_workspace()?;
let resize = workspace.resize_dimensions();