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.
This commit is contained in:
Rummskartoffel 2023-05-29 17:57:38 +02:00 committed by Jelle Raaijmakers
commit 47d1b45583
Notes: sideshowbarker 2024-07-17 04:32:07 +09:00

View file

@ -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) NotificationWindow::NotificationWindow(i32 client_id, DeprecatedString const& text, DeprecatedString const& title, Gfx::ShareableBitmap const& icon)
{ {
m_id = client_id; m_id = client_id;
s_windows.set(m_id, this);
set_window_type(GUI::WindowType::Notification); set_window_type(GUI::WindowType::Notification);
set_resizable(false); set_resizable(false);
@ -55,6 +54,8 @@ NotificationWindow::NotificationWindow(i32 client_id, DeprecatedString const& te
lowest_notification_rect_on_screen = window->m_original_rect; lowest_notification_rect_on_screen = window->m_original_rect;
} }
s_windows.set(m_id, this);
Gfx::IntRect rect; Gfx::IntRect rect;
rect.set_width(220); rect.set_width(220);
rect.set_height(40); rect.set_height(40);