diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2016-04-23 17:49:34 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2016-04-23 18:24:00 +0300 |
commit | 26564ff3430d1d8b199c09192c3078071552788e (patch) | |
tree | f05db8b99de9012bfd65d6e651cf51b45e028b97 /source/blender/editors | |
parent | 35be6d87e84e110714456896deb086576bb02355 (diff) |
Event system: Let event pass through after menu poll fails
Part 2 of Fix for T48200. Without this, it's not possible to exit GPencil edit mode using tab key with pies enabled.
Menus are somehow similar to operators, which let the event pass through too after operator poll returns 0. So think we should handle them similar here.
Can't guarantee this is totally safe though ;)
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index b3972bebd96..9e49d7e7e90 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -3006,7 +3006,8 @@ int UI_pie_menu_invoke(struct bContext *C, const char *idname, const wmEvent *ev } if (mt->poll && mt->poll(C, mt) == 0) - return OPERATOR_CANCELLED; + /* cancel but allow event to pass through, just like operators do */ + return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); pie = UI_pie_menu_begin(C, IFACE_(mt->label), ICON_NONE, event); layout = UI_pie_menu_layout(pie); @@ -3237,7 +3238,8 @@ int UI_popup_menu_invoke(bContext *C, const char *idname, ReportList *reports) } if (mt->poll && mt->poll(C, mt) == 0) - return OPERATOR_CANCELLED; + /* cancel but allow event to pass through, just like operators do */ + return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); pup = UI_popup_menu_begin(C, IFACE_(mt->label), ICON_NONE); layout = UI_popup_menu_layout(pup); |