These replace the ENTER_LEAVE_SEMAPHORE_* macros. Unused currently. Signed-off-by: Peter Hutterer <[EMAIL PROTECTED]> ---
The newly added HasOtherPointer() function is needed to provide correct enter/leave event handling during active grabs. dix/enterleave.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/dix/enterleave.c b/dix/enterleave.c index 11929c6..57d1f1e 100644 --- a/dix/enterleave.c +++ b/dix/enterleave.c @@ -34,6 +34,56 @@ #include "enterleave.h" /** + * Return TRUE if @win has a pointer within its boundaries, excluding child + * window. + */ +static BOOL +HasPointer(WindowPtr win) +{ + int i; + + for (i = 0; i < sizeof(win->enterleave); i++) + if (win->enterleave[i]) + return TRUE; + + return FALSE; +} + +static BOOL +HasOtherPointer(WindowPtr win, DeviceIntPtr dev) +{ + int i; + + for (i = 0; i < sizeof(win->enterleave); i++) + if (win->enterleave[i] && + !(i == dev->id/8 && win->enterleave[i] == (1 << (dev->id % 8)))) + { + return TRUE; + } + + return FALSE; +} + +/** + * Set the presence flag for @dev to mark that it is now in @win. + */ +static void +EnterWindow(DeviceIntPtr dev, WindowPtr win, int mode) +{ + win->enterleave[dev->id/8] |= (1 << (dev->id % 8)); +} + +/** + * Unset the presence flag for @dev to mark that it is not in @win anymore. + */ +static void +LeaveWindow(DeviceIntPtr dev, WindowPtr win, int mode) +{ + win->enterleave[dev->id/8] &= ~(1 << (dev->id % 8)); +} + + +/** * @return The window that is the first ancestor of both a and b. */ WindowPtr -- 1.6.0.3 Cheers, Peter _______________________________________________ xorg mailing list xorg@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/xorg