1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:18:12 +00:00

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
parent a2d8de180c
commit 47d1b45583

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)
{
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);