shell: One workspace per output

This commit is contained in:
Victoria Brekenfeld 2023-10-25 19:40:26 +02:00
parent 42aaafe586
commit 72df9d07e6
21 changed files with 1561 additions and 1987 deletions

View file

@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
use crate::{
shell::WorkspaceMode,
state::ClientState,
utils::prelude::*,
wayland::protocols::workspace::{
@ -30,19 +29,12 @@ impl WorkspaceHandler for State {
for request in requests.into_iter() {
match request {
Request::Activate(handle) => {
let maybe = match &self.common.shell.workspaces {
WorkspaceMode::Global(set) => set
.workspaces
let maybe = self.common.shell.workspaces.iter().find_map(|(o, set)| {
set.workspaces
.iter()
.position(|w| w.handle == handle)
.map(|i| (self.common.last_active_seat().active_output(), i)),
WorkspaceMode::OutputBound(sets, _) => sets.iter().find_map(|(o, set)| {
set.workspaces
.iter()
.position(|w| w.handle == handle)
.map(|i| (o.clone(), i))
}),
};
.map(|i| (o.clone(), i))
});
if let Some((output, idx)) = maybe {
let _ = self.common.shell.activate(&output, idx); // TODO: move cursor?