shell/workspace: Clear output stack when moved user moves workspace
If the user explicitly moves a workspace to an output, assume that is where the user wants it, so it shouldn't be moved back to a different output in the future. For persistent workspaces, the explicitly set workspace is the one that will be stored, instead of trying to track an unbounded list of outputs persistently.
This commit is contained in:
parent
e74eafce2c
commit
75aab6e282
2 changed files with 16 additions and 8 deletions
|
|
@ -85,7 +85,7 @@ pub struct Workspace {
|
|||
pub handle: WorkspaceHandle,
|
||||
pub focus_stack: FocusStacks,
|
||||
pub screencopy: ScreencopySessions,
|
||||
pub output_stack: VecDeque<String>,
|
||||
output_stack: VecDeque<String>,
|
||||
pub(super) backdrop_id: Id,
|
||||
pub dirty: AtomicBool,
|
||||
}
|
||||
|
|
@ -361,7 +361,11 @@ impl Workspace {
|
|||
&self.output
|
||||
}
|
||||
|
||||
pub fn set_output(&mut self, output: &Output) {
|
||||
// Set output the workspace is on
|
||||
//
|
||||
// If `explicit` is `true`, the user has explicitly moved the workspace
|
||||
// to this output, so previous outputs it was on can be forgotten.
|
||||
pub fn set_output(&mut self, output: &Output, explicit: bool) {
|
||||
self.tiling_layer.set_output(output);
|
||||
self.floating_layer.set_output(output);
|
||||
for mapped in self.mapped() {
|
||||
|
|
@ -376,6 +380,9 @@ impl Workspace {
|
|||
toplevel_enter_output(&surface, output);
|
||||
}
|
||||
}
|
||||
if explicit {
|
||||
self.output_stack.clear();
|
||||
}
|
||||
let output_name = output.name();
|
||||
if let Some(pos) = self
|
||||
.output_stack
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue