mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[client] mouse: do not grab the pointer if the platform has no warp
Platforms such as Wayland have no abillity to warp the cursor, as such can not operate in an always relative mode. This property allows platforms to report the lack of warp support and prevent LG from grabbing the pointer.
This commit is contained in:
@@ -915,6 +915,11 @@ static void setCursorInView(bool enable)
|
||||
if (enable && !g_state.focused)
|
||||
return;
|
||||
|
||||
/* if the display server does not support warp, then we can not operate in
|
||||
* always relative mode and we should not grab the pointer */
|
||||
bool warpSupport = true;
|
||||
app_getProp(LG_DS_WARP_SUPPORT, &warpSupport);
|
||||
|
||||
g_cursor.inView = enable;
|
||||
g_cursor.draw = params.alwaysShowCursor ? true : enable;
|
||||
g_cursor.redraw = true;
|
||||
@@ -926,14 +931,16 @@ static void setCursorInView(bool enable)
|
||||
if (params.hideMouse)
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
|
||||
g_state.ds->grabPointer();
|
||||
if (warpSupport)
|
||||
g_state.ds->grabPointer();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (params.hideMouse)
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
|
||||
g_state.ds->ungrabPointer();
|
||||
if (warpSupport)
|
||||
g_state.ds->ungrabPointer();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user