Skip to content

Commit

Permalink
[client] wayland: synchronize host cursor position with guest
Browse files Browse the repository at this point in the history
This mirrors the x11 implementation, allowing the pointer to move
correctly into overlapping windows.
  • Loading branch information
quantum5 authored and gnif committed May 3, 2021
1 parent d0a12f6 commit ee38045
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 0 additions & 4 deletions client/displayservers/Wayland/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,3 @@ void waylandShowPointer(bool show)
wlWm.showPointer = show;
wl_pointer_set_cursor(wlWm.pointer, wlWm.pointerEnterSerial, show ? wlWm.cursor : NULL, 0, 0);
}

void waylandGuestPointerUpdated(double x, double y, int localX, int localY)
{
}
8 changes: 8 additions & 0 deletions client/displayservers/Wayland/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,3 +413,11 @@ void waylandRealignPointer(void)
if (!wlWm.warpSupport)
app_resyncMouseBasic();
}

void waylandGuestPointerUpdated(double x, double y, int localX, int localY)
{
if (!wlWm.warpSupport || !wlWm.pointerInSurface)
return;

waylandWarpPointer(localX, localY, false);
}
2 changes: 1 addition & 1 deletion client/displayservers/Wayland/wayland.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ void waylandCBRelease(void);
// cursor module
bool waylandCursorInit(void);
void waylandCursorFree(void);
void waylandGuestPointerUpdated(double x, double y, int localX, int localY);
void waylandShowPointer(bool show);

// gl module
Expand Down Expand Up @@ -228,6 +227,7 @@ void waylandUngrabKeyboard(void);
void waylandUngrabPointer(void);
void waylandRealignPointer(void);
void waylandWarpPointer(int x, int y, bool exiting);
void waylandGuestPointerUpdated(double x, double y, int localX, int localY);

// output module
bool waylandOutputInit(void);
Expand Down

0 comments on commit ee38045

Please sign in to comment.