[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:
Quantum authored and Geoffrey McRae committed 2021-05-04 18:17:19 +10:00
1 parent 7acbc57bc7
commit 00c2773e6b
9 files changed
+65 -14

No files matched your search

+8 -2
View File
@@ -131,10 +131,14 @@ struct LG_DisplayServerOps
/* dm specific cursor implementations */
void (*guestPointerUpdated)(double x, double y, int localX, int localY);
void (*showPointer)(bool show);
void (*grabPointer)();
void (*ungrabPointer)();
void (*grabKeyboard)();
void (*ungrabKeyboard)();
/* (un)grabPointer is used to toggle cursor tracking/confine in normal mode */
void (*grabPointer)();
void (*ungrabPointer)();
/* (un)capturePointer is used do toggle special cursor tracking in capture mode */
void (*capturePointer)();
void (*uncapturePointer)();
/* exiting = true if the warp is to leave the window */
void (*warpPointer)(int x, int y, bool exiting);
@@ -199,6 +203,8 @@ struct LG_DisplayServerOps
assert((x)->showPointer ); \
assert((x)->grabPointer ); \
assert((x)->ungrabPointer ); \
assert((x)->capturePointer ); \
assert((x)->uncapturePointer ); \
assert((x)->warpPointer ); \
assert((x)->realignPointer ); \
assert((x)->isValidPointerPos ); \