Fix T76926: Crash with Full Screen file browser window preference

Alternative fix for T75292 & T73579 (see b75ce05c3b), that does not
cause this crash.

The crash happened because cancelling the file browser removes its
screen (as in bScreen). Before rBb75ce05c3b0f, the file browser event
wouldn't be handled any further then. After it, it would still be passed
to other areas, while the screen pointer was dangling.
Now the event is only skipped for UI handlers.

Reviewed by: Julian Eisel
This commit is contained in:
Jacques Lucke 2020-05-25 18:33:12 +02:00 committed by Julian Eisel
parent 396bf6ca78
commit 6fbeded285
Notes: blender-bot 2023-02-14 04:39:18 +01:00
Referenced by issue #76926, Crash on saving or opening files with the Full Screen file browser window preference
1 changed files with 7 additions and 1 deletions

View File

@ -563,7 +563,7 @@ void wm_event_do_notifiers(bContext *C)
static int wm_event_always_pass(const wmEvent *event)
{
/* some events we always pass on, to ensure proper communication */
return ISTIMER(event->type) || (event->type == WINDEACTIVATE) || (event->type == EVT_FILESELECT);
return ISTIMER(event->type) || (event->type == WINDEACTIVATE);
}
/** \} */
@ -602,6 +602,12 @@ static int wm_handler_ui_call(bContext *C,
}
}
/* Don't block file-select events. Those are triggered by a separate file browser window.
* See T75292. */
if (event->type == EVT_FILESELECT) {
return WM_UI_HANDLER_CONTINUE;
}
/* we set context to where ui handler came from */
if (handler->context.area) {
CTX_wm_area_set(C, handler->context.area);