Am Donnerstag, 4. Januar 2007 12:28 schrieb Abdelrazak Younes:
> [EMAIL PROTECTED] wrote:
> > Author: baum
> > Date: Thu Jan  4 12:12:01 2007
> > New Revision: 16497
> > 
> > URL: http://www.lyx.org/trac/changeset/16497
> > Log:
> > Remove isInternal() method. We don't use it and should not do so in the
> > future, we use LCursor::selection() instead.
> 
> But Georg, LCursor::selection() is also true when the selection has been 
> done from the keyboard, in which case, the X selection should be empty 
> if last selection was done inside LyX (this has to be verified to be 
> true) but maybe not it the last X selection has been done outside LyX. 
> You are probably missing something here (and we did not reach a 
> consensus on that point).

Actually we never reached a consensus to put isInternal() in in the first 
place, therefore I simply removed it.

Apart from that I don't think that I am missing something. The X selection 
gets filled if another X application requests it (see the documentation of 
Selection::put, until yesterday I did not fully understand that). We don't 
care at all about the X selection except for the following cases:

- Another app requests our selection. This is handled in 
GuiApplication::x11EventFilter. isInternal() is not needed.
- We want to paste the selection by middle mouse button. Then we either 
paste the internal one if cur.selection() is true, or else we call 
theSelection()->get(). We don't need isInternal() here, cur.selection() is 
less expensive and does exactly what we need. You certaionly don't want to 
treat selection by keyboard differently than selection by mouse here?
- We want to paste the selection by the primary-selection-paste lfun. 
isInternal() is not needed, we always use theSelection()->get().

The only yet unclear case is this strange haveSelection() method. But since 
that is called when the LyX selection is changed we don't need 
isInternal() here either, because we know already that the last selection 
was internal.


Georg

Reply via email to