Merge pull request #184 from pop-os/focus-across-monitors_jammy
Fix NextOutput and PreviousOutput when Shell::activate returns None
This commit is contained in:
commit
0b057f153e
1 changed files with 36 additions and 24 deletions
|
|
@ -1187,19 +1187,25 @@ impl State {
|
||||||
.cloned()
|
.cloned()
|
||||||
{
|
{
|
||||||
let idx = self.common.shell.workspaces.active_num(&next_output).1;
|
let idx = self.common.shell.workspaces.active_num(&next_output).1;
|
||||||
if let Ok(Some(new_pos)) = self.common.shell.activate(&next_output, idx) {
|
match self.common.shell.activate(&next_output, idx) {
|
||||||
seat.set_active_output(&next_output);
|
Ok(Some(new_pos)) => {
|
||||||
if let Some(ptr) = seat.get_pointer() {
|
seat.set_active_output(&next_output);
|
||||||
ptr.motion(
|
if let Some(ptr) = seat.get_pointer() {
|
||||||
self,
|
ptr.motion(
|
||||||
None,
|
self,
|
||||||
&MotionEvent {
|
None,
|
||||||
location: new_pos.to_f64(),
|
&MotionEvent {
|
||||||
serial,
|
location: new_pos.to_f64(),
|
||||||
time,
|
serial,
|
||||||
},
|
time,
|
||||||
);
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Ok(None) => {
|
||||||
|
seat.set_active_output(&next_output);
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1217,19 +1223,25 @@ impl State {
|
||||||
.cloned()
|
.cloned()
|
||||||
{
|
{
|
||||||
let idx = self.common.shell.workspaces.active_num(&prev_output).1;
|
let idx = self.common.shell.workspaces.active_num(&prev_output).1;
|
||||||
if let Ok(Some(new_pos)) = self.common.shell.activate(&prev_output, idx) {
|
match self.common.shell.activate(&prev_output, idx) {
|
||||||
seat.set_active_output(&prev_output);
|
Ok(Some(new_pos)) => {
|
||||||
if let Some(ptr) = seat.get_pointer() {
|
seat.set_active_output(&prev_output);
|
||||||
ptr.motion(
|
if let Some(ptr) = seat.get_pointer() {
|
||||||
self,
|
ptr.motion(
|
||||||
None,
|
self,
|
||||||
&MotionEvent {
|
None,
|
||||||
location: new_pos.to_f64(),
|
&MotionEvent {
|
||||||
serial,
|
location: new_pos.to_f64(),
|
||||||
time,
|
serial,
|
||||||
},
|
time,
|
||||||
);
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Ok(None) => {
|
||||||
|
seat.set_active_output(&prev_output);
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue