diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-18 21:18:11 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-18 21:18:11 +0200 |
commit | 95805c0e56d8b15c93a6bbc91948a37f7fcb7bd7 (patch) | |
tree | 944171931189f4483e6d999e17f262564e73682b /Servers/WindowServer | |
parent | 3d31f2e44bdbfd1ff5a369d9bc7a437a1342e0bf (diff) | |
download | serenity-95805c0e56d8b15c93a6bbc91948a37f7fcb7bd7.zip |
WindowServer: Give the desktop window the whole exact desktop rect
Diffstat (limited to 'Servers/WindowServer')
-rw-r--r-- | Servers/WindowServer/ClientConnection.cpp | 2 | ||||
-rw-r--r-- | Servers/WindowServer/WindowManager.cpp | 12 | ||||
-rw-r--r-- | Servers/WindowServer/WindowManager.h | 1 |
3 files changed, 14 insertions, 1 deletions
diff --git a/Servers/WindowServer/ClientConnection.cpp b/Servers/WindowServer/ClientConnection.cpp index 9047a1acc5..03663d5ff1 100644 --- a/Servers/WindowServer/ClientConnection.cpp +++ b/Servers/WindowServer/ClientConnection.cpp @@ -447,7 +447,7 @@ OwnPtr<Messages::WindowServer::CreateWindowResponse> ClientConnection::handle(co if (!message.fullscreen()) window->set_rect(message.rect()); if (window->type() == WindowType::Desktop) { - window->set_rect(Screen::the().rect()); + window->set_rect(WindowManager::the().desktop_rect()); window->recalculate_rect(); } window->set_show_titlebar(message.show_titlebar()); diff --git a/Servers/WindowServer/WindowManager.cpp b/Servers/WindowServer/WindowManager.cpp index 8af7132dc5..c32b76b9f8 100644 --- a/Servers/WindowServer/WindowManager.cpp +++ b/Servers/WindowServer/WindowManager.cpp @@ -936,6 +936,18 @@ Gfx::Rect WindowManager::menubar_rect() const return MenuManager::the().menubar_rect(); } +Gfx::Rect WindowManager::desktop_rect() const +{ + if (active_fullscreen_window()) + return {}; + return { + 0, + menubar_rect().bottom() + 1, + Screen::the().width(), + Screen::the().height() - menubar_rect().height() - 28 + }; +} + void WindowManager::event(Core::Event& event) { if (static_cast<Event&>(event).is_mouse_event()) { diff --git a/Servers/WindowServer/WindowManager.h b/Servers/WindowServer/WindowManager.h index 717f8fccc9..945f555f0c 100644 --- a/Servers/WindowServer/WindowManager.h +++ b/Servers/WindowServer/WindowManager.h @@ -119,6 +119,7 @@ public: void move_to_front_and_make_active(Window&); Gfx::Rect menubar_rect() const; + Gfx::Rect desktop_rect() const; const Cursor& active_cursor() const; const Cursor& arrow_cursor() const { return *m_arrow_cursor; } |