mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 21:08: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:
committed by
Carlos R. Mafra
parent
2ed9c12ee5
commit
d7183d33b4
@@ -597,12 +597,19 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
|
|||||||
|
|
||||||
while (!done) {
|
while (!done) {
|
||||||
WMMaskEvent(dpy, PointerMotionMask | ButtonReleaseMask | ButtonPressMask
|
WMMaskEvent(dpy, PointerMotionMask | ButtonReleaseMask | ButtonPressMask
|
||||||
| ButtonMotionMask | ExposureMask, &ev);
|
| ButtonMotionMask | ExposureMask | EnterWindowMask, &ev);
|
||||||
switch (ev.type) {
|
switch (ev.type) {
|
||||||
case Expose:
|
case Expose:
|
||||||
WMHandleEvent(&ev);
|
WMHandleEvent(&ev);
|
||||||
break;
|
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:
|
case MotionNotify:
|
||||||
if (!grabbed) {
|
if (!grabbed) {
|
||||||
if (abs(dx - ev.xmotion.x) >= MOVE_THRESHOLD
|
if (abs(dx - ev.xmotion.x) >= MOVE_THRESHOLD
|
||||||
|
|||||||
@@ -3378,12 +3378,19 @@ static void handleDockMove(WDock * dock, WAppIcon * aicon, XEvent * event)
|
|||||||
done = 0;
|
done = 0;
|
||||||
while (!done) {
|
while (!done) {
|
||||||
WMMaskEvent(dpy, PointerMotionMask | ButtonReleaseMask | ButtonPressMask
|
WMMaskEvent(dpy, PointerMotionMask | ButtonReleaseMask | ButtonPressMask
|
||||||
| ButtonMotionMask | ExposureMask, &ev);
|
| ButtonMotionMask | ExposureMask | EnterWindowMask, &ev);
|
||||||
switch (ev.type) {
|
switch (ev.type) {
|
||||||
case Expose:
|
case Expose:
|
||||||
WMHandleEvent(&ev);
|
WMHandleEvent(&ev);
|
||||||
break;
|
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:
|
case MotionNotify:
|
||||||
if (!grabbed) {
|
if (!grabbed) {
|
||||||
if (abs(ofs_x - ev.xmotion.x) >= MOVE_THRESHOLD
|
if (abs(ofs_x - ev.xmotion.x) >= MOVE_THRESHOLD
|
||||||
|
|||||||
Reference in New Issue
Block a user