diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2021-09-09 19:26:44 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2021-09-09 19:26:44 +0300 |
commit | 84d03a1298c170a3cd61c8c7f9a0177da8fcfc35 (patch) | |
tree | e2a52c0a0849bdd9066da7bf9a8e084eedbd67e9 /source/blender/windowmanager/intern/wm_window.c | |
parent | 45c44a5b5b6251835cfd21f64c59ee23472941de (diff) |
Fix T88755: Reuse Temp Windows by Type not Title
Reuse temporary windows when they share the same single area type, not
because they share the same title.
See D12401 for more details.
Differential Revision: https://developer.blender.org/D12401
Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/windowmanager/intern/wm_window.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 004a845c667..0402b0d778a 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -808,16 +808,17 @@ wmWindow *WM_window_open(bContext *C, /* changes rect to fit within desktop */ wm_window_check_size(&rect); - /* Reuse temporary windows when they share the same title. */ + /* Reuse temporary windows when they share the same single area. */ wmWindow *win = NULL; if (temp) { LISTBASE_FOREACH (wmWindow *, win_iter, &wm->windows) { - if (WM_window_is_temp_screen(win_iter)) { - char *wintitle = GHOST_GetTitle(win_iter->ghostwin); - if (STREQ(title, wintitle)) { + const bScreen *screen = WM_window_get_active_screen(win_iter); + if (screen && screen->temp && BLI_listbase_is_single(&screen->areabase)) { + ScrArea *area = screen->areabase.first; + if (space_type == (area->butspacetype ? area->butspacetype : area->spacetype)) { win = win_iter; + break; } - free(wintitle); } } } |