diff options
author | Timothy <timmot@users.noreply.github.com> | 2021-07-13 00:25:47 +1000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-18 17:21:28 +0200 |
commit | 522f6775a7240888dc4d5d0a872717cad10d6400 (patch) | |
tree | 934e5c404f82318b86d700d7744ab4317d57034f | |
parent | 7791f7b9e62f403e439de5a933cf1c2b6cd69ec6 (diff) | |
download | serenity-522f6775a7240888dc4d5d0a872717cad10d6400.zip |
LibGUI+WindowServer: Expose WindowServer client id to the client
This allows an WindowServer client to identify itself and allow future
cross-client functionality in WindowServer.
4 files changed, 7 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGUI/WindowServerConnection.cpp b/Userland/Libraries/LibGUI/WindowServerConnection.cpp index b05133e902..03e70e94a2 100644 --- a/Userland/Libraries/LibGUI/WindowServerConnection.cpp +++ b/Userland/Libraries/LibGUI/WindowServerConnection.cpp @@ -51,9 +51,10 @@ WindowServerConnection::WindowServerConnection() Desktop::the().did_receive_screen_rects({}, message->screen_rects(), message->main_screen_index(), message->virtual_desktop_rows(), message->virtual_desktop_columns()); Gfx::FontDatabase::set_default_font_query(message->default_font_query()); Gfx::FontDatabase::set_fixed_width_font_query(message->fixed_width_font_query()); + m_client_id = message->client_id(); } -void WindowServerConnection::fast_greet(Vector<Gfx::IntRect> const&, u32, u32, u32, Core::AnonymousBuffer const&, String const&, String const&) +void WindowServerConnection::fast_greet(Vector<Gfx::IntRect> const&, u32, u32, u32, Core::AnonymousBuffer const&, String const&, String const&, i32) { // NOTE: This message is handled in the constructor. } diff --git a/Userland/Libraries/LibGUI/WindowServerConnection.h b/Userland/Libraries/LibGUI/WindowServerConnection.h index d68aa7aad2..91a5bbc195 100644 --- a/Userland/Libraries/LibGUI/WindowServerConnection.h +++ b/Userland/Libraries/LibGUI/WindowServerConnection.h @@ -19,11 +19,12 @@ class WindowServerConnection final C_OBJECT(WindowServerConnection) public: static WindowServerConnection& the(); + i32 expose_client_id() { return m_client_id; } private: WindowServerConnection(); - virtual void fast_greet(Vector<Gfx::IntRect> const&, u32, u32, u32, Core::AnonymousBuffer const&, String const&, String const&) override; + virtual void fast_greet(Vector<Gfx::IntRect> const&, u32, u32, u32, Core::AnonymousBuffer const&, String const&, String const&, i32) override; virtual void paint(i32, Gfx::IntSize const&, Vector<Gfx::IntRect> const&) override; virtual void mouse_move(i32, Gfx::IntPoint const&, u32, u32, u32, i32, bool, Vector<String> const&) override; virtual void mouse_down(i32, Gfx::IntPoint const&, u32, u32, u32, i32) override; @@ -56,6 +57,7 @@ private: virtual void ping() override; bool m_display_link_notification_pending { false }; + i32 m_client_id; }; } diff --git a/Userland/Services/WindowServer/ClientConnection.cpp b/Userland/Services/WindowServer/ClientConnection.cpp index b8ef0bb5f5..040776a4a1 100644 --- a/Userland/Services/WindowServer/ClientConnection.cpp +++ b/Userland/Services/WindowServer/ClientConnection.cpp @@ -54,7 +54,7 @@ ClientConnection::ClientConnection(NonnullRefPtr<Core::LocalSocket> client_socke s_connections->set(client_id, *this); auto& wm = WindowManager::the(); - async_fast_greet(Screen::rects(), Screen::main().index(), wm.window_stack_rows(), wm.window_stack_columns(), Gfx::current_system_theme_buffer(), Gfx::FontDatabase::default_font_query(), Gfx::FontDatabase::fixed_width_font_query()); + async_fast_greet(Screen::rects(), Screen::main().index(), wm.window_stack_rows(), wm.window_stack_columns(), Gfx::current_system_theme_buffer(), Gfx::FontDatabase::default_font_query(), Gfx::FontDatabase::fixed_width_font_query(), client_id); } ClientConnection::~ClientConnection() diff --git a/Userland/Services/WindowServer/WindowClient.ipc b/Userland/Services/WindowServer/WindowClient.ipc index 9971f82198..61b9911316 100644 --- a/Userland/Services/WindowServer/WindowClient.ipc +++ b/Userland/Services/WindowServer/WindowClient.ipc @@ -3,7 +3,7 @@ endpoint WindowClient { - fast_greet(Vector<Gfx::IntRect> screen_rects, u32 main_screen_index, u32 virtual_desktop_rows, u32 virtual_desktop_columns, Core::AnonymousBuffer theme_buffer, String default_font_query, String fixed_width_font_query) =| + fast_greet(Vector<Gfx::IntRect> screen_rects, u32 main_screen_index, u32 virtual_desktop_rows, u32 virtual_desktop_columns, Core::AnonymousBuffer theme_buffer, String default_font_query, String fixed_width_font_query, i32 client_id) =| paint(i32 window_id, Gfx::IntSize window_size, Vector<Gfx::IntRect> rects) =| mouse_move(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta, bool is_drag, Vector<String> mime_types) =| |