1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:47:45 +00:00

Clipboard: Move the system clipboard to a dedicated service process :^)

This commit moves the clipboard from WindowServer into a new Clipboard
service program. Clipboard runs as the unprivileged "clipboard" user
and with a much tighter pledge than WindowServer.

To keep things working as before, all GUI::Application users now make
a connection to Clipboard after making the connection to WindowServer.
It could be interesting to connect to Clipboard on demand, but right
now that would necessitate expanding every GUI app's pledge to include
"unix" and also unveiling the clipboard portal, which I prefer not to.
This commit is contained in:
Andreas Kling 2020-05-14 22:51:15 +02:00
parent f4c60740bd
commit 244efe050a
25 changed files with 447 additions and 146 deletions

View file

@ -63,7 +63,6 @@ public:
bool is_showing_modal_window() const;
void notify_about_new_screen_rect(const Gfx::Rect&);
void notify_about_clipboard_contents_changed();
void post_paint_message(Window&, bool ignore_occlusion = false);
Menu* find_menu_by_id(int menu_id)
@ -102,8 +101,6 @@ private:
virtual OwnPtr<Messages::WindowServer::SetGlobalCursorTrackingResponse> handle(const Messages::WindowServer::SetGlobalCursorTracking&) override;
virtual OwnPtr<Messages::WindowServer::SetWindowOpacityResponse> handle(const Messages::WindowServer::SetWindowOpacity&) override;
virtual OwnPtr<Messages::WindowServer::SetWindowBackingStoreResponse> handle(const Messages::WindowServer::SetWindowBackingStore&) override;
virtual OwnPtr<Messages::WindowServer::GetClipboardContentsResponse> handle(const Messages::WindowServer::GetClipboardContents&) override;
virtual OwnPtr<Messages::WindowServer::SetClipboardContentsResponse> handle(const Messages::WindowServer::SetClipboardContents&) override;
virtual void handle(const Messages::WindowServer::WM_SetActiveWindow&) override;
virtual void handle(const Messages::WindowServer::WM_SetWindowMinimized&) override;
virtual void handle(const Messages::WindowServer::WM_StartWindowResize&) override;
@ -141,8 +138,6 @@ private:
int m_next_window_id { 1982 };
bool m_has_display_link { false };
RefPtr<SharedBuffer> m_last_sent_clipboard_content;
};
}