#include <glib.h>
#include <X11/Xlib.h>
-#define GRAB_PTR_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask)
+#define GRAB_PTR_MASK (ButtonPressMask | ButtonReleaseMask | \
+ PointerMotionMask | EnterWindowMask | LeaveWindowMask)
#define GRAB_KEY_MASK (KeyPressMask | KeyReleaseMask)
#define MASK_LIST_SIZE 8
static Time ungrab_time()
{
Time t = event_curtime;
- if (!(t == 0 || event_time_after(t, grab_time)))
+ if (!(t == CurrentTime || event_time_after(t, grab_time)))
/* When the time moves backward on the server, then we can't use
the grab time because that will be in the future. So instead we
have to use CurrentTime.
if (grab) {
if (kgrabs++ == 0) {
ret = XGrabKeyboard(ob_display, RootWindow(ob_display, ob_screen),
- FALSE, GrabModeAsync, GrabModeAsync,
+ False, GrabModeAsync, GrabModeAsync,
event_curtime) == Success;
if (!ret)
--kgrabs;
if (grab) {
if (pgrabs++ == 0) {
ret = XGrabPointer(ob_display, screen_support_win,
- False, GRAB_PTR_MASK, GrabModeAsync,
+ True, GRAB_PTR_MASK, GrabModeAsync,
GrabModeAsync, None,
ob_cursor(cur), event_curtime) == Success;
if (!ret)
if (grab) {
if (pgrabs++ == 0) {
- ret = XGrabPointer(ob_display, win, False, GRAB_PTR_MASK,
+ ret = XGrabPointer(ob_display, win, True, GRAB_PTR_MASK,
GrabModeAsync, GrabModeAsync, None,
ob_cursor(cur),
event_curtime) == Success;