Repository navigation
Conversation
dropboxd is a GTK3 app and picks GDK's Wayland backend on Wayland sessions. Wayland compositors ignore clipboard writes from clients without keyboard focus, and dropboxd only has a tray icon, so the "Copy Dropbox link" action silently fails while still showing the "link copied" notification. When starting dropboxd in a Wayland session, prefer GTK's X11 backend (falling back to Wayland) unless GDK_BACKEND is already set. XWayland forwards the X11 clipboard to the Wayland clipboard. Fixes dropbox#164. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
While this is a workaround for specific types of setups, there is also a cleaner fix that I'd like to check with you before implementing. The extension runs inside Nautilus, which is the focused app when you click "Copy Dropbox link", so it's allowed to write the clipboard on Wayland. The daemon already has Compared with this PR, that would:
The trade-off is the "link copied" notification, which the daemon shows today. The extension could send an equivalent one through org.freedesktop.Notifications (Dropbox name and icon, click opens the link), or skip it. Would you prefer that approach, either replacing this PR or alongside it? Or would you rather keep the change in the launcher? Also, do you know whether |
nautilus dev here. This is the right approach (calling |
Summary
Fixes #164: "Copy Dropbox link" shows the "link copied" notification but leaves the clipboard empty on Wayland sessions (GNOME and KDE).
The Nautilus extension only sends
icon_overlay_context_action/copy_linktodropboxd; the daemon writes the clipboard itself.dropboxdis a GTK3 app, so on a Wayland session it uses GDK's Wayland backend. Wayland compositors ignore clipboard writes from clients that don't have keyboard focus, anddropboxdonly has a tray icon, so the write is silently dropped.This change makes
dropbox startlaunchdropboxdwithGDK_BACKEND=x11,waylandwhenXDG_SESSION_TYPE=waylandandGDK_BACKENDisn't already set. Under XWayland the clipboard write succeeds and the compositor forwards it to the Wayland clipboard; if XWayland isn't available, GTK falls back to Wayland. The environment setup is moved into a smalldropboxd_env()helper, next to the existing Unity/Budgie workaround.Test plan
python3 ./dropbox_test.pypasses.ruff format --diffandruff check(ruff 0.16.9, as pinned intools/requirements.txt) pass.copy_linkover~/.dropbox/command_socketreturnsok, butwl-pasteandxclip -o -sel clipboardboth stay unchanged.GDK_BACKEND=x11,wayland, the same command puts the shared link in both the Wayland and X11 clipboards.Gtk.Clipboard.set_text()shows the same behaviour: dropped withGDK_BACKEND=wayland, works withGDK_BACKEND=x11.