Subject: bug#53957: 29.0.50; pgtk: starting emacsclient from thunar breaks X clipboard access

From: Po Lu <[email-masked]>
Date: Sun, 13 Feb 2022 09:17:00 +0800

Sébastien Miquel <[email-masked]> writes:

> Hi,
>
> To reproduce :
>  1. Start `emacs -q --daemon`
>  2. Start a frame with `emacsclient -c`. At this point, X clipboard
>  access works fine and I can copy/paste between emacs and other
> applications.
>  3. From Thunar (file manager from xfce), right click a file and `Open
>  with` emacsclient (/usr/bin/emacsclient), creating another frame.
>     At this point, X clipboard access is broken: I cannot copy/paste
>  between emacs and other applications.
>
> In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
> 3.24.31, cairo version 1.17.4)
>  of 2022-02-05
> Repository revision: 224aeb2877fffc894e9d1b31f7f44db0e55160c3
> Repository branch: master
> System Description: Arch Linux

If you're using X, you shouldn't be using PGTK.  The support provided by
the real X port is miles ahead of what GTK can offer.

That aside, I suspect emacsclient is causing Emacs to open a second
display connection, which causes clipboard access in PGTK to be disabled
due to a GTK bug.

What does (x-display-list) evaluate to in the buggy Emacs, after you
create the other frame which causes the bug?

Thanks.