From 6b21fa65f3976b1df59b6780d2330a2052e46ad7 Mon Sep 17 00:00:00 2001 From: Ali Mirjamali Date: Sun, 27 Oct 2024 15:57:04 +0330 Subject: [PATCH] Document global clipboard for GUI protocol 1.8 According to: https://github.com/QubesOS/qubes-gui-daemon/pull/150#issuecomment-2431883322 According to: https://github.com/QubesOS/qubes-gui-daemon/pull/150#issuecomment-2432486669 --- developer/system/gui.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/developer/system/gui.md b/developer/system/gui.md index dfd04801..6de31dc7 100644 --- a/developer/system/gui.md +++ b/developer/system/gui.md @@ -90,9 +90,10 @@ Clipboard sharing implementation Certainly, it would be insecure to allow AppVM to read/write the clipboards of other AppVMs unconditionally. Therefore, the following mechanism is used: -- there is a "qubes clipboard" in dom0 - its contents are stored in a regular file in dom0. +- there is a "qubes clipboard" in dom0 - its contents are stored in a regular file in dom0 as `/run/qubes/qubes-clipboard.bin`. - if the user wants to copy local AppVM clipboard to qubes clipboard, she must focus on any window belonging to this AppVM, and press **Ctrl-Shift-C**. This combination is trapped by `qubes-guid`, and `CLIPBOARD_REQ` message is sent to AppVM. `qubes-gui` responds with `CLIPBOARD_DATA` message followed by clipboard contents. - the user focuses on other AppVM window, presses **Ctrl-Shift-V**. This combination is trapped by `qubes-guid`, and `CLIPBOARD_DATA` message followed by qubes clipboard contents is sent to AppVM; `qubes-gui` copies data to the local clipboard, and then user can paste its contents to local applications normally. +- a supplementary JSON metadata file will be saved as `/run/qubes/qubes-clipboard.bin.metadata` on global clipboard copy or paste actions. Explanation of each field is available in `xside.h` header file of `qubes-guid` under `clipboard_metadata` structure. While the output from `qubes-guid` is fully JSON compatible, the `qubes-guid` parser is limited. It expects line breaks after each key-value pair and only one key-value pair per line. Opening and closing curly braces should be on their own lines. There should be no leading white-space. This way, the user can quickly copy clipboards between AppVMs. This action is fully controlled by the user, it cannot be triggered/forced by any AppVM.