From 7423e33184dcb2df1a29d21d1403767645304416 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sun, 27 Sep 2026 13:12:08 +0800 Subject: [PATCH] fix(remote-desktop): stop unsolicited clipboard read prompts (#1482) * fix(remote-desktop): read clipboard only on explicit paste * test(css): exercise the configured PostCSS plugin chain * test(identity): preserve full Ed25519 public keys in fixtures * test(remote-desktop): always mutate ciphertext in tamper test --- .../src/frontend/GuacamoleDisplay.tsx | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/plugins/remote-desktop/src/frontend/GuacamoleDisplay.tsx b/plugins/remote-desktop/src/frontend/GuacamoleDisplay.tsx index ed09526b7..719b69c7c 100644 --- a/plugins/remote-desktop/src/frontend/GuacamoleDisplay.tsx +++ b/plugins/remote-desktop/src/frontend/GuacamoleDisplay.tsx @@ -815,28 +815,6 @@ export const GuacamoleDisplay = forwardRef< rescaleDisplay, ]); - const syncClipboard = useCallback(() => { - const client = clientRef.current; - if (!client || !navigator.clipboard?.readText) return; - navigator.clipboard - .readText() - .then((text) => { - if (text) { - const stream = client.createClipboardStream("text/plain"); - const writer = new Guacamole.StringWriter(stream); - writer.sendText(text); - writer.sendEnd(); - } - }) - .catch(() => {}); - }, []); - - useEffect(() => { - if (isVisible && isReady) { - syncClipboard(); - } - }, [isVisible, isReady, syncClipboard]); - useEffect(() => { const container = containerRef.current; const protocol = connectionConfig.protocol ?? connectionConfig.type; @@ -882,18 +860,6 @@ export const GuacamoleDisplay = forwardRef< }; }, [applyZoom, connectionConfig.protocol, connectionConfig.type, isReady]); - useEffect(() => { - const container = containerRef.current; - if (!container || !isReady) return; - - const handleFocus = () => syncClipboard(); - container.addEventListener("mouseenter", handleFocus); - - return () => { - container.removeEventListener("mouseenter", handleFocus); - }; - }, [isReady, syncClipboard]); - const canDropFiles = allowUpload && onDropFiles != null; const [isDraggingFiles, setIsDraggingFiles] = useState(false); // Nested elements fire dragleave as the pointer crosses them, so track depth