mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
fixed lockup when multi-clicking menu
This commit is contained in:
16
src/menu.c
16
src/menu.c
@@ -1949,6 +1949,11 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event)
|
|||||||
d_data.magic = WMAddTimerHandler(wPreferences.dblclick_time,
|
d_data.magic = WMAddTimerHandler(wPreferences.dblclick_time,
|
||||||
delaySelection, &d_data);
|
delaySelection, &d_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (menu->flags.inside_handler) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
menu->flags.inside_handler = 1;
|
||||||
|
|
||||||
wRaiseFrame(menu->frame->core);
|
wRaiseFrame(menu->frame->core);
|
||||||
|
|
||||||
@@ -1963,7 +1968,7 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (menu->flags.editing) {
|
if (menu->flags.editing) {
|
||||||
return;
|
goto byebye;
|
||||||
}
|
}
|
||||||
entry_no = getEntryAt(menu, x, y);
|
entry_no = getEntryAt(menu, x, y);
|
||||||
if (entry_no>=0) {
|
if (entry_no>=0) {
|
||||||
@@ -1972,9 +1977,9 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event)
|
|||||||
if (!close_on_exit && (bev->state & ControlMask) && smenu
|
if (!close_on_exit && (bev->state & ControlMask) && smenu
|
||||||
&& entry->flags.editable) {
|
&& entry->flags.editable) {
|
||||||
editEntry(smenu, entry);
|
editEntry(smenu, entry);
|
||||||
return;
|
goto byebye;
|
||||||
} else if (bev->state & ControlMask) {
|
} else if (bev->state & ControlMask) {
|
||||||
return;
|
goto byebye;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry->flags.enabled && entry->cascade>=0 && menu->cascades) {
|
if (entry->flags.enabled && entry->cascade>=0 && menu->cascades) {
|
||||||
@@ -2005,7 +2010,7 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event)
|
|||||||
while (!done) {
|
while (!done) {
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
XAllowEvents(dpy, SyncPointer, CurrentTime);
|
XAllowEvents(dpy, AsyncPointer|SyncPointer, CurrentTime);
|
||||||
|
|
||||||
WMMaskEvent(dpy, ExposureMask|ButtonMotionMask|ButtonReleaseMask
|
WMMaskEvent(dpy, ExposureMask|ButtonMotionMask|ButtonReleaseMask
|
||||||
|ButtonPressMask, &ev);
|
|ButtonPressMask, &ev);
|
||||||
@@ -2205,6 +2210,9 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event)
|
|||||||
|
|
||||||
if (!wPreferences.wrap_menus)
|
if (!wPreferences.wrap_menus)
|
||||||
wMenuMove(parentMenu(desc->parent), old_frame_x, old_frame_y, True);
|
wMenuMove(parentMenu(desc->parent), old_frame_x, old_frame_y, True);
|
||||||
|
|
||||||
|
byebye:
|
||||||
|
((WMenu*)desc->parent)->flags.inside_handler = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ typedef struct WMenu {
|
|||||||
unsigned int brother:1; /* if this is a copy of the menu*/
|
unsigned int brother:1; /* if this is a copy of the menu*/
|
||||||
unsigned int editing:1;
|
unsigned int editing:1;
|
||||||
unsigned int jump_back_pending:1;
|
unsigned int jump_back_pending:1;
|
||||||
|
|
||||||
|
unsigned int inside_handler:1;
|
||||||
} flags;
|
} flags;
|
||||||
} WMenu;
|
} WMenu;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user