From 26564ff3430d1d8b199c09192c3078071552788e Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Sat, 23 Apr 2016 16:49:34 +0200 Subject: 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 ;) --- source/blender/editors/interface/interface_regions.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source') 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); -- cgit v1.2.3