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

Re: [E-devel] Eterm cut and paste doesn't work on x86_64 with gcc4.1.1

On Thursday, 12 October 2006, at 20:26:42 (-0400),
Mike Frysinger wrote:

> we tried to look at the issue on irc quite some time ago ... beyond
> me providing the actual X error (which i did), i really dont know
> where to dig

The selection code starts with selection_check() at line 2374 of
src/screen.c.  The brunt of the X interaction happens in
selection_fetch(), selection_copy_string(), selection_paste(), and
selection_send() (line 2452 and down) and in src/events.c in
handle_property_notify() (line 285).

selection_send() is where Eterm responds to a selection request event
(i.e., a "paste" from the clipboard).  There's some weird voodoo in
there, particularly involving i18n, that someone who actually uses
multi-lingual capabilities (read:  not me) might want to go over and

selection_paste() is how we paste either our own selection, or the
primary/secondary/clipboard selection from some other application (Qt,
Firefox, etc.), or a cut buffer (by fetching the root window
property).  Cases #1 and #3 are the easiest and the least prone to
failure as they can be handled immediately.  Case #2 is the most
likely to fail because it requires sending a request for the selection
to the other app and receiving the event at some point in the future
to actually do the paste.  As I and my fellow cynics would expect,
case #2 is also the most common, most useful, and most likely culprit
you're looking for with paste problems.

Every time I look at the selection code, I want 2 things:  (1) to cry,
and (2) to rewrite it.  Unfortunately the fear of breaking i18n always
keeps me from doing action #2, which leads to more of action #1.

Hope that helps you, or someone, who wants to dive deeper into
this.  :-)


Michael Jennings (a.k.a. KainX)  http://www.kainx.org/  <mej@kainx.org>
n + 1, Inc., http://www.nplus1.net/       Author, Eterm (www.eterm.org)
 "We both lie silently still in the dead of the night.  Although we
  both lie close together, we feel miles apart inside.  Was it
  something I said or something I did?  Did my words not come out
  right?"                        -- Poison, "Every Rose Has Its Thorn"