diff options
-rw-r--r-- | src/ui/util.c | 8 | ||||
-rw-r--r-- | src/ui/window.c | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index 770071a6..a24b3199 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -181,7 +181,13 @@ static iBool menuHandler_(iWidget *menu, const char *cmd) { | |||
181 | /* Don't reopen self; instead, root will close the menu. */ | 181 | /* Don't reopen self; instead, root will close the menu. */ |
182 | return iFalse; | 182 | return iFalse; |
183 | } | 183 | } |
184 | if (!equal_Command(cmd, "window.resized")) { | 184 | if (equal_Command(cmd, "mouse.clicked") && arg_Command(cmd)) { |
185 | /* Dismiss open menus when clicking outside them. */ | ||
186 | closeMenu_Widget(menu); | ||
187 | return iTrue; | ||
188 | } | ||
189 | if (!equal_Command(cmd, "window.resized") && | ||
190 | !(equal_Command(cmd, "mouse.clicked") && !arg_Command(cmd)) /* ignore button release */) { | ||
185 | closeMenu_Widget(menu); | 191 | closeMenu_Widget(menu); |
186 | } | 192 | } |
187 | } | 193 | } |
diff --git a/src/ui/window.c b/src/ui/window.c index a8c86e56..bdf80e52 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -229,10 +229,10 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) { | |||
229 | isRequestOngoing_DocumentWidget(doc) ? stopCStr_ : reloadCStr_); | 229 | isRequestOngoing_DocumentWidget(doc) ? stopCStr_ : reloadCStr_); |
230 | } | 230 | } |
231 | } | 231 | } |
232 | else if (equal_Command(cmd, "mouse.clicked")) { | 232 | else if (equal_Command(cmd, "mouse.clicked") && arg_Command(cmd)) { |
233 | iWidget *widget = pointer_Command(cmd); | 233 | iWidget *widget = pointer_Command(cmd); |
234 | iWidget *menu = findWidget_App("doctabs.menu"); | 234 | iWidget *menu = findWidget_App("doctabs.menu"); |
235 | if (isTabButton_Widget(widget)) { | 235 | if (isTabButton_Widget(widget) && !isVisible_Widget(menu)) { |
236 | iWidget *tabs = findWidget_App("doctabs"); | 236 | iWidget *tabs = findWidget_App("doctabs"); |
237 | showTabPage_Widget(tabs, | 237 | showTabPage_Widget(tabs, |
238 | tabPage_Widget(tabs, childIndex_Widget(widget->parent, widget))); | 238 | tabPage_Widget(tabs, childIndex_Widget(widget->parent, widget))); |