Fix T48595: UI glitch with driver menu re-opening
authorCampbell Barton <ideasman42@gmail.com>
Mon, 13 Jun 2016 15:36:27 +0000 (01:36 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 13 Jun 2016 15:52:35 +0000 (01:52 +1000)
Holding Ctrl-D would keep opening driver menus.

source/blender/editors/interface/interface_handlers.c

index ff4e11ac58b754f61361c9ae3f486cfa20a8d898..133487e18467857e5acd163249256d9e1909c806 100644 (file)
@@ -6981,13 +6981,15 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
                         !IS_EVENT_MOD(event, shift, oskey) &&
                         (event->val == KM_PRESS))
                {
-                       if (event->alt)
-                               ui_but_anim_remove_driver(C);
-                       else if (event->ctrl)
-                               ui_but_anim_add_driver(C);
-                               
-                       ED_region_tag_redraw(data->region);
-                       
+                       /* quick check to prevent this opening within the popup menu its self */
+                       if (!ELEM(NULL, but->rnapoin.data, but->rnaprop)) {
+                               if (event->alt)
+                                       ui_but_anim_remove_driver(C);
+                               else if (event->ctrl)
+                                       ui_but_anim_add_driver(C);
+
+                               ED_region_tag_redraw(data->region);
+                       }
                        return WM_UI_HANDLER_BREAK;
                }
                /* handle keyingsets */