1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +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

@ -1002,4 +1002,13 @@ void Window::set_modified(bool modified)
frame().invalidate_titlebar();
}
String Window::computed_title() const
{
String title = m_title;
title.replace("[*]", is_modified() ? " (*)" : "");
if (client() && client()->is_unresponsive())
return String::formatted("{} (Not responding)", title);
return title;
}
}