Skip to content

Commit 95805c0

Browse files
committed
WindowServer: Give the desktop window the whole exact desktop rect
1 parent 3d31f2e commit 95805c0

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Servers/WindowServer/ClientConnection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ OwnPtr<Messages::WindowServer::CreateWindowResponse> ClientConnection::handle(co
447447
if (!message.fullscreen())
448448
window->set_rect(message.rect());
449449
if (window->type() == WindowType::Desktop) {
450-
window->set_rect(Screen::the().rect());
450+
window->set_rect(WindowManager::the().desktop_rect());
451451
window->recalculate_rect();
452452
}
453453
window->set_show_titlebar(message.show_titlebar());

Servers/WindowServer/WindowManager.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,18 @@ Gfx::Rect WindowManager::menubar_rect() const
936936
return MenuManager::the().menubar_rect();
937937
}
938938

939+
Gfx::Rect WindowManager::desktop_rect() const
940+
{
941+
if (active_fullscreen_window())
942+
return {};
943+
return {
944+
0,
945+
menubar_rect().bottom() + 1,
946+
Screen::the().width(),
947+
Screen::the().height() - menubar_rect().height() - 28
948+
};
949+
}
950+
939951
void WindowManager::event(Core::Event& event)
940952
{
941953
if (static_cast<Event&>(event).is_mouse_event()) {

Servers/WindowServer/WindowManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class WindowManager : public Core::Object {
119119
void move_to_front_and_make_active(Window&);
120120

121121
Gfx::Rect menubar_rect() const;
122+
Gfx::Rect desktop_rect() const;
122123

123124
const Cursor& active_cursor() const;
124125
const Cursor& arrow_cursor() const { return *m_arrow_cursor; }

0 commit comments

Comments
 (0)