diff options
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index 0af33138..e055244b 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -201,7 +201,8 @@ static iBool menuHandler_(iWidget *menu, const char *cmd) { | |||
201 | /* Don't reopen self; instead, root will close the menu. */ | 201 | /* Don't reopen self; instead, root will close the menu. */ |
202 | return iFalse; | 202 | return iFalse; |
203 | } | 203 | } |
204 | if (equal_Command(cmd, "mouse.clicked") && arg_Command(cmd)) { | 204 | if ((equal_Command(cmd, "mouse.clicked") || equal_Command(cmd, "mouse.missed")) && |
205 | arg_Command(cmd)) { | ||
205 | /* Dismiss open menus when clicking outside them. */ | 206 | /* Dismiss open menus when clicking outside them. */ |
206 | closeMenu_Widget(menu); | 207 | closeMenu_Widget(menu); |
207 | return iTrue; | 208 | return iTrue; |
@@ -252,6 +253,7 @@ void openMenu_Widget(iWidget *d, iInt2 coord) { | |||
252 | postCommand_App("cancel"); /* dismiss any other menus */ | 253 | postCommand_App("cancel"); /* dismiss any other menus */ |
253 | processEvents_App(postedEventsOnly_AppEventMode); | 254 | processEvents_App(postedEventsOnly_AppEventMode); |
254 | setFlags_Widget(d, hidden_WidgetFlag, iFalse); | 255 | setFlags_Widget(d, hidden_WidgetFlag, iFalse); |
256 | setFlags_Widget(d, commandOnMouseMiss_WidgetFlag, iTrue); | ||
255 | setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iFalse); | 257 | setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iFalse); |
256 | arrange_Widget(d); | 258 | arrange_Widget(d); |
257 | d->rect.pos = coord; | 259 | d->rect.pos = coord; |