Skip to content

Commit d83130a

Browse files
author
ezio
committed
Address Copilot review: Fix silent fallback logic
1 parent d65f143 commit d83130a

2 files changed

Lines changed: 263 additions & 225 deletions

File tree

docs/wayland-clipboard-fix.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Wayland Clipboard Sync Fix (GNOME 45+)
1+
# Wayland Clipboard Sync Fix (GNOME 46-50)
22

33
## Issue Description
44
On modern Wayland sessions (specifically tested on GNOME 49), pushing clipboard data from an Android device to the desktop via GSConnect fails silently.
@@ -22,7 +22,7 @@ To bypass the strict Wayland background window restriction while remaining nativ
2222
clipboard.set_text(St.ClipboardType.CLIPBOARD, text);
2323
```
2424
3. **Graceful Fallback:**
25-
If the `St` method fails (ensuring backward compatibility with older GNOME releases or X11 sessions where `St` might behave differently), it catches the exception and falls back to the original `Meta.SelectionSourceMemory` implementation.
25+
Because `St.Clipboard.set_text` fails silently (returns void without throwing exceptions) when denied by Wayland, the logic verifies the write by reading the clipboard back immediately. If the text does not match, it falls back to the original `Meta.SelectionSourceMemory` implementation.
2626

2727
## Testing
28-
This fix was locally patched and verified working on **GNOME 49.4 (Wayland)**. Both Android-to-PC and PC-to-Android clipboard syncing operate seamlessly without requiring global shortcut workarounds.
28+
This fix was locally patched and verified working on **GNOME 49.4 (Wayland)**. Both Android-to-PC and PC-to-Android clipboard syncing operate seamlessly.

0 commit comments

Comments
 (0)