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
commit 353a831c8c
Notes: sideshowbarker 2024-07-18 18:24:23 +09:00
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;
}
}