diff options
author | Matt Ebb <matt@mke3.net> | 2009-12-17 13:01:08 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-12-17 13:01:08 +0300 |
commit | 6c006b2ebbaa2d56f7dba0a036910138d864305e (patch) | |
tree | a3443b0f0eb096d3e5486e967bd43495309f817a | |
parent | 42c2cbdc671bef652e9c743590167bc04358063f (diff) |
Fix [#20397] Saving with F2 on multiple windows layout crashes
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 17 |
2 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 9c581527e4c..0c690452d8a 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1487,9 +1487,11 @@ ScrArea *ed_screen_fullarea(bContext *C, wmWindow *win, ScrArea *sa) oldscreen= win->screen; - /* is there only 1 area? */ + /* nothing wrong with having only 1 area, as far as I can see... + // is there only 1 area? if(oldscreen->areabase.first==oldscreen->areabase.last) return NULL; + */ oldscreen->full = SCREENFULL; BLI_snprintf(newname, sizeof(newname), "%s-%s", oldscreen->id.name+2, "temp"); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 710f9897c94..ccc020827c5 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -997,13 +997,24 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa case EVT_FILESELECT_OPEN: case EVT_FILESELECT_FULL_OPEN: { + ScrArea *sa; + + /* sa can be null when window A is active, but mouse is over window B */ + /* in this case, open file select in original window A */ + if (handler->op_area == NULL) { + bScreen *screen = CTX_wm_screen(C); + sa = (ScrArea *)screen->areabase.first; + } else + sa = handler->op_area; + if(event->val==EVT_FILESELECT_OPEN) - ED_area_newspace(C, handler->op_area, SPACE_FILE); + ED_area_newspace(C, sa, SPACE_FILE); else - ED_screen_full_newspace(C, handler->op_area, SPACE_FILE); + ED_screen_full_newspace(C, sa, SPACE_FILE); /* sets context */ /* settings for filebrowser, sfile is not operator owner but sends events */ - sfile= (SpaceFile*)CTX_wm_space_data(C); + sa = CTX_wm_area(C); + sfile= (SpaceFile*)sa->spacedata.first; sfile->op= handler->op; ED_fileselect_set_params(sfile); |