mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:08:10 +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:
parent
aa56f9a1e0
commit
c8ef8d2db5
3 changed files with 24 additions and 8 deletions
|
@ -36,7 +36,9 @@
|
|||
#include <LibGUI/ActionGroup.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/WindowManagerServerConnection.h>
|
||||
#include <LibGUI/WindowServerConnection.h>
|
||||
#include <WindowServer/Window.h>
|
||||
#include <serenity.h>
|
||||
#include <signal.h>
|
||||
#include <spawn.h>
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue