config value for killing clients on exit
This commit is contained in:
parent
053afa576e
commit
df3c2e33ce
|
@ -288,7 +288,7 @@ impl ClientState {
|
||||||
.filter(move |&(k, _)| self.is_client_visible(k))
|
.filter(move |&(k, _)| self.is_client_visible(k))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn iter_all_clients(&self) -> impl Iterator<Item = (&u64, &Client)> {
|
pub fn iter_all_clients(&self) -> impl Iterator<Item = (&u64, &Client)> {
|
||||||
self.floating_clients.iter().chain(self.clients.iter())
|
self.floating_clients.iter().chain(self.clients.iter())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ pub struct WMConfig {
|
||||||
num_virtualscreens: usize,
|
num_virtualscreens: usize,
|
||||||
mod_key: ModifierKey,
|
mod_key: ModifierKey,
|
||||||
gap: Option<i32>,
|
gap: Option<i32>,
|
||||||
|
kill_clients_on_exit: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct WindowManager<B = XLib>
|
pub struct WindowManager<B = XLib>
|
||||||
|
@ -410,6 +411,13 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
fn quit(&self) -> ! {
|
fn quit(&self) -> ! {
|
||||||
|
// TODO: should the window manager kill all clients on exit? probably
|
||||||
|
if self.config.kill_clients_on_exit {
|
||||||
|
self.clients
|
||||||
|
.iter_all_clients()
|
||||||
|
.for_each(|(&window, client)| self.backend.kill_window(window));
|
||||||
|
}
|
||||||
|
|
||||||
info!("Goodbye.");
|
info!("Goodbye.");
|
||||||
|
|
||||||
std::process::exit(0);
|
std::process::exit(0);
|
||||||
|
@ -857,6 +865,7 @@ impl Default for WMConfig {
|
||||||
num_virtualscreens: 10,
|
num_virtualscreens: 10,
|
||||||
mod_key: ModifierKey::Super,
|
mod_key: ModifierKey::Super,
|
||||||
gap: Some(2),
|
gap: Some(2),
|
||||||
|
kill_clients_on_exit: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue