From 59e10d52833a4af0f82fc978f04db52cc6dd35ff Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Thu, 17 Nov 2022 09:49:41 -0500 Subject: [PATCH] WindowServer: Don't compute title usernames for frameless Windows This was causing a slight delay when opening ComboBox ListViews. As an easy first optimization, don't bother computing this at all for frameless windows and those not type Normal. --- Userland/Services/WindowServer/Window.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp index 9b4183536f..caf052292c 100644 --- a/Userland/Services/WindowServer/Window.cpp +++ b/Userland/Services/WindowServer/Window.cpp @@ -110,8 +110,10 @@ Window::Window(ConnectionFromClient& client, WindowType window_type, WindowMode { if (parent_window) set_parent_window(*parent_window); - if (auto title_username_maybe = compute_title_username(&client); !title_username_maybe.is_error()) - m_title_username = title_username_maybe.release_value(); + if (!is_frameless() && type() == WindowType::Normal) { + if (auto title_username_maybe = compute_title_username(&client); !title_username_maybe.is_error()) + m_title_username = title_username_maybe.release_value(); + } WindowManager::the().add_window(*this); frame().window_was_constructed({}); }