mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-06 10:44:01 +00:00
[client] ds: separate grab and capture logic
Currently, (un)grabPointer is used both for tracking/confining the mouse in normal mode, as well as entering/exiting capture mode. This makes it impossible to use separate cursor logic for capture mode, which is needed to deal with overlapping windows for the Wayland backend. This commit creates separate (un)capturePointer for entering/exiting capture mode. There should be no behaviour changes.
This commit is contained in:
@@ -357,6 +357,24 @@ void waylandUngrabPointer(void)
|
||||
}
|
||||
}
|
||||
|
||||
void waylandCapturePointer(void)
|
||||
{
|
||||
waylandGrabPointer();
|
||||
}
|
||||
|
||||
void waylandUncapturePointer(void)
|
||||
{
|
||||
/* we need to ungrab the pointer on the following conditions when exiting capture mode:
|
||||
* - if warp is not supported, exit via window edge detection will never work
|
||||
* as the cursor can not be warped out of the window when we release it.
|
||||
* - if the format is invalid as we do not know where the guest cursor is,
|
||||
* which also breaks edge detection.
|
||||
* - if the user has opted to use captureInputOnly mode.
|
||||
*/
|
||||
if (!wlWm.warpSupport || !app_isFormatValid() || app_isCaptureOnlyMode())
|
||||
waylandUngrabPointer();
|
||||
}
|
||||
|
||||
void waylandGrabKeyboard(void)
|
||||
{
|
||||
if (wlWm.keyboardInhibitManager && !wlWm.keyboardInhibitor)
|
||||
|
Reference in New Issue
Block a user