diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-29 08:26:37 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-29 08:27:57 +0300 |
commit | 55e23dd24bf29c8aa6c257f74bac9b0b10c7e391 (patch) | |
tree | a04ec57123c0c8f5485062bc0d285f9de7ca3efd /src/ui/util.c | |
parent | f90104259c4929c86c1af630c4eff62580c3028b (diff) |
Context menu behavior improvements
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 8 |
1 files changed, 7 insertions, 1 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 | } |