diff --git a/src/appicon.c b/src/appicon.c index 4437e58f..05a8485d 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -597,12 +597,19 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event) while (!done) { WMMaskEvent(dpy, PointerMotionMask | ButtonReleaseMask | ButtonPressMask - | ButtonMotionMask | ExposureMask, &ev); + | ButtonMotionMask | ExposureMask | EnterWindowMask, &ev); switch (ev.type) { case Expose: WMHandleEvent(&ev); break; + case EnterNotify: + /* It means the cursor moved so fast that it entered + * something else (if moving slowly, it would have + * stayed in the appIcon that is being moved. Ignore + * such "spurious" EnterNotifiy's */ + break; + case MotionNotify: if (!grabbed) { if (abs(dx - ev.xmotion.x) >= MOVE_THRESHOLD diff --git a/src/dock.c b/src/dock.c index 1d82a371..a71c36b7 100644 --- a/src/dock.c +++ b/src/dock.c @@ -3378,12 +3378,19 @@ static void handleDockMove(WDock * dock, WAppIcon * aicon, XEvent * event) done = 0; while (!done) { WMMaskEvent(dpy, PointerMotionMask | ButtonReleaseMask | ButtonPressMask - | ButtonMotionMask | ExposureMask, &ev); + | ButtonMotionMask | ExposureMask | EnterWindowMask, &ev); switch (ev.type) { case Expose: WMHandleEvent(&ev); break; + case EnterNotify: + /* It means the cursor moved so fast that it entered + * something else (if moving slowly, it would have + * stayed in the dock that is being moved. Ignore such + * "spurious" EnterNotifiy's */ + break; + case MotionNotify: if (!grabbed) { if (abs(ofs_x - ev.xmotion.x) >= MOVE_THRESHOLD