Bugfix #25840
authorTon Roosendaal <ton@blender.org>
Sun, 30 Jan 2011 13:51:02 +0000 (13:51 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 30 Jan 2011 13:51:02 +0000 (13:51 +0000)
UI bug: when a button has an open menu, the menu closed on any
mouse-over of other buttons in this panel. That's not too bad,
but it didn't check for whether the mouse was already inside the
menu itself (respecting safety region).

The bug showed error on zoomed in UI, using FPS presets, in case
the menu-button was drawing aligned with other buttons. A real
boundary case... :)

source/blender/editors/interface/interface_handlers.c

index 222cce15f6fe1b17b968fae56f21864e55bbda58..b802098ff10ddc381260af9ba802ba173f61f82a 100644 (file)
@@ -5238,8 +5238,15 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
                retval= WM_UI_HANDLER_CONTINUE;
        }
        else if(data->state == BUTTON_STATE_MENU_OPEN) {
+               /* check for exit because of mouse-over another button */
                switch(event->type) {
-                       case MOUSEMOVE: {
+                       case MOUSEMOVE:
+                               
+                               if(data->menu && data->menu->region)
+                                       if(ui_mouse_inside_region(data->menu->region, event->x, event->y))
+                                               break;
+                       
+                       {
                                uiBut *bt= ui_but_find_mouse_over(ar, event->x, event->y);
 
                                if(bt && bt->active != data) {