Bug: Windows become uncontrollable after restart
mfdorst opened this issue · 3 comments
I implemented a simple way to restart like so:
main.rs
...
custom_actions: vec![
// ...
("q".to_string(), Box::new(|| std::process::exit(1))),
("r".to_string(), Box::new(|| std::process::exit(0))),
]
umberwm-start
(the script I use to start umberwm)
while true; do
# Restart if exit code is zero, otherwise quit
umberwm || break
done
and what I found is that when restarting, the existing windows just sit where they were to begin with. They are interactable, and if it's a terminal you can still close it by typing exit
, but you cannot close it or move it with keybindings, and when making new windows they just cover the old windows like they aren't even there.
I assume there is some list of window handles somewhere, and making a new window will add the handle to the list, but umberwm probably does not check for existing windows on startup, so that's probably what's causing the problem. I'll look into this.
I've been looking through the dwm source to see how they do it, and I think it's the scan()
function that's responsible for this.
https://github.com/mfdorst/dwm/blob/master/dwm.c#L1385
having this would be awesome.
Another thing we could do is serialize the state and load it at startup (then delete the serialized state to make sure that next startups won't try and load it).