diff --git a/Userland/Services/Taskbar/TaskbarButton.cpp b/Userland/Services/Taskbar/TaskbarButton.cpp index 4cba622826..9149ffb3f2 100644 --- a/Userland/Services/Taskbar/TaskbarButton.cpp +++ b/Userland/Services/Taskbar/TaskbarButton.cpp @@ -28,6 +28,7 @@ #include "WindowList.h" #include #include +#include #include #include #include @@ -45,13 +46,17 @@ TaskbarButton::~TaskbarButton() void TaskbarButton::context_menu_event(GUI::ContextMenuEvent&) { - GUI::WindowServerConnection::the().post_message(Messages::WindowServer::WM_PopupWindowMenu(m_identifier.client_id(), m_identifier.window_id(), screen_relative_rect().location())); + GUI::WindowManagerServerConnection::the().post_message( + Messages::WindowManagerServer::PopupWindowMenu( + m_identifier.client_id(), + m_identifier.window_id(), + screen_relative_rect().location())); } void TaskbarButton::update_taskbar_rect() { - GUI::WindowServerConnection::the().post_message( - Messages::WindowServer::WM_SetWindowTaskbarRect( + GUI::WindowManagerServerConnection::the().post_message( + Messages::WindowManagerServer::SetWindowTaskbarRect( m_identifier.client_id(), m_identifier.window_id(), screen_relative_rect())); @@ -59,8 +64,8 @@ void TaskbarButton::update_taskbar_rect() void TaskbarButton::clear_taskbar_rect() { - GUI::WindowServerConnection::the().post_message( - Messages::WindowServer::WM_SetWindowTaskbarRect( + GUI::WindowManagerServerConnection::the().post_message( + Messages::WindowManagerServer::SetWindowTaskbarRect( m_identifier.client_id(), m_identifier.window_id(), {})); diff --git a/Userland/Services/Taskbar/TaskbarWindow.cpp b/Userland/Services/Taskbar/TaskbarWindow.cpp index 6e4abd1afe..140762469a 100644 --- a/Userland/Services/Taskbar/TaskbarWindow.cpp +++ b/Userland/Services/Taskbar/TaskbarWindow.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -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(new_rect.location()); + GUI::WindowManagerServerConnection::the().send_sync(new_rect.location()); } NonnullRefPtr 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)); } }; } diff --git a/Userland/Services/Taskbar/main.cpp b/Userland/Services/Taskbar/main.cpp index bc16386134..58a9fbcb7d 100644 --- a/Userland/Services/Taskbar/main.cpp +++ b/Userland/Services/Taskbar/main.cpp @@ -36,7 +36,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -61,6 +63,9 @@ int main(int argc, char** argv) ; }); + // We need to obtain the WM connection here as well before the pledge shortening. + GUI::WindowManagerServerConnection::the(); + if (pledge("stdio recvfd sendfd accept proc exec rpath", nullptr) < 0) { perror("pledge"); return 1; @@ -72,6 +77,11 @@ int main(int argc, char** argv) auto window = TaskbarWindow::construct(move(menu)); window->show(); + window->make_window_manager( + WindowServer::WMEventMask::WindowStateChanges + | WindowServer::WMEventMask::WindowRemovals + | WindowServer::WMEventMask::WindowIconChanges); + return app->exec(); }