Markpad icon indicating copy to clipboard operation
Markpad copied to clipboard

Clipboard dead (copy+paste, both directions) on X11 — caused by the LD_PRELOAD=libwayland-client.so render workaround

Open RobinCodes opened this issue 5 months ago • 4 comments

Summary

On an X11 session, Markpad's Linux launcher requires LD_PRELOAD=/usr/lib/libwayland-client.so to render at all — without it the WebKitGTK view fails with EGL_BAD_PARAMETER and shows a black window. But that same preload completely disables the clipboard: copy and paste fail, in both directions, via both Ctrl+C/V and the right-click context menu. The system clipboard is otherwise fully working between all other applications.

It appears to be a catch-22: the preload forces WebKitGTK/EGL onto the Wayland platform, but on an X11 session (no Wayland compositor) the clipboard path has nothing to bind to, so it silently no-ops.

Steps to reproduce

  1. Install Markpad on an X11 desktop session (Intel/Mesa, no Wayland compositor running).
  2. Launch via the shipped .desktop entry: Exec=env LD_PRELOAD=/usr/lib/libwayland-client.so /path/to/markpad.
  3. App renders correctly.
  4. Select text in the editor → Ctrl+C (or right-click → Copy) → try to paste into another app: nothing.
  5. Copy text in another app → Ctrl+V (or right-click → Paste) into Markpad: nothing.

What I've verified / ruled out

  • Version: latest (binary built 2026-06-27, matching v2.6.11). Not an old-version regression.
  • System clipboard is healthy: copy/paste works between all other apps (e.g. browser → text editor). Only Markpad is affected.
  • xdg-desktop-portal present & running: org.freedesktop.portal.Desktop + xdg-desktop-portal-gtk are active on the user bus.
  • WEBKIT_FORCE_SANDBOX=0: renders fine, clipboard still dead (so it is not the WebKitGTK sandbox).
  • Removing the preload: EGL_BAD_PARAMETER → black window. EGL_PLATFORM=x11, WEBKIT_DISABLE_DMABUF_RENDERER=1, and WEBKIT_DISABLE_COMPOSITING_MODE=1 do not restore rendering without the preload.

Log without the preload

Setup Args: ["Markpad"]
Could not create default EGL display: EGL_BAD_PARAMETER. Aborting...

Environment

  • OS: Arch Linux (kernel 7.0.13-arch1-1)
  • Desktop / session: XFCE on X11 (XDG_SESSION_TYPE=x11, WAYLAND_DISPLAY unset)
  • GPU: Intel UHD Graphics (Alder Lake-N), i915
  • Mesa: 26.1.3
  • System WebKitGTK: none installed separately (webview appears bundled/static)

Suggested direction

Make the Linux/X11 render path work without forcing the Wayland EGL platform (so the preload isn't needed on X11), or ensure the clipboard binds to the actual active display backend rather than the preloaded Wayland one. Happy to test patches / provide more logs.

RobinCodes avatar Jul 01 '26 14:07 RobinCodes

Playing around I found that in Debian with Cinnamon (X11) Copy from the context menu still works and Shift-Ctrl-V pastes.

oliver-six avatar Jul 28 '26 15:07 oliver-six

To be clear, I wrote the issue with Claude Opus. I think it did not make it clear enough that there is a larger issue, which is that it does not render on Arch at all in my experience (black window). I asked the LLM for a workaround and that's (I think) what it is calling "the shipped .desktop entry". That wasn't actually shipped, it was a workaround found by the LLM. The app also froze/crashed sometimes when I tried copying / pasting a lot. The scroll sync is also questionable on my installation.

RobinCodes avatar Jul 29 '26 07:07 RobinCodes

One thing worth clarifying from our side: the LD_PRELOAD=libwayland-client.so workaround you mention is not in this repository — there's no reference to LD_PRELOAD or libwayland anywhere in the source or the packaging. It likely comes from a third-party package (an AUR build or similar) rather than an official artifact.

That doesn't resolve the clipboard problem, but it may point at where the launcher wrapper needs fixing. I can't reproduce X11 behaviour from macOS, so I can't take this further myself.

PathGao avatar Aug 02 '26 21:08 PathGao

closing for now

alecdotdev avatar Aug 05 '26 05:08 alecdotdev