diff --git a/Servers/NotificationServer/NotificationWindow.cpp b/Servers/NotificationServer/NotificationWindow.cpp index 1fca0803de4..2bfb35d5de0 100644 --- a/Servers/NotificationServer/NotificationWindow.cpp +++ b/Servers/NotificationServer/NotificationWindow.cpp @@ -43,12 +43,24 @@ NotificationWindow::NotificationWindow(const String& text, const String& title) set_window_type(GUI::WindowType::Tooltip); + Gfx::Rect lowest_notification_rect_on_screen; + for (auto& window : s_windows) { + if (window->m_original_rect.y() > lowest_notification_rect_on_screen.y()) + lowest_notification_rect_on_screen = window->m_original_rect; + } + Gfx::Rect rect; rect.set_width(200); rect.set_height(40); rect.set_location(GUI::Desktop::the().rect().top_right().translated(-rect.width() - 8, 26)); + + if (!lowest_notification_rect_on_screen.is_null()) + rect.set_location(lowest_notification_rect_on_screen.bottom_left().translated(0, 8)); + set_rect(rect); + m_original_rect = rect; + auto widget = GUI::Widget::construct(); widget->set_fill_with_background_color(true); diff --git a/Servers/NotificationServer/NotificationWindow.h b/Servers/NotificationServer/NotificationWindow.h index 73f19e59b93..dd13a65f86d 100644 --- a/Servers/NotificationServer/NotificationWindow.h +++ b/Servers/NotificationServer/NotificationWindow.h @@ -38,6 +38,8 @@ public: private: NotificationWindow(const String& text, const String& title); + + Gfx::Rect m_original_rect; }; }