From 47d1b45583ef14b7fe812660a13a94797c63dac8 Mon Sep 17 00:00:00 2001 From: Rummskartoffel Date: Mon, 29 May 2023 17:57:38 +0200 Subject: [PATCH] NotificationServer: Stop notifications showing in the top left at first Before this commit, notifications would appear in the top left of the screen when created, then move to the top right once hovered by the mouse. This happened because the first notification would use its own default-constructed position of 0,0 as a point of reference. --- Userland/Services/NotificationServer/NotificationWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Services/NotificationServer/NotificationWindow.cpp b/Userland/Services/NotificationServer/NotificationWindow.cpp index 90ba33116c..b9ae0d9b6a 100644 --- a/Userland/Services/NotificationServer/NotificationWindow.cpp +++ b/Userland/Services/NotificationServer/NotificationWindow.cpp @@ -41,7 +41,6 @@ static void update_notification_window_locations(Gfx::IntRect const& screen_rect NotificationWindow::NotificationWindow(i32 client_id, DeprecatedString const& text, DeprecatedString const& title, Gfx::ShareableBitmap const& icon) { m_id = client_id; - s_windows.set(m_id, this); set_window_type(GUI::WindowType::Notification); set_resizable(false); @@ -55,6 +54,8 @@ NotificationWindow::NotificationWindow(i32 client_id, DeprecatedString const& te lowest_notification_rect_on_screen = window->m_original_rect; } + s_windows.set(m_id, this); + Gfx::IntRect rect; rect.set_width(220); rect.set_height(40);