mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-06 02:43:26 +02:00
fix(wm): make close + min op on foreground hwnd
This commit changes the handlers for the Close and Minimize SocketMessages to operate on the output of WindowsApi::foreground_window, without checking the window manager state as it was doing previously. This will allow the commands to operate on any kind of managed or unmanaged window, and the appropriate WinEvent will be emitted by the closed window for the window manager state to be updated when the WinEvent goes through process_event. fix #839
This commit is contained in:
@@ -215,8 +215,18 @@ impl WindowManager {
|
||||
WindowsApi::center_cursor_in_rect(&focused_window_rect)?;
|
||||
WindowsApi::left_click();
|
||||
}
|
||||
SocketMessage::Close => self.focused_window()?.close()?,
|
||||
SocketMessage::Minimize => self.focused_window()?.minimize(),
|
||||
SocketMessage::Close => {
|
||||
Window {
|
||||
hwnd: WindowsApi::foreground_window()?,
|
||||
}
|
||||
.close()?;
|
||||
}
|
||||
SocketMessage::Minimize => {
|
||||
Window {
|
||||
hwnd: WindowsApi::foreground_window()?,
|
||||
}
|
||||
.minimize();
|
||||
}
|
||||
SocketMessage::ToggleFloat => self.toggle_float()?,
|
||||
SocketMessage::ToggleMonocle => self.toggle_monocle()?,
|
||||
SocketMessage::ToggleMaximize => self.toggle_maximize()?,
|
||||
|
||||
Reference in New Issue
Block a user