From 84d03a1298c170a3cd61c8c7f9a0177da8fcfc35 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Thu, 9 Sep 2021 09:26:44 -0700 Subject: 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 --- source/blender/windowmanager/intern/wm_window.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source') 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); } } } -- cgit v1.2.3