Skip to content

Commit

Permalink
filter pointer events
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Oct 7, 2024
1 parent bf46125 commit 423ad32
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions winit/src/platform_specific/wayland/handlers/seat/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ impl PointerHandler for SctkState {

// track events, but only forward for the active seat
for e in events {
let entry = self
.frame_status
.entry(e.surface.id())
.or_insert(FrameStatus::RequestedRedraw);
if matches!(entry, FrameStatus::Received) {
*entry = FrameStatus::Ready;
}
if my_seat.active_icon != my_seat.icon {
// Restore cursor that was set by appliction, or default
my_seat.set_cursor(
Expand All @@ -60,6 +53,13 @@ impl PointerHandler for SctkState {
if self.windows.iter().any(|w| w.window.id() == id) {
continue;
}
let entry = self
.frame_status
.entry(e.surface.id())
.or_insert(FrameStatus::RequestedRedraw);
if matches!(entry, FrameStatus::Received) {
*entry = FrameStatus::Ready;
}
if let PointerEventKind::Motion { time } = &e.kind {
self.sctk_events.push(SctkEvent::PointerEvent {
variant: PointerEvent {
Expand Down

0 comments on commit 423ad32

Please sign in to comment.