On Thu, Aug 18, 2011 at 09:37:33AM -0500, Marco Peereboom wrote: > On Wed, Aug 17, 2011 at 04:11:55PM -0500, Marco Peereboom wrote: > > After the long debate yesterday about clipboards sucking major eggs and > > stuff I started looking into the problem.
Where was that discussion? I seem to have missed it. ; One of the problems is that > > xterm doesn't honor the "Keep Selection" flag. The code is a little > > tangly but if I read it correctly it looks like a simple test was > > missed. This brings xterm in line with all other applications > > (including gtk ones) where, by default, if a selection is cleared on the > > screen it ISN'T cleared from PRIMARY. People who desire the clearing of > > PRIMARY should use the "XTerm*keepSelection: false" setting as described > > in the manual. I've seen cases where the xterm selection seems to stick too much too. I haven't had time to track the issue so I don't have further opinions on this for now. May I suggest that you include XTerm's developper Thomas Dickey (dic...@invisible-island.net) in the discussion about this issue? In the mean time I'll commit the update to version 271 that people tested before tree lock. It doesn't change this behaviour. > > > > This is just step one. The rest of the issues seem to be hidden in gtk. > > > > Index: button.c > > =================================================================== > > RCS file: /cvs/xenocara/app/xterm/button.c,v > > retrieving revision 1.17 > > diff -u -p -u -p -r1.17 button.c > > --- button.c 7 Mar 2011 20:41:27 -0000 1.17 > > +++ button.c 17 Aug 2011 21:01:24 -0000 > > @@ -3890,7 +3890,7 @@ DisownSelection(XtermWidget xw) > > > > for (i = 0; i < count; i++) { > > int cutbuffer = CutBuffer(atoms[i]); > > - if (cutbuffer < 0) { > > + if (!screen->keepSelection && cutbuffer < 0) { > > XtDisownSelection((Widget) xw, atoms[i], > > screen->selection_time); > > } > > > > Actually this seems to be a much better patch. > > Index: button.c > =================================================================== > RCS file: /cvs/xenocara/app/xterm/button.c,v > retrieving revision 1.17 > diff -u -p -r1.17 button.c > --- button.c 7 Mar 2011 20:41:27 -0000 1.17 > +++ button.c 18 Aug 2011 14:12:19 -0000 > @@ -2308,7 +2308,7 @@ SelectSet(XtermWidget xw, > if (!isSameCELL(&(screen->startSel), &(screen->endSel))) { > SaltTextAway(xw, &(screen->startSel), &(screen->endSel), params, > num_params); > } else { > - DisownSelection(xw); > + ScrnDisownSelection(xw); > } > } > -- Matthieu Herrb