- 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); */
+