fix(wm): handle regression switching from empty ws

This commit is contained in:
LGUG2Z
2023-02-14 18:54:13 -08:00
parent 7bd2ff4087
commit a23019eccf

View File

@@ -407,13 +407,6 @@ impl WindowManager {
self.clear_workspace_layout_rules(monitor_idx, workspace_idx)?;
}
SocketMessage::CycleFocusWorkspace(direction) => {
let reenable_border = if BORDER_ENABLED.load(Ordering::SeqCst) {
self.hide_border()?;
true
} else {
false
};
// This is to ensure that even on an empty workspace on a secondary monitor, the
// secondary monitor where the cursor is focused will be used as the target for
// the workspace switch op
@@ -436,18 +429,11 @@ impl WindowManager {
self.focus_workspace(workspace_idx)?;
if reenable_border {
if BORDER_ENABLED.load(Ordering::SeqCst) {
self.show_border()?;
}
};
}
SocketMessage::FocusWorkspaceNumber(workspace_idx) => {
let reenable_border = if BORDER_ENABLED.load(Ordering::SeqCst) {
self.hide_border()?;
true
} else {
false
};
// This is to ensure that even on an empty workspace on a secondary monitor, the
// secondary monitor where the cursor is focused will be used as the target for
// the workspace switch op
@@ -457,22 +443,15 @@ impl WindowManager {
self.focus_workspace(workspace_idx)?;
if reenable_border {
if BORDER_ENABLED.load(Ordering::SeqCst) {
self.show_border()?;
}
};
}
SocketMessage::FocusMonitorWorkspaceNumber(monitor_idx, workspace_idx) => {
self.focus_monitor(monitor_idx)?;
self.focus_workspace(workspace_idx)?;
}
SocketMessage::FocusNamedWorkspace(ref name) => {
let reenable_border = if BORDER_ENABLED.load(Ordering::SeqCst) {
self.hide_border()?;
true
} else {
false
};
if let Some((monitor_idx, workspace_idx)) =
self.monitor_workspace_index_by_name(name)
{
@@ -480,9 +459,9 @@ impl WindowManager {
self.focus_workspace(workspace_idx)?;
}
if reenable_border {
if BORDER_ENABLED.load(Ordering::SeqCst) {
self.show_border()?;
}
};
}
SocketMessage::Stop => {
tracing::info!(