shell: Allow active workspace to be None

This commit is contained in:
Victoria Brekenfeld 2025-01-06 19:23:06 +01:00 committed by Victoria Brekenfeld
parent 23570ea9f4
commit db13eea91c
13 changed files with 230 additions and 167 deletions

View file

@ -42,7 +42,7 @@ impl XdgActivationHandler for State {
if let Some(seat) = data.serial.and_then(|(_, seat)| Seat::from_resource(&seat)) {
let output = seat.active_output();
let mut shell = self.common.shell.write().unwrap();
let workspace = shell.active_space_mut(&output);
let workspace = shell.active_space_mut(&output).unwrap();
workspace.pending_tokens.insert(token.clone());
let handle = workspace.handle;
data.user_data
@ -86,7 +86,7 @@ impl XdgActivationHandler for State {
if valid {
let output = seat.active_output();
let mut shell = self.common.shell.write().unwrap();
let workspace = shell.active_space_mut(&output);
let workspace = shell.active_space_mut(&output).unwrap();
workspace.pending_tokens.insert(token.clone());
let handle = workspace.handle;
data.user_data
@ -125,7 +125,7 @@ impl XdgActivationHandler for State {
}
let element_workspace = shell.space_for(&element).map(|w| w.handle.clone());
let current_workspace = shell.active_space_mut(&current_output);
let current_workspace = shell.active_space_mut(&current_output).unwrap();
let in_current_workspace = element_workspace
.as_ref()