mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-06 18:54:02 +00:00
[client] ds: detect when the cursor exits into an overlapping window
This adds a new method to the display server interface to allow the application to notify the ds when there is a guest cursor position update along with the translated local guest cursor position. This makes it possible for the display server to keep the local cursor position in sync with the guest cursor so that window leave events can be detected when the cursor would move into an overlapping window. Wayland currently just has a stub for this, and the X11 implementation still needs some minor tweaking.
This commit is contained in:
@@ -37,6 +37,7 @@ LG_MsgAlert;
|
||||
|
||||
bool app_isRunning(void);
|
||||
bool app_inputEnabled(void);
|
||||
bool app_isCaptureMode(void);
|
||||
void app_updateCursorPos(double x, double y);
|
||||
void app_updateWindowPos(int x, int y);
|
||||
void app_handleResizeEvent(int w, int h, double scale, const struct Border border);
|
||||
|
@@ -129,6 +129,7 @@ struct LG_DisplayServerOps
|
||||
#endif
|
||||
|
||||
/* dm specific cursor implementations */
|
||||
void (*guestPointerUpdated)(double x, double y, int localX, int localY);
|
||||
void (*showPointer)(bool show);
|
||||
void (*grabPointer)();
|
||||
void (*ungrabPointer)();
|
||||
@@ -194,6 +195,7 @@ struct LG_DisplayServerOps
|
||||
ASSERT_OPENGL_FN((x)->glMakeCurrent ); \
|
||||
ASSERT_OPENGL_FN((x)->glSetSwapInterval); \
|
||||
ASSERT_OPENGL_FN((x)->glSwapBuffers ); \
|
||||
assert((x)->guestPointerUpdated); \
|
||||
assert((x)->showPointer ); \
|
||||
assert((x)->grabPointer ); \
|
||||
assert((x)->ungrabPointer ); \
|
||||
|
@@ -33,4 +33,11 @@ bool util_guestCurToLocal(struct DoublePoint *local);
|
||||
void util_localCurToGuest(struct DoublePoint *guest);
|
||||
void util_rotatePoint(struct DoublePoint *point);
|
||||
|
||||
static inline double util_clamp(double x, double min, double max)
|
||||
{
|
||||
if (x < min) return min;
|
||||
if (x > max) return max;
|
||||
return x;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user