diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-06 04:42:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-06 04:42:36 +0400 |
commit | e4bb5403d39dc8227d3a186f513981f090af3017 (patch) | |
tree | 8c465bd6b3e2cf5f73e66ac9d4bfa851a45216b0 /source/blender/windowmanager/intern | |
parent | 7da45bcbcbda60fe1affa811f629e3e4b82cce1f (diff) |
fix for crash opening the file selector twice with multiple windows open (when the mouse was over the inactive window).
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 615259bda15..7bd5fd7e7df 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1289,16 +1289,23 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa if (handler->op_area == NULL) { bScreen *screen = CTX_wm_screen(C); sa = (ScrArea *)screen->areabase.first; - } else + } + else { sa = handler->op_area; + } - if(event->val==EVT_FILESELECT_OPEN) - ED_area_newspace(C, sa, SPACE_FILE); - else - ED_screen_full_newspace(C, sa, SPACE_FILE); /* sets context */ - + if(event->val==EVT_FILESELECT_OPEN) { + ED_area_newspace(C, sa, SPACE_FILE); /* 'sa' is modified in-place */ + } + else { + sa= ED_screen_full_newspace(C, sa, SPACE_FILE); /* sets context */ + } + + /* note, getting the 'sa' back from the context causes a nasty bug where the newly created + * 'sa' != CTX_wm_area(C). removed the line below and set 'sa' in the 'if' above */ + /* sa = CTX_wm_area(C); */ + /* settings for filebrowser, sfile is not operator owner but sends events */ - sa = CTX_wm_area(C); sfile= (SpaceFile*)sa->spacedata.first; sfile->op= handler->op; |