GNU bug report logs - #48093
28.0.50; feature/pgtk: multiple display: clipboard

Previous Next

Package: emacs;

Reported by: Rajeev N <rajeev.jnk <at> sivalik.com>

Date: Thu, 29 Apr 2021 01:06:02 UTC

Severity: normal

Tags: moreinfo

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48093 in the body.
You can then email your comments to 48093 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#48093; Package emacs. (Thu, 29 Apr 2021 01:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rajeev N <rajeev.jnk <at> sivalik.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 29 Apr 2021 01:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Rajeev N <rajeev.jnk <at> sivalik.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; feature/pgtk: multiple display: clipboard
Date: Wed, 28 Apr 2021 20:07:24 -0400
I use emacsclient with -a '' option to automatically start daemon if needed.  I use emacsclient command from terminal, wayland display, and X display (vnc) on the same machine,  I have noticed that the clipboard does not work as expected and I am forced to use xclip, wl-copy, wl-paste commands to workaround the bug.

Everything works as expected on the master branch.


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-04-27 built on hp
Repository revision: 66a36f1e5a323aed3d39db1044a1b71373123832
Repository branch: feature/pgtk
Windowing system distributor 'System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure --with-native-compilation --with-cairo --with-mailutils
 --prefix=/home/rajeev/tmp/build/em/o/feature/pgtk --with-pgtk'

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

Important settings:
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  reveal-mode: t
  global-so-long-mode: t
  global-auto-revert-mode: t
  midnight-mode: t
  shell-dirtrack-mode: t
  display-time-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  transient-mark-mode: t
  hs-minor-mode: t

Load-path shadows:
None found.

Features:
(shadow emacsbug sort gnus-cite face-remap utf-7 nnml js cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs mm-archive network-stream url-http url-gw nsm
url-cache url-auth edmacro kmacro server cursor-sensor time-stamp
bbdb-gnus nnfolder pcase xt-mouse which-func imenu timeclock spam
spam-stat gnus-uu yenc semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local cedet org-indent
reveal mailalias bbdb-message mail-extr ol-eww eww xdg url-queue
thingatpt mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect
gnus-search eieio-opt speedbar ezimage dframe ol-docview doc-view
jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m icomplete
so-long autorevert filenotify bbdb-anniv tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat ls-lisp printing ps-print
ps-print-loaddefs ps-def lpr web-server web-server-status-codes el/web
midnight el/cron backtrace qp el/wthr el/av el/hass el/fin el/remote
el/script type-break cal-iso org-id lunar solar cal-dst holidays
hol-loaddefs el/calc el/loc term disp-table shell ehelp dirtrack
hideshow parsec plstore gnutls gnus-delay gnus-draft gnus-agent
gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache gnus-msg
nndraft nnmh comp comp-cstr warnings rx cl-extra help-mode
gnus-icalendar org-capture gnus-art mm-uu mml2015 mm-view mml-smime
smime dig icalendar sieve sieve-mode sieve-manage sasl sasl-anonymous
sasl-login sasl-plain sendmail time ox-odt rng-loc rng-uri rng-parse
rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok
nxml-util ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox
org-element avl-tree generator org-agenda org-refile org-crypt org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src
ob-comint org-pcomplete pcomplete comint ansi-color ring org-list
org-faces org-entities noutline outline org-version ob-emacs-lisp
ob-core ob-eval org-table ol org-keys org-compat advice org-macs
org-loaddefs format-spec find-func gnus-sum shr kinsoku svg dom
gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap
nnmail mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec
gnus-int gnus-range message rmc puny dired dired-loaddefs rfc822 mml
mml-sec epa derived epg epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 gmm-utils mailheader gnus-win gnus vc-git diff-mode
easy-mmode vc-dispatcher cus-edit pp cus-load nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums text-property-search
time-date mail-utils mm-util mail-prsvr wid-edit el/org el/doc el/mail
el/tools el/shell el/xmpp el/diary timer-list bbdb-mua el/timer
el/util bbdb-com crm mailabbrev bbdb bbdb-site timezone el/bbdb appt
diary-lib diary-loaddefs cal-menu calendar cal-loaddefs el/init
finder-inf wombat-theme info package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs
cl-lib iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/pgtk-win pgtk-win term/common-win tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar
menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse
jit-lock font-lock syntax font-core term/tty-colors frame minibuffer
cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese composite
charscript charprop case-table epa-hook jka-cmpr-hook help simple
abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face
macroexp files window text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit pgtk lcms2
multi-tty make-network-process nativecomp emacs)

Memory information:
((conses 16 753102 61427)
 (symbols 48 42200 26)
 (strings 32 216166 23867)
 (string-bytes 1 6373560)
 (vectors 16 77229)
 (vector-slots 8 1318805 46922)
 (floats 8 1261 1241)
 (intervals 56 840 77)
 (buffers 992 37))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48093; Package emacs. (Fri, 14 May 2021 16:42:02 GMT) Full text and rfc822 format available.

Message #8 received at 48093 <at> debbugs.gnu.org (full text, mbox):

From: Yuuki Harano <masm+emacs <at> masm11.me>
To: rajeev.jnk <at> sivalik.com
Cc: 48093 <at> debbugs.gnu.org
Subject: Re: bug#48093: 28.0.50; feature/pgtk: multiple display: clipboard
Date: Sat, 15 May 2021 01:41:37 +0900 (JST)
On Wed, 28 Apr 2021 20:07:24 -0400,
	Rajeev N <rajeev.jnk <at> sivalik.com> wrote:
> I use emacsclient with -a '' option to automatically start daemon if needed.  I use emacsclient command from terminal, wayland display, and X display (vnc) on the same machine,  I have noticed that the clipboard does not work as expected and I am forced to use xclip, wl-copy, wl-paste commands to workaround the bug.
> 
> Everything works as expected on the master branch.

I think that gtk's selection handling code has a bug, and
I have disabled clipboard on multi display environment.

If you want to try clipboard on multi display environment,
then try latest feature/pgtk and do:

----
(setq pgtk-enable-selection-on-multi-display t)
----

But don't expect.  It crashes frequently.
-- 
Yuuki Harano




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48093; Package emacs. (Fri, 01 Jul 2022 11:09:02 GMT) Full text and rfc822 format available.

Message #11 received at 48093 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Rajeev N <rajeev.jnk <at> sivalik.com>
Cc: 48093 <at> debbugs.gnu.org
Subject: Re: bug#48093: 28.0.50; feature/pgtk: multiple display: clipboard
Date: Fri, 01 Jul 2022 13:07:55 +0200
Rajeev N <rajeev.jnk <at> sivalik.com> writes:

> I use emacsclient with -a '' option to automatically start daemon if
> needed.  I use emacsclient command from terminal, wayland display, and
> X display (vnc) on the same machine, I have noticed that the clipboard
> does not work as expected and I am forced to use xclip, wl-copy,
> wl-paste commands to workaround the bug.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Do you still see this issue in Emacs 29?  (Both the clipboard handling
and pgtk has changed quite a bit since this was reported.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 01 Jul 2022 11:09:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48093; Package emacs. (Fri, 01 Jul 2022 16:21:02 GMT) Full text and rfc822 format available.

Message #16 received at 48093 <at> debbugs.gnu.org (full text, mbox):

From: Rajeev N <rajeev.jnk <at> sivalik.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 48093 <at> debbugs.gnu.org
Subject: Re: bug#48093: 28.0.50; feature/pgtk: multiple display: clipboard
Date: Fri, 01 Jul 2022 16:20:29 +0000
[Message part 1 (text/plain, inline)]
sorry, I will not be able to spend any cycles on this anytime soon.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48093; Package emacs. (Sat, 02 Jul 2022 05:07:02 GMT) Full text and rfc822 format available.

Message #19 received at 48093 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Rajeev N <rajeev.jnk <at> sivalik.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 48093 <at> debbugs.gnu.org
Subject: Re: bug#48093: 28.0.50; feature/pgtk: multiple display: clipboard
Date: Sat, 02 Jul 2022 13:05:55 +0800
Rajeev N <rajeev.jnk <at> sivalik.com> writes:

> sorry, I will not be able to spend any cycles on this anytime soon. 

Then I guess this has probably been fixed by the complete selection code
rewrite, which for the most part bypasses the buggy GTK layer.

However, there is one piece of code that still worries me:

  /* GC must not happen inside this segment.  */
  block_input ();
  gtk_selection_clear_targets (FRAME_GTK_WIDGET (f), selection_atom);

  if (VECTORP (targets))
    {
      gtargets = xzalloc (sizeof *gtargets * ASIZE (targets));
      ntargets = 0;

      for (i = 0; i < ASIZE (targets); ++i)
	{
	  if (SYMBOLP (AREF (targets, i)))
	    gtargets[ntargets++].target
	      = SSDATA (SYMBOL_NAME (AREF (targets, i)));
	}

      gtk_selection_add_targets (FRAME_GTK_WIDGET (f),
				 selection_atom, gtargets,
				 ntargets);

      xfree (gtargets);
    }
  unblock_input ();

Here, the GTK API is being used to announce the selection targets, since
the corresponding GDK APIs are not public and are badly abstracted, most
of them being specific to individual GDK backends.

I tested briefly with two Wayland displays and it seems to work fine for
me, but I don't use PGTK on a daily basis and thus cannot be sure.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48093; Package emacs. (Sat, 02 Jul 2022 12:03:01 GMT) Full text and rfc822 format available.

Message #22 received at 48093 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Rajeev N <rajeev.jnk <at> sivalik.com>, 48093 <at> debbugs.gnu.org
Subject: Re: bug#48093: 28.0.50; feature/pgtk: multiple display: clipboard
Date: Sat, 02 Jul 2022 14:02:49 +0200
Po Lu <luangruo <at> yahoo.com> writes:

> Then I guess this has probably been fixed by the complete selection code
> rewrite, which for the most part bypasses the buggy GTK layer.

[...]

> I tested briefly with two Wayland displays and it seems to work fine for
> me, but I don't use PGTK on a daily basis and thus cannot be sure.

Then it sounds like the reported problem has been fixed, and I'm closing
this bug report.  If it turns out that the code snippet in question is
problematic on some systems, somebody will open a new report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 48093 <at> debbugs.gnu.org and Rajeev N <rajeev.jnk <at> sivalik.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 02 Jul 2022 12:04:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 31 Jul 2022 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 268 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.