input: Displays take precendence over workspaces
This commit is contained in:
parent
59581f717f
commit
18a8692517
1 changed files with 71 additions and 96 deletions
167
src/input/mod.rs
167
src/input/mod.rs
|
|
@ -1404,6 +1404,29 @@ impl State {
|
||||||
Ok(None) => {
|
Ok(None) => {
|
||||||
seat.set_active_output(&next_output);
|
seat.set_active_output(&next_output);
|
||||||
}
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
match (direction, self.common.config.workspace.workspace_layout) {
|
||||||
|
(Direction::Left, WorkspaceLayout::Horizontal)
|
||||||
|
| (Direction::Up, WorkspaceLayout::Vertical) => self.handle_action(
|
||||||
|
Action::PreviousWorkspace,
|
||||||
|
seat,
|
||||||
|
serial,
|
||||||
|
time,
|
||||||
|
pattern,
|
||||||
|
Some(direction),
|
||||||
|
),
|
||||||
|
(Direction::Right, WorkspaceLayout::Horizontal)
|
||||||
|
| (Direction::Down, WorkspaceLayout::Vertical) => self.handle_action(
|
||||||
|
Action::NextWorkspace,
|
||||||
|
seat,
|
||||||
|
serial,
|
||||||
|
time,
|
||||||
|
pattern,
|
||||||
|
Some(direction),
|
||||||
|
),
|
||||||
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1516,6 +1539,29 @@ impl State {
|
||||||
ptr.frame(self);
|
ptr.frame(self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
match (direction, self.common.config.workspace.workspace_layout) {
|
||||||
|
(Direction::Left, WorkspaceLayout::Horizontal)
|
||||||
|
| (Direction::Up, WorkspaceLayout::Vertical) => self.handle_action(
|
||||||
|
Action::MoveToPreviousWorkspace,
|
||||||
|
seat,
|
||||||
|
serial,
|
||||||
|
time,
|
||||||
|
pattern,
|
||||||
|
Some(direction),
|
||||||
|
),
|
||||||
|
(Direction::Right, WorkspaceLayout::Horizontal)
|
||||||
|
| (Direction::Down, WorkspaceLayout::Vertical) => self.handle_action(
|
||||||
|
Action::MoveToNextWorkspace,
|
||||||
|
seat,
|
||||||
|
serial,
|
||||||
|
time,
|
||||||
|
pattern,
|
||||||
|
Some(direction),
|
||||||
|
),
|
||||||
|
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x @ Action::MoveToNextOutput | x @ Action::SendToNextOutput => {
|
x @ Action::MoveToNextOutput | x @ Action::SendToNextOutput => {
|
||||||
|
|
@ -1602,54 +1648,23 @@ impl State {
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
FocusResult::None => {
|
FocusResult::None => {
|
||||||
match (focus, self.common.config.workspace.workspace_layout) {
|
let dir = match focus {
|
||||||
(FocusDirection::Left, WorkspaceLayout::Horizontal)
|
FocusDirection::Down => Some(Direction::Down),
|
||||||
| (FocusDirection::Up, WorkspaceLayout::Vertical) => self
|
FocusDirection::Up => Some(Direction::Up),
|
||||||
.handle_action(
|
FocusDirection::Left => Some(Direction::Left),
|
||||||
Action::PreviousWorkspace,
|
FocusDirection::Right => Some(Direction::Right),
|
||||||
seat,
|
_ => None,
|
||||||
serial,
|
};
|
||||||
time,
|
|
||||||
pattern,
|
if let Some(direction) = dir {
|
||||||
direction,
|
self.handle_action(
|
||||||
),
|
Action::SwitchOutput(direction),
|
||||||
(FocusDirection::Right, WorkspaceLayout::Horizontal)
|
seat,
|
||||||
| (FocusDirection::Down, WorkspaceLayout::Vertical) => self
|
serial,
|
||||||
.handle_action(
|
time,
|
||||||
Action::NextWorkspace,
|
pattern,
|
||||||
seat,
|
Some(direction),
|
||||||
serial,
|
)
|
||||||
time,
|
|
||||||
pattern,
|
|
||||||
direction,
|
|
||||||
),
|
|
||||||
(FocusDirection::Left, WorkspaceLayout::Vertical)
|
|
||||||
| (FocusDirection::Up, WorkspaceLayout::Horizontal) => {
|
|
||||||
if let Some(inferred) = pattern.inferred_direction() {
|
|
||||||
self.handle_action(
|
|
||||||
Action::SwitchOutput(inferred),
|
|
||||||
seat,
|
|
||||||
serial,
|
|
||||||
time,
|
|
||||||
pattern,
|
|
||||||
direction,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(FocusDirection::Right, WorkspaceLayout::Vertical)
|
|
||||||
| (FocusDirection::Down, WorkspaceLayout::Horizontal) => {
|
|
||||||
if let Some(inferred) = pattern.inferred_direction() {
|
|
||||||
self.handle_action(
|
|
||||||
Action::SwitchOutput(inferred),
|
|
||||||
seat,
|
|
||||||
serial,
|
|
||||||
time,
|
|
||||||
pattern,
|
|
||||||
direction,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FocusResult::Handled => {}
|
FocusResult::Handled => {}
|
||||||
|
|
@ -1663,54 +1678,14 @@ impl State {
|
||||||
let workspace = self.common.shell.active_space_mut(¤t_output);
|
let workspace = self.common.shell.active_space_mut(¤t_output);
|
||||||
|
|
||||||
match workspace.move_current_element(direction, seat) {
|
match workspace.move_current_element(direction, seat) {
|
||||||
MoveResult::MoveFurther(_move_further) => {
|
MoveResult::MoveFurther(_move_further) => self.handle_action(
|
||||||
match (direction, self.common.config.workspace.workspace_layout) {
|
Action::MoveToOutput(direction),
|
||||||
(Direction::Left, WorkspaceLayout::Horizontal)
|
seat,
|
||||||
| (Direction::Up, WorkspaceLayout::Vertical) => self.handle_action(
|
serial,
|
||||||
Action::MoveToPreviousWorkspace,
|
time,
|
||||||
seat,
|
pattern,
|
||||||
serial,
|
Some(direction),
|
||||||
time,
|
),
|
||||||
pattern,
|
|
||||||
Some(direction),
|
|
||||||
),
|
|
||||||
(Direction::Right, WorkspaceLayout::Horizontal)
|
|
||||||
| (Direction::Down, WorkspaceLayout::Vertical) => self.handle_action(
|
|
||||||
Action::MoveToNextWorkspace,
|
|
||||||
seat,
|
|
||||||
serial,
|
|
||||||
time,
|
|
||||||
pattern,
|
|
||||||
Some(direction),
|
|
||||||
),
|
|
||||||
(Direction::Left, WorkspaceLayout::Vertical)
|
|
||||||
| (Direction::Up, WorkspaceLayout::Horizontal) => {
|
|
||||||
if let Some(inferred) = pattern.inferred_direction() {
|
|
||||||
self.handle_action(
|
|
||||||
Action::MoveToOutput(inferred),
|
|
||||||
seat,
|
|
||||||
serial,
|
|
||||||
time,
|
|
||||||
pattern,
|
|
||||||
Some(direction),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(Direction::Right, WorkspaceLayout::Vertical)
|
|
||||||
| (Direction::Down, WorkspaceLayout::Horizontal) => {
|
|
||||||
if let Some(inferred) = pattern.inferred_direction() {
|
|
||||||
self.handle_action(
|
|
||||||
Action::MoveToOutput(inferred),
|
|
||||||
seat,
|
|
||||||
serial,
|
|
||||||
time,
|
|
||||||
pattern,
|
|
||||||
Some(direction),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MoveResult::ShiftFocus(shift) => {
|
MoveResult::ShiftFocus(shift) => {
|
||||||
Common::set_focus(self, Some(&shift), seat, None);
|
Common::set_focus(self, Some(&shift), seat, None);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue