Skip to content

Commit

Permalink
Send relative_pointer in frame with pointer; update Smithay
Browse files Browse the repository at this point in the history
The protocol doesn't specify this, but XWayland does assume relative
pointer events are part of a frame.

This works for now, though a better solution will be needed in Smithay
to also handle pointer constraints where a relative motion may occur
alone, etc.

This seems to fix #159.
  • Loading branch information
ids1024 committed Sep 8, 2023
1 parent f6ea7fa commit 6247918
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ debug = true
lto = "fat"

[patch."https://github.com/Smithay/smithay.git"]
smithay = { git = "https://github.com/smithay//smithay", rev = "36a0ec69b1" }
smithay = { git = "https://github.com/smithay//smithay", rev = "1a61e1c13a" }
22 changes: 12 additions & 10 deletions src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,24 +498,26 @@ impl State {
}
}
let ptr = seat.get_pointer().unwrap();
ptr.motion(
self,
under.clone(),
&MotionEvent {
location: position,
serial,
time: event.time_msec(),
},
);
// Relative motion is sent first to ensure they're part of a `frame`
// TODO: Find more correct solution
ptr.relative_motion(
self,
under,
under.clone(),
&RelativeMotionEvent {
delta: event.delta(),
delta_unaccel: event.delta_unaccel(),
utime: event.time(),
},
);
ptr.motion(
self,
under,
&MotionEvent {
location: position,
serial,
time: event.time_msec(),
},
);
#[cfg(feature = "debug")]
if self.common.seats().position(|x| x == &seat).unwrap() == 0 {
let location = if let Some(output) = self.common.shell.outputs.first() {
Expand Down

0 comments on commit 6247918

Please sign in to comment.