Fix [#20397] Saving with F2 on multiple windows layout crashes

This commit is contained in:
Matt Ebb
2009-12-17 10:01:08 +00:00
parent 42c2cbdc67
commit 6c006b2ebb
2 changed files with 17 additions and 4 deletions

View File

@@ -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");

View File

@@ -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);