diff --git a/client/displayservers/Wayland/input.c b/client/displayservers/Wayland/input.c index 55e50f02..45fc672e 100644 --- a/client/displayservers/Wayland/input.c +++ b/client/displayservers/Wayland/input.c @@ -338,12 +338,10 @@ static void relativePointerMotionHandler(void * data, { const double dx = wl_fixed_to_double(dxW); const double dy = wl_fixed_to_double(dyW); - wlMotionRel(&wlWm.motion, dx, dy); MTRACE("rel time=%u:%u delta=%.3f,%.3f raw=%.3f,%.3f " "pos=%.3f,%.3f", timeHi, timeLo, dx, dy, wl_fixed_to_double(dxUnaccelW), wl_fixed_to_double(dyUnaccelW), wlWm.motion.x, wlWm.motion.y); - app_updateCursorPos(wlWm.motion.x, wlWm.motion.y); app_handleMouseRelative( dx, diff --git a/client/src/core.c b/client/src/core.c index ac4494f2..637d2be8 100644 --- a/client/src/core.c +++ b/client/src/core.c @@ -845,8 +845,8 @@ void core_handleMouseNormal(double ex, double ey) } while(app_isRunning()); - g_cursor.guest.x = control.cursorPos.x; - g_cursor.guest.y = control.cursorPos.y; + g_cursor.guest.x = control.cursorPos.x - g_cursor.guest.hx; + g_cursor.guest.y = control.cursorPos.y - g_cursor.guest.hy; g_cursor.realign = false; g_cursor.realigning = false; g_cursor.redraw = true; diff --git a/client/src/main.c b/client/src/main.c index b79eb2f1..2e30390b 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1084,6 +1084,9 @@ int main_cursorThread(void * unused) if (pointer.flags & LG_TRANSPORT_POINTER_SHAPE) { + const int oldHX = g_cursor.guest.hx; + const int oldHY = g_cursor.guest.hy; + switch (pointer.type) { case CURSOR_TYPE_COLOR : cursorType = LG_CURSOR_COLOR ; break; @@ -1106,6 +1109,13 @@ int main_cursorThread(void * unused) } g_cursor.guest.hx = pointer.hx; g_cursor.guest.hy = pointer.hy; + + if (hotspotChanged && g_cursor.guest.valid && + !(pointer.flags & LG_TRANSPORT_POINTER_POSITION)) + { + g_cursor.guest.x += oldHX - pointer.hx; + g_cursor.guest.y += oldHY - pointer.hy; + } } if ((pointer.flags & LG_TRANSPORT_POINTER_COLOR_TRANSFORM) &&