1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 01:58:12 +00:00

WindowServer: Give the desktop window the whole exact desktop rect

This commit is contained in:
Andreas Kling 2020-04-18 21:18:11 +02:00
parent 3d31f2e44b
commit 95805c0e56
3 changed files with 14 additions and 1 deletions

View file

@ -447,7 +447,7 @@ OwnPtr<Messages::WindowServer::CreateWindowResponse> ClientConnection::handle(co
if (!message.fullscreen()) if (!message.fullscreen())
window->set_rect(message.rect()); window->set_rect(message.rect());
if (window->type() == WindowType::Desktop) { if (window->type() == WindowType::Desktop) {
window->set_rect(Screen::the().rect()); window->set_rect(WindowManager::the().desktop_rect());
window->recalculate_rect(); window->recalculate_rect();
} }
window->set_show_titlebar(message.show_titlebar()); window->set_show_titlebar(message.show_titlebar());

View file

@ -936,6 +936,18 @@ Gfx::Rect WindowManager::menubar_rect() const
return MenuManager::the().menubar_rect(); 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) void WindowManager::event(Core::Event& event)
{ {
if (static_cast<Event&>(event).is_mouse_event()) { if (static_cast<Event&>(event).is_mouse_event()) {

View file

@ -119,6 +119,7 @@ public:
void move_to_front_and_make_active(Window&); void move_to_front_and_make_active(Window&);
Gfx::Rect menubar_rect() const; Gfx::Rect menubar_rect() const;
Gfx::Rect desktop_rect() const;
const Cursor& active_cursor() const; const Cursor& active_cursor() const;
const Cursor& arrow_cursor() const { return *m_arrow_cursor; } const Cursor& arrow_cursor() const { return *m_arrow_cursor; }