diff options
author | Julian Eisel <julian@blender.org> | 2022-05-10 13:27:04 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-05-10 13:36:43 +0300 |
commit | 7849b56c3c41c00af1008652936bda5ea5e3e175 (patch) | |
tree | 7264ca37151b2bc956246cd95abf01e28f7d7107 /source/blender/editors/space_file | |
parent | a74a267767706f57583ab1b3431f640570801784 (diff) |
Fix T88570: Crash when saving after pressing ctrl+S twice.
Existing code to replace the file operation was failing when done from
the window for the file operation itself.
Basically, this patch does two things:
- Implement a well defined window context to use as the "owner" or
"root" of the File Browser. This will be used for managing the File
Browser and to execute the file operation, even after the File Browser
was closed.
- Ensure the context is valid when dealing with file File Browser event
handlers.
Previously the window context just wasn't well defined and just happened
to work well enough in most cases. Addressing this may unveil further
issues, see T88570#1355740.
Differential Revision: https://developer.blender.org/D13441
Reviewed by: Campbell Barton
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 011506368ee..ce36e3e4e4f 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -1364,3 +1364,21 @@ ScrArea *ED_fileselect_handler_area_find(const wmWindow *win, const wmOperator * return NULL; } + +ScrArea *ED_fileselect_handler_area_find_any_with_op(const wmWindow *win) +{ + const bScreen *screen = WM_window_get_active_screen(win); + + ED_screen_areas_iter (win, screen, area) { + if (area->spacetype != SPACE_FILE) { + continue; + } + + const SpaceFile *sfile = area->spacedata.first; + if (sfile->op) { + return area; + } + } + + return NULL; +} |