Skip to content

Commit

Permalink
seat: fix double scrolling in some applications (#8583)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikalco authored Nov 26, 2024
1 parent 2687788 commit 1fb720b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/managers/SeatManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,10 @@ void CSeatManager::sendPointerAxis(uint32_t timeMs, wl_pointer_axis axis, double
p->sendAxisRelativeDirection(axis, relative);

if (source == 0) {
p->sendAxisValue120(axis, value120);
p->sendAxisDiscrete(axis, discrete);
if (p->version() >= 8)
p->sendAxisValue120(axis, value120);
else
p->sendAxisDiscrete(axis, discrete);
} else if (value == 0)
p->sendAxisStop(timeMs, axis);
}
Expand Down
4 changes: 4 additions & 0 deletions src/protocols/core/Seat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ CWLPointerResource::CWLPointerResource(SP<CWlPointer> resource_, SP<CWLSeatResou
sendEnter(g_pSeatManager->state.pointerFocus.lock(), {-1, -1} /* Coords don't really matter that much, they will be updated next move */);
}

int CWLPointerResource::version() {
return resource->version();
}

bool CWLPointerResource::good() {
return resource->resource();
}
Expand Down
1 change: 1 addition & 0 deletions src/protocols/core/Seat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class CWLPointerResource {
CWLPointerResource(SP<CWlPointer> resource_, SP<CWLSeatResource> owner_);

bool good();
int version();
void sendEnter(SP<CWLSurfaceResource> surface, const Vector2D& local);
void sendLeave();
void sendMotion(uint32_t timeMs, const Vector2D& local);
Expand Down

0 comments on commit 1fb720b

Please sign in to comment.