mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
NotificationServer: Reposition notifications on screen resolution change
Previously notifications were (partially) drawn outside the screen rect if they were created before changing the screen resolution to smaller dimensions. This prevented the user from dismissing the notification as the close button was no longer clickable.
This commit is contained in:
parent
2caf4e66ea
commit
fc2c5c373b
Notes:
sideshowbarker
2024-07-19 00:11:31 +09:00
Author: https://github.com/silvasur 🔰
Commit: fc2c5c373b
Pull-request: https://github.com/SerenityOS/serenity/pull/4752
3 changed files with 7 additions and 1 deletions
|
@ -41,7 +41,7 @@ namespace NotificationServer {
|
|||
|
||||
static Vector<RefPtr<NotificationWindow>> s_windows;
|
||||
|
||||
static void update_notification_window_locations()
|
||||
void update_notification_window_locations()
|
||||
{
|
||||
Gfx::IntRect last_window_rect;
|
||||
for (auto& window : s_windows) {
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
|
||||
namespace NotificationServer {
|
||||
|
||||
void update_notification_window_locations();
|
||||
|
||||
class NotificationWindow final : public GUI::Window {
|
||||
C_OBJECT(NotificationWindow);
|
||||
|
||||
|
|
|
@ -25,8 +25,10 @@
|
|||
*/
|
||||
|
||||
#include "ClientConnection.h"
|
||||
#include "NotificationWindow.h"
|
||||
#include <LibCore/LocalServer.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Desktop.h>
|
||||
#include <LibGUI/WindowServerConnection.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
@ -66,5 +68,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
GUI::Desktop::the().on_rect_change = [](auto&) { NotificationServer::update_notification_window_locations(); };
|
||||
|
||||
return app->exec();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue