shell: Restore fullscreen to single-element stack

If a surface was previously a single-element stack, restore it normally
using the floating/tiling restore data, but map as a single element
stack instead of a plain window.
This commit is contained in:
Ian Douglas Scott 2026-06-23 15:54:37 -07:00 committed by Ian Douglas Scott
parent 98e1dd7f6b
commit 373a44d431
2 changed files with 38 additions and 7 deletions

View file

@ -254,14 +254,17 @@ pub enum FullscreenRestoreState {
Tiling {
workspace: WorkspaceHandle,
state: TilingRestoreData,
was_stack: bool,
},
Floating {
workspace: WorkspaceHandle,
state: FloatingRestoreData,
was_stack: bool,
},
Sticky {
output: WeakOutput,
state: FloatingRestoreData,
was_stack: bool,
},
Stack {
state: StackRestoreData,
@ -277,6 +280,17 @@ impl FullscreenRestoreState {
FullscreenRestoreState::Stack { .. } => false,
}
}
// Surface was previously a single-window stack
pub fn was_stack(&self) -> bool {
match self {
FullscreenRestoreState::Floating { was_stack, .. }
| FullscreenRestoreState::Sticky { was_stack, .. } => *was_stack,
FullscreenRestoreState::Tiling { was_stack, .. } => *was_stack,
// Stack wasn't removed; surface was removed from the stack
FullscreenRestoreState::Stack { .. } => false,
}
}
}
#[derive(Debug, Clone)]