Checks if window is open to not flicker the window (#263)
This commit is contained in:
parent
6867010203
commit
87d4bc4c76
1 changed files with 8 additions and 2 deletions
|
@ -139,8 +139,14 @@ impl App {
|
||||||
sender.respond_with_error_list(errors)?;
|
sender.respond_with_error_list(errors)?;
|
||||||
}
|
}
|
||||||
DaemonCommand::OpenWindow { window_name, pos, size, anchor, screen: monitor, should_toggle, sender } => {
|
DaemonCommand::OpenWindow { window_name, pos, size, anchor, screen: monitor, should_toggle, sender } => {
|
||||||
let result = if should_toggle && self.open_windows.contains_key(&window_name) {
|
let is_open = self.open_windows.contains_key(&window_name);
|
||||||
|
let result = if is_open {
|
||||||
|
if should_toggle {
|
||||||
self.close_window(&window_name)
|
self.close_window(&window_name)
|
||||||
|
} else {
|
||||||
|
// user should use `eww reload` to reload windows (https://github.com/elkowar/eww/issues/260)
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
self.open_window(&window_name, pos, size, monitor, anchor)
|
self.open_window(&window_name, pos, size, monitor, anchor)
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue