mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-20 07:41:25 +02:00
feat(wm): allow stopping without restoring windows
This commit creates a new `SocketMessage` called `StopIgnoreRestore` which makes komorebi stop without calling `window.restore()` on all windows. This way every maximized window will stay maximized once you start komorebi again and it is able to use the previous `State`. If it fails to restore the previous state you might have to call `komorebic restore-windows` in case you had hidden windows, for example when when using the `window_hiding_behaviour` as `Hide`, or you can simply unminimize them if you were using `Cloak` or `Minimize`.
This commit is contained in:
@@ -801,6 +801,9 @@ struct Stop {
|
||||
/// Stop masir if it is running as a background process
|
||||
#[clap(long)]
|
||||
masir: bool,
|
||||
/// Do not restore windows after stopping komorebi
|
||||
#[clap(long, hide = true)]
|
||||
ignore_restore: bool,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
@@ -2300,7 +2303,11 @@ if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) {
|
||||
}
|
||||
}
|
||||
|
||||
send_message(&SocketMessage::Stop)?;
|
||||
if arg.ignore_restore {
|
||||
send_message(&SocketMessage::StopIgnoreRestore)?;
|
||||
} else {
|
||||
send_message(&SocketMessage::Stop)?;
|
||||
}
|
||||
let mut system = sysinfo::System::new_all();
|
||||
system.refresh_processes(ProcessesToUpdate::All);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user