Skip to content

Commit

Permalink
Merge pull request #184 from pop-os/focus-across-monitors_jammy
Browse files Browse the repository at this point in the history
Fix NextOutput and PreviousOutput when Shell::activate returns None
  • Loading branch information
Drakulix authored Sep 29, 2023
2 parents 2bd700c + aac2c31 commit 0b057f1
Showing 1 changed file with 36 additions and 24 deletions.
60 changes: 36 additions & 24 deletions src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1187,19 +1187,25 @@ impl State {
.cloned()
{
let idx = self.common.shell.workspaces.active_num(&next_output).1;
if let Ok(Some(new_pos)) = self.common.shell.activate(&next_output, idx) {
seat.set_active_output(&next_output);
if let Some(ptr) = seat.get_pointer() {
ptr.motion(
self,
None,
&MotionEvent {
location: new_pos.to_f64(),
serial,
time,
},
);
match self.common.shell.activate(&next_output, idx) {
Ok(Some(new_pos)) => {
seat.set_active_output(&next_output);
if let Some(ptr) = seat.get_pointer() {
ptr.motion(
self,
None,
&MotionEvent {
location: new_pos.to_f64(),
serial,
time,
},
);
}
}
Ok(None) => {
seat.set_active_output(&next_output);
}
_ => {}
}
}
}
Expand All @@ -1217,19 +1223,25 @@ impl State {
.cloned()
{
let idx = self.common.shell.workspaces.active_num(&prev_output).1;
if let Ok(Some(new_pos)) = self.common.shell.activate(&prev_output, idx) {
seat.set_active_output(&prev_output);
if let Some(ptr) = seat.get_pointer() {
ptr.motion(
self,
None,
&MotionEvent {
location: new_pos.to_f64(),
serial,
time,
},
);
match self.common.shell.activate(&prev_output, idx) {
Ok(Some(new_pos)) => {
seat.set_active_output(&prev_output);
if let Some(ptr) = seat.get_pointer() {
ptr.motion(
self,
None,
&MotionEvent {
location: new_pos.to_f64(),
serial,
time,
},
);
}
}
Ok(None) => {
seat.set_active_output(&prev_output);
}
_ => {}
}
}
}
Expand Down

0 comments on commit 0b057f1

Please sign in to comment.