1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-22 18:12:08 +00:00

WindowServer: Port to socket takeover

This commit is contained in:
Sergey Bugaev 2019-11-26 19:30:35 +03:00 committed by Andreas Kling
parent c9e21b2bcc
commit 22a05621d5
3 changed files with 4 additions and 3 deletions

View file

@ -15,6 +15,7 @@ KeepAlive=1
User=anon User=anon
[WindowServer] [WindowServer]
Socket=/tmp/portal/window
Priority=high Priority=high
KeepAlive=1 KeepAlive=1
User=anon User=anon

View file

@ -14,7 +14,7 @@ class GWindowServerConnection : public IPC::Client::Connection<WSAPI_ServerMessa
C_OBJECT(GWindowServerConnection) C_OBJECT(GWindowServerConnection)
public: public:
GWindowServerConnection() GWindowServerConnection()
: Connection("/tmp/wsportal") : Connection("/tmp/portal/window")
{} {}
void handshake() override; void handshake() override;

View file

@ -27,8 +27,8 @@ WSEventLoop::WSEventLoop()
m_keyboard_fd = open("/dev/keyboard", O_RDONLY | O_NONBLOCK | O_CLOEXEC); m_keyboard_fd = open("/dev/keyboard", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
m_mouse_fd = open("/dev/psaux", O_RDONLY | O_NONBLOCK | O_CLOEXEC); m_mouse_fd = open("/dev/psaux", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
unlink("/tmp/wsportal"); bool ok = m_server->take_over_from_system_server();
m_server->listen("/tmp/wsportal"); ASSERT(ok);
m_server->on_ready_to_accept = [this] { m_server->on_ready_to_accept = [this] {
auto client_socket = m_server->accept(); auto client_socket = m_server->accept();