Skip to content

Commit

Permalink
Don't send empty input frames
Browse files Browse the repository at this point in the history
  • Loading branch information
HildarTheDorf committed Jan 23, 2025
1 parent 92243fb commit 56da1fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions wayland/Pointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ Pointer::Pointer(Seat& seat)

self._events.emplace_back(std::make_unique<LeavePointerEvent>(serial));

if (self._focus) {
if (self._focus && !self._events.empty()) {
self._focus->pointer_events(self._events);
self._events.clear();
}

self._events.clear();
self._cursor->unset_pointer(serial);
self._focus = nullptr;
},
Expand Down
12 changes: 5 additions & 7 deletions wayland/TouchPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ void TouchPoint::clear_events() {
}

void TouchPoint::send_events() {
if (!_events.empty()) {
if (_focus) {
_focus->touch_events(_id, _events);
}

clear_events();
if (_focus && !_events.empty()) {
_focus->touch_events(_id, _events);
}
}

clear_events();
}

0 comments on commit 56da1fc

Please sign in to comment.