summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Servers/WindowServer/ClientConnection.cpp2
-rw-r--r--Servers/WindowServer/WindowManager.cpp12
-rw-r--r--Servers/WindowServer/WindowManager.h1
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; }