feat(wm): disable windows ffm on stop and ctrl-c

This commit disables the native Windows ffm implementation as part of
the stop command and the ctrl-c handler.

resolve #69
This commit is contained in:
LGUG2Z
2021-11-01 13:59:21 -07:00
parent 4e6e2b3aa8
commit 127254b7ac
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -328,6 +328,11 @@ fn main() -> Result<()> {
tracing::error!("received ctrl-c, restoring all hidden windows and terminating process"); tracing::error!("received ctrl-c, restoring all hidden windows and terminating process");
wm.lock().restore_all_windows(); wm.lock().restore_all_windows();
if WindowsApi::focus_follows_mouse()? {
WindowsApi::disable_focus_follows_mouse()?;
}
std::process::exit(130); std::process::exit(130);
} }
+5 -1
View File
@@ -203,7 +203,6 @@ impl WindowManager {
})?; })?;
self.focus_monitor(monitor_idx)?; self.focus_monitor(monitor_idx)?;
self.focus_workspace(workspace_idx)?; self.focus_workspace(workspace_idx)?;
} }
SocketMessage::Stop => { SocketMessage::Stop => {
@@ -211,6 +210,11 @@ impl WindowManager {
"received stop command, restoring all hidden windows and terminating process" "received stop command, restoring all hidden windows and terminating process"
); );
self.restore_all_windows(); self.restore_all_windows();
if WindowsApi::focus_follows_mouse()? {
WindowsApi::disable_focus_follows_mouse()?;
}
std::process::exit(0) std::process::exit(0)
} }
SocketMessage::EnsureWorkspaces(monitor_idx, workspace_count) => { SocketMessage::EnsureWorkspaces(monitor_idx, workspace_count) => {