Fix: File browser report popups not showing up
authorJulian Eisel <eiseljulian@gmail.com>
Fri, 6 Sep 2019 14:46:36 +0000 (16:46 +0200)
committerJulian Eisel <eiseljulian@gmail.com>
Fri, 6 Sep 2019 14:49:59 +0000 (16:49 +0200)
Popup would be closed immediately after creating, because of incorrect
mouse coordinates stored in window (popup is set to close if mouse is
some distance away from it).

Completes fix for T69581.

source/blender/windowmanager/intern/wm_event_system.c

index 7216278c9f989c568e889fb51861bc64f16c8397..2e3abfd9944af7f54e656a852583f9234d890c7f 100644 (file)
@@ -2397,6 +2397,9 @@ static int wm_handler_fileselect_do(bContext *C,
               CTX_wm_window_set(C, ctx_win);  // wm_window_close() NULLs.
               /* Some operators expect a drawable context (for EVT_FILESELECT_EXEC) */
               wm_window_make_drawable(wm, ctx_win);
+              /* Ensure correct cursor positon, otherwise, popups may close immediately after
+               * opening (UI_BLOCK_MOVEMOUSE_QUIT) */
+              wm_get_cursor_position(ctx_win, &ctx_win->eventstate->x, &ctx_win->eventstate->y);
               wm->winactive = ctx_win; /* Reports use this... */
             }
             else if (file_sa->full) {