Fix #36783: click outside splash screen to close it would not highlight the
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 23 Sep 2013 23:31:42 +0000 (23:31 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 23 Sep 2013 23:31:42 +0000 (23:31 +0000)
button under the mouse, and so clicking the button failed without first
moving the mouse. Similar issues could happen with popups and switching
windows.

The problem is that a notifier was being used to deactivate possible other
activated buttons, but as notifiers are delayed it could undo the correct
activation too. If anyone notices hanging tooltips or other issues after this
fix, please report them.

source/blender/editors/interface/interface_handlers.c
source/blender/editors/screen/screen_edit.c
source/blender/windowmanager/WM_types.h

index 4a6d14d7004d00c69f171656145f8c4cc1145448..20e03e7dcd54f9ffcb662aa113e5b492cb3d8bbf 100644 (file)
@@ -7728,6 +7728,8 @@ static int ui_handler_popup(bContext *C, const wmEvent *event, void *userdata)
                }
                else if (temp.cancel_func)
                        temp.cancel_func(C, temp.popup_arg);
+
+               WM_event_add_mousemove(C);
        }
        else {
                /* re-enable tooltips */
index 10c2ecd6fd9e39df5a6a103c94abd7d9de68e6fb..356db174c2f64fe8d85c064805b9b66bd4f09601 100644 (file)
@@ -1009,8 +1009,6 @@ void ED_screen_do_listen(bContext *C, wmNotifier *note)
                        win->screen->do_draw = TRUE;
                        break;
                case NC_SCREEN:
-                       if (note->data == ND_SUBWINACTIVE)
-                               uiFreeActiveButtons(C, win->screen);
                        if (note->action == NA_EDITED)
                                win->screen->do_draw = win->screen->do_refresh = TRUE;
                        break;
@@ -1335,7 +1333,11 @@ void ED_screen_set_subwinactive(bContext *C, wmEvent *event)
                        /* notifier invokes freeing the buttons... causing a bit too much redraws */
                        if (oldswin != scr->subwinactive) {
                                region_cursor_set(win, scr->subwinactive, TRUE);
-                               WM_event_add_notifier(C, NC_SCREEN | ND_SUBWINACTIVE, scr);
+
+                               /* this used to be a notifier, but needs to be done immediate
+                                * because it can undo setting the right button as active due
+                                * to delayed notifier handling */
+                               uiFreeActiveButtons(C, win->screen);
                        }
                        else
                                region_cursor_set(win, scr->subwinactive, FALSE);
index e6b6df11d7dfa511c224260f6776a4d04d59971d..ac9af832671374be272acbe8d7c3197963055478 100644 (file)
@@ -261,7 +261,6 @@ typedef struct wmNotifier {
 #define ND_EDITOR_CHANGED      (6<<16) /*sent to new editors after switching to them*/
 #define ND_SCREENSET           (7<<16)
 #define ND_SKETCH                      (8<<16)
-#define ND_SUBWINACTIVE                (9<<16)
 
        /* NC_SCENE Scene */
 #define ND_SCENEBROWSE         (1<<16)