[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issues with X selection handling

From: Davis Herring
Subject: Issues with X selection handling
Date: Tue, 17 Aug 2004 12:52:44 -0600 (MDT)

[Emacs version: 21.3.1 of May 22 2003, although I see few relevant 
changes in CVS]
I have been experimenting with different semantics for handling X 
selections (particularly `PRIMARY'), and have run across several snags in 
the x-*-selection-* functions and hooks:

 + `x-disown-selection-internal' doesn't seem to do anything.
 + `x-lost-selection-hooks' is not always executed when one would expect:
  - using the mouse to select text in Emacs and then elsewhere seems to 
never call the hooks
  - losing the clipboard usually (but not always) calls the hooks
  - explicitly owning a selection with M-: (x-own-selection-internal
'PRIMARY "foo") seems to cause the hooks to be called (later)
  - killing text with the keyboard also seems to guarantee hooks
 + Occasionally, Emacs itself (i.e. xselect.c) seems to miss a
notification that it has lost the selection -- I have, once, seen Emacs
insist that it owns the clipboard selection despite the fact that other
applications are owning and using it.

There may be some sort of race condition in xselect.c, since (if I read it
correctly) it uses 1-second-resolution time values to decide on the
relevance of X events.  But most of the time, `Vselection-alist' has the
correct values (as reported by the x-get-* methods) even when the Lisp
hooks aren't called.

I am unfortunately sufficiently familiar with neither X nor Emacs' C to
properly diagnose (much less correct) these problems; however, I have
attached an Emacs Lisp file with X-selection investigative tools;
hopefully it will be of use in discovering and/or testing fixes for the
bug(s).  Could someone please have a look at this?

Thanks in advance,
Davis Herring

This product is sold by volume, not by mass.  If it seems too dense or too 
sparse, it means mass-energy conversion has occurred during shipping.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]