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

From: Sébastien Miquel <[email-masked]>
Date: Sat, 12 Feb 2022 12:46:31 +0000

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

Configured using:
  'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
  --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
  --with-sound=alsa --with-modules --without-libotf --without-m17n-flt
  --without-gconf --without-gsettings --with-native-compilation
  --with-xinput2 --with-pgtk --without-xaw3d --with-sound=no
  --without-gpm --without-compress-install
  '--program-transform-name=s/\([ec]tags\)/\1.emacs/'
  'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions
  -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
  -fstack-clash-protection -fcf-protection'
  LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG JSON LCMS2
LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER
PGTK PNG RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP XIM
GTK3 ZLIB

Important settings:
   value of $LC_ALL: en_US.UTF-8
   value of $LANG: en_GB.UTF-8
   locale-coding-system: utf-8-unix

-- 
Sébastien Miquel