1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 12:58:08 +01:00

Gobble "spurious" EnterNotify events when moving an appIcon or a dock

This is a bug fix. Bug overview: if an AppIcon is moved rapidly over a Clip
    set to auto-expand, the latter may erroneously auto-expand afterwards.

    How to reproduce it: set a Clip to auto-collapse, and make sure it contains a
    (random) AppIcon, so as to easily visualise its open/close state. Now move
    rapidly an AppIcon over the Clip. Try to move it so fast that the cursor
    sometimes is out of the AppIcon's tile. Then, replace the AppIcon out of the
    Clip.

    Explanation and correction: if, while the AppIcon was being moved, the mouse
    cursor entered at least once in the Clip's tile, the latter is going to
    receive an EnterNotify event (after the AppIcon is replaced) and thus expand
    automatically after the relevant delay. The solution is to simply "gobble"
    (i.e., ignore) all EnterNotify events when moving an AppIcon.
This commit is contained in:
Daniel Déchelotte
2009-09-01 09:22:37 +02:00
committed by Carlos R. Mafra
parent 2ed9c12ee5
commit d7183d33b4
2 changed files with 16 additions and 2 deletions

View File

@@ -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

View File

@@ -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