mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-18 14:59:46 +02:00
feat(wm): reconcile monitor state
When monitors turn on and off, they do not retain their hmonitor id, therefore this commit introduces an initial attempt to reconcile invalid and valid hmonitors after monitor changes based on the windows that are assigned to them. If a monitor has at least one window, and has been assigned a new hmonitor id, komorebi will look up the current hmonitor of that window's hwnd and update Monitor.id in-place. When reconciling monitors, any monitor marked as invalid will be purged from the window manager state. This commit also applies some of the new clippy lints that come along with the latest nightly release of Rust. resolve #31
This commit is contained in:
@@ -527,11 +527,10 @@ fn main() -> Result<()> {
|
||||
None
|
||||
};
|
||||
|
||||
let script = if let Some(exec) = exec {
|
||||
format!("Start-Process '{}' -WindowStyle hidden", exec)
|
||||
} else {
|
||||
String::from("Start-Process komorebi -WindowStyle hidden")
|
||||
};
|
||||
let script = exec.map_or_else(
|
||||
|| String::from("Start-Process komorebi -WindowStyle hidden"),
|
||||
|exec| format!("Start-Process '{}' -WindowStyle hidden", exec),
|
||||
);
|
||||
|
||||
match powershell_script::run(&script, true) {
|
||||
Ok(output) => {
|
||||
|
||||
Reference in New Issue
Block a user