mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +00:00
[client] mouse: grab the pointer when entering capture mode if needed
If the platform doesn't support warp then the move handler will never grab the pointer, as such we need to unconditionally grab it in `setGrabQuiet`
This commit is contained in:
parent
bb37a880f0
commit
165c2c3566
@ -1229,6 +1229,11 @@ static void setGrabQuiet(bool enable)
|
||||
g_cursor.acc.x = 0.0;
|
||||
g_cursor.acc.y = 0.0;
|
||||
|
||||
/* if the display server does not support warp we need to grab the pointer
|
||||
* here instead of in the move handler */
|
||||
bool warpSupport = true;
|
||||
app_getProp(LG_DS_WARP_SUPPORT, &warpSupport);
|
||||
|
||||
if (enable)
|
||||
{
|
||||
if (!g_cursor.inView)
|
||||
@ -1236,6 +1241,10 @@ static void setGrabQuiet(bool enable)
|
||||
|
||||
if (params.grabKeyboard)
|
||||
g_state.ds->grabKeyboard();
|
||||
|
||||
if (!warpSupport)
|
||||
g_state.ds->grabPointer();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1244,6 +1253,9 @@ static void setGrabQuiet(bool enable)
|
||||
if (!g_state.focused || !params.grabKeyboardOnFocus)
|
||||
g_state.ds->ungrabKeyboard();
|
||||
}
|
||||
|
||||
if (!warpSupport)
|
||||
g_state.ds->ungrabPointer();
|
||||
}
|
||||
|
||||
// if exiting capture when input on capture only, we want to show the cursor
|
||||
|
Loading…
Reference in New Issue
Block a user