Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_event_system.c
| Show First 20 Lines • Show All 3,563 Lines • ▼ Show 20 Lines | |||||
| * The file window can send event to make it execute, thus ensuring | * The file window can send event to make it execute, thus ensuring | ||||
| * executing happens outside of lower level queues, with UI refreshed. | * executing happens outside of lower level queues, with UI refreshed. | ||||
| * Should also allow multiwin solutions. | * Should also allow multiwin solutions. | ||||
| */ | */ | ||||
| void WM_event_add_fileselect(bContext *C, wmOperator *op) | void WM_event_add_fileselect(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| wmWindow *win = CTX_wm_window(C); | wmWindow *win = CTX_wm_window(C); | ||||
| /* If win is already a fileselect, attach to parent instead to prevent crash, | |||||
| * as win gets reused in window creation. */ | |||||
| if (CTX_wm_space_file(C)) { | |||||
| win = win->parent; | |||||
| } | |||||
campbellbarton: Checking the area type / number of areas isn't reliable.
It's possible to redo the crash with… | |||||
Not Done Inline ActionsFrom looking into applying this change it doesn't solve the bug in all cases. campbellbarton: From looking into applying this change it doesn't solve the bug in all cases. | |||||
| const bool is_temp_screen = WM_window_is_temp_screen(win); | const bool is_temp_screen = WM_window_is_temp_screen(win); | ||||
| /* Close any popups, like when opening a file browser from the splash. */ | /* Close any popups, like when opening a file browser from the splash. */ | ||||
| UI_popup_handlers_remove_all(C, &win->modalhandlers); | UI_popup_handlers_remove_all(C, &win->modalhandlers); | ||||
| if (!is_temp_screen) { | if (!is_temp_screen) { | ||||
| /* Only allow 1 file selector open per window. */ | /* Only allow 1 file selector open per window. */ | ||||
| LISTBASE_FOREACH_MUTABLE (wmEventHandler *, handler_base, &win->modalhandlers) { | LISTBASE_FOREACH_MUTABLE (wmEventHandler *, handler_base, &win->modalhandlers) { | ||||
| ▲ Show 20 Lines • Show All 1,728 Lines • Show Last 20 Lines | |||||
Checking the area type / number of areas isn't reliable.
It's possible to redo the crash with this patch applied by splitting the area of an open file-selector.
Suggest to keep selecting parent windows until the window doesn't have a temporary screen (ignoring the area type).