1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

WindowServer: Compute final window title before passing to WM clients

We were not substituting the window modified marker ("[*]") in the
title strings we were sending to WM clients. This caused the Taskbar
to show pre-substitution window titles for the Text Editor application.

This patch moves the window title resolution to Window::compute_title()
which is then used throughout.
This commit is contained in:
Andreas Kling 2021-05-10 00:00:40 +02:00
parent 1f24ab91f2
commit 353a831c8c
7 changed files with 21 additions and 20 deletions

View file

@ -185,7 +185,7 @@ void WindowSwitcher::draw()
Gfx::IntRect icon_rect = { thumbnail_rect.bottom_right().translated(-window.icon().width(), -window.icon().height()), { window.icon().width(), window.icon().height() } };
painter.fill_rect(icon_rect, palette.window());
painter.blit(icon_rect.location(), window.icon(), window.icon().rect());
painter.draw_text(item_rect.translated(thumbnail_width() + 12, 0), window.title(), WindowManager::the().window_title_font(), Gfx::TextAlignment::CenterLeft, text_color);
painter.draw_text(item_rect.translated(thumbnail_width() + 12, 0), window.computed_title(), WindowManager::the().window_title_font(), Gfx::TextAlignment::CenterLeft, text_color);
painter.draw_text(item_rect, window.rect().to_string(), Gfx::TextAlignment::CenterRight, rect_text_color);
}
}
@ -207,7 +207,7 @@ void WindowSwitcher::refresh()
if (window.is_frameless())
return IterationDecision::Continue;
++window_count;
longest_title_width = max(longest_title_width, wm.font().width(window.title()));
longest_title_width = max(longest_title_width, wm.font().width(window.computed_title()));
if (selected_window == &window)
m_selected_index = m_windows.size();
m_windows.append(window);