diff options
author | Ton Roosendaal <ton@blender.org> | 2011-02-23 18:52:05 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-02-23 18:52:05 +0300 |
commit | 962a4386bc12a7b560c8273ab764ac2d4ab42f79 (patch) | |
tree | e5527cc3f2092530eb547ed2aaf8dca7d22ad176 /source | |
parent | 4fe21e0b4f44e1fcf87b36c8d27da11340998b4c (diff) |
Bugfix #26188
Having 2 or more windows open, a render in another window made the
other (active) window fail badly on F11 key (show render).
Now things should go smoothly. If a render is being shown in
inactive windows, they get popped to the front nicely.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 7d5fb8ed7fa..52280fa8e6a 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -68,7 +68,7 @@ static ScrArea *biggest_area(bContext *C); static ScrArea *biggest_non_image_area(bContext *C); -static ScrArea *find_area_showing_r_result(bContext *C); +static ScrArea *find_area_showing_r_result(bContext *C, wmWindow **win); static ScrArea *find_area_image_empty(bContext *C); /* called inside thread! */ @@ -232,9 +232,13 @@ void screen_set_image_output(bContext *C, int mx, int my) } if(!sa) { - sa= find_area_showing_r_result(C); + sa= find_area_showing_r_result(C, &win); if(sa==NULL) sa= find_area_image_empty(C); + + /* if area found in other window, we make that one show in front */ + if(win && win!=CTX_wm_window(C)) + wm_window_raise(win); if(sa==NULL) { /* find largest open non-image area */ @@ -336,16 +340,15 @@ static ScrArea *biggest_area(bContext *C) } -static ScrArea *find_area_showing_r_result(bContext *C) +static ScrArea *find_area_showing_r_result(bContext *C, wmWindow **win) { wmWindowManager *wm= CTX_wm_manager(C); - wmWindow *win; ScrArea *sa = NULL; SpaceImage *sima; /* find an imagewindow showing render result */ - for(win=wm->windows.first; win; win=win->next) { - for(sa=win->screen->areabase.first; sa; sa= sa->next) { + for(*win=wm->windows.first; *win; *win= (*win)->next) { + for(sa= (*win)->screen->areabase.first; sa; sa= sa->next) { if(sa->spacetype==SPACE_IMAGE) { sima= sa->spacedata.first; if(sima->image && sima->image->type==IMA_TYPE_R_RESULT) @@ -355,7 +358,7 @@ static ScrArea *find_area_showing_r_result(bContext *C) if(sa) break; } - + return sa; } @@ -862,18 +865,19 @@ void RENDER_OT_view_cancel(struct wmOperatorType *ot) static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(unused), wmEvent *event) { - ScrArea *sa= find_area_showing_r_result(C); - - /* test if we have a temp screen active */ - if(CTX_wm_window(C)->screen->temp) { - wm_window_lower(CTX_wm_window(C)); + wmWindow *wincur = CTX_wm_window(C); + + /* test if we have currently a temp screen active */ + if(wincur->screen->temp) { + wm_window_lower(wincur); } else { - /* is there another window? */ - wmWindow *win; + wmWindow *win, *winshow; + ScrArea *sa= find_area_showing_r_result(C, &winshow); + /* is there another window showing result? */ for(win= CTX_wm_manager(C)->windows.first; win; win= win->next) { - if(win->screen->temp) { + if(win->screen->temp || (win==winshow && winshow!=wincur)) { wm_window_raise(win); return OPERATOR_FINISHED; } |