From 2eceabdcfd0ad20ace98d723ec3fcaac801ade32 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 23 May 2021 09:42:38 +0200 Subject: [PATCH] LibGUI: Handle fast_greet stuff in WindowServerConnection constructor Move the from handshake() to the constructor (and move the constructor out-of-line while we're at it.) This prepares getting rid of the handshake() mechanism since this is the only remaining user. --- Userland/Libraries/LibGUI/WindowServerConnection.cpp | 3 ++- Userland/Libraries/LibGUI/WindowServerConnection.h | 10 +++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Userland/Libraries/LibGUI/WindowServerConnection.cpp b/Userland/Libraries/LibGUI/WindowServerConnection.cpp index 4b4e699d077..b61ffaca8cf 100644 --- a/Userland/Libraries/LibGUI/WindowServerConnection.cpp +++ b/Userland/Libraries/LibGUI/WindowServerConnection.cpp @@ -41,7 +41,8 @@ static void set_system_theme_from_anonymous_buffer(Core::AnonymousBuffer buffer) Application::the()->set_system_palette(buffer); } -void WindowServerConnection::handshake() +WindowServerConnection::WindowServerConnection() + : IPC::ServerConnection(*this, "/tmp/portal/window") { // NOTE: WindowServer automatically sends a "fast_greet" message to us when we connect. // All we have to do is wait for it to arrive. This avoids a round-trip during application startup. diff --git a/Userland/Libraries/LibGUI/WindowServerConnection.h b/Userland/Libraries/LibGUI/WindowServerConnection.h index 6c7e4d2d5c8..7faba6c266c 100644 --- a/Userland/Libraries/LibGUI/WindowServerConnection.h +++ b/Userland/Libraries/LibGUI/WindowServerConnection.h @@ -17,16 +17,12 @@ class WindowServerConnection , public WindowClientEndpoint { C_OBJECT(WindowServerConnection) public: - WindowServerConnection() - : IPC::ServerConnection(*this, "/tmp/portal/window") - { - handshake(); - } - - virtual void handshake() override; + virtual void handshake() override { } static WindowServerConnection& the(); private: + WindowServerConnection(); + virtual void fast_greet(Gfx::IntRect const&, Core::AnonymousBuffer const&, String const&, String const&) override; virtual void paint(i32, Gfx::IntSize const&, Vector const&) override; virtual void mouse_move(i32, Gfx::IntPoint const&, u32, u32, u32, i32, bool, Vector const&) override;