[Bf-blender-cvs] [62ed13340b4] blender2.8: UI: don't allow disabled popovers to open w/ drag

Campbell Barton noreply at git.blender.org
Wed May 2 12:03:35 CEST 2018


Commit: 62ed13340b4393a3074d1bc0f112089a31628c08
Author: Campbell Barton
Date:   Wed May 2 12:02:50 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB62ed13340b4393a3074d1bc0f112089a31628c08

UI: don't allow disabled popovers to open w/ drag

First dragging over active menu items could be used to open a disabled
popover.

===================================================================

M	source/blender/editors/interface/interface_handlers.c

===================================================================

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 622c76079c0..e0ee966cb34 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -10008,8 +10008,10 @@ static int ui_handler_region_menu(bContext *C, const wmEvent *event, void *UNUSE
 		{
 			/* if mouse moves to a different root-level menu button,
 			 * open it to replace the current menu */
-			ui_handle_button_activate(C, ar, but_other, BUTTON_ACTIVATE_OVER);
-			button_activate_state(C, but_other, BUTTON_STATE_MENU_OPEN);
+			if ((but_other->flag & UI_BUT_DISABLED) == 0) {
+				ui_handle_button_activate(C, ar, but_other, BUTTON_ACTIVATE_OVER);
+				button_activate_state(C, but_other, BUTTON_STATE_MENU_OPEN);
+			}
 		}
 		else if (data->state == BUTTON_STATE_MENU_OPEN) {
 			int retval;



More information about the Bf-blender-cvs mailing list