mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[client] mouse: correct issues with cursor alignment on enter/exit/focus
This commit is contained in:
@@ -146,6 +146,12 @@ static void sdlWarpPointer(int x, int y, bool exiting)
|
||||
SDL_WarpMouseInWindow(app_getWindow(), x, y);
|
||||
}
|
||||
|
||||
static void sdlRealignPointer(void)
|
||||
{
|
||||
// no need to care about grab, realign only happens in normal mode
|
||||
app_handleMouseNormal(0, 0);
|
||||
}
|
||||
|
||||
struct LG_DisplayServerOps LGDS_SDL =
|
||||
{
|
||||
.subsystem = SDL_SYSWM_UNKNOWN,
|
||||
@@ -161,6 +167,7 @@ struct LG_DisplayServerOps LGDS_SDL =
|
||||
.grabKeyboard = sdlGrabKeyboard,
|
||||
.ungrabKeyboard = sdlUngrabKeyboard,
|
||||
.warpPointer = sdlWarpPointer,
|
||||
.realignPointer = sdlRealignPointer,
|
||||
|
||||
/* SDL does not have clipboard support */
|
||||
.cbInit = NULL,
|
||||
|
@@ -391,6 +391,11 @@ static void waylandWarpPointer(int x, int y, bool exiting)
|
||||
// This is an unsupported operation on Wayland.
|
||||
}
|
||||
|
||||
static void waylandRealignPointer(void)
|
||||
{
|
||||
app_handleMouseBasic();
|
||||
}
|
||||
|
||||
static void waylandFree(void)
|
||||
{
|
||||
waylandUngrabPointer();
|
||||
@@ -774,6 +779,7 @@ struct LG_DisplayServerOps LGDS_Wayland =
|
||||
.grabKeyboard = waylandGrabKeyboard,
|
||||
.ungrabKeyboard = waylandUngrabKeyboard,
|
||||
.warpPointer = waylandWarpPointer,
|
||||
.realignPointer = waylandRealignPointer,
|
||||
|
||||
.cbInit = waylandCBInit,
|
||||
.cbNotice = waylandCBNotice,
|
||||
|
Reference in New Issue
Block a user