1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 15:07:45 +00:00

Taskbar: Use WM connection for window management operations

Since WM operations are moved to a separate endpoint pair, Taskbar now
uses those to perform window management related operations.
Additionally, it now explicitly declares to WindowServer that it is a
window manager.
This commit is contained in:
sin-ack 2021-04-14 21:39:08 +00:00 committed by Andreas Kling
parent aa56f9a1e0
commit c8ef8d2db5
3 changed files with 24 additions and 8 deletions

View file

@ -39,6 +39,7 @@
#include <LibGUI/Menu.h>
#include <LibGUI/Painter.h>
#include <LibGUI/Window.h>
#include <LibGUI/WindowManagerServerConnection.h>
#include <LibGUI/WindowServerConnection.h>
#include <LibGfx/FontDatabase.h>
#include <LibGfx/Palette.h>
@ -182,7 +183,7 @@ void TaskbarWindow::update_applet_area()
main_widget()->do_layout();
Gfx::IntRect new_rect { {}, m_applet_area_size };
new_rect.center_within(m_applet_area_container->screen_relative_rect());
GUI::WindowServerConnection::the().send_sync<Messages::WindowServer::WM_SetAppletAreaPosition>(new_rect.location());
GUI::WindowManagerServerConnection::the().send_sync<Messages::WindowManagerServer::SetAppletAreaPosition>(new_rect.location());
}
NonnullRefPtr<GUI::Button> TaskbarWindow::create_button(const WindowIdentifier& identifier)
@ -209,9 +210,9 @@ void TaskbarWindow::add_window_button(::Window& window, const WindowIdentifier&
// false because window is the modal window's owner (which is not
// active)
if (window->is_minimized() || !button->is_checked()) {
GUI::WindowServerConnection::the().post_message(Messages::WindowServer::WM_SetActiveWindow(identifier.client_id(), identifier.window_id()));
GUI::WindowManagerServerConnection::the().post_message(Messages::WindowManagerServer::SetActiveWindow(identifier.client_id(), identifier.window_id()));
} else {
GUI::WindowServerConnection::the().post_message(Messages::WindowServer::WM_SetWindowMinimized(identifier.client_id(), identifier.window_id(), true));
GUI::WindowManagerServerConnection::the().post_message(Messages::WindowManagerServer::SetWindowMinimized(identifier.client_id(), identifier.window_id(), true));
}
};
}