Am Mittwoch, 3. Januar 2007 12:56 schrieb Abdelrazak Younes: > Georg Baum wrote: > > Am Mittwoch, 3. Januar 2007 12:09 schrieb Abdelrazak Younes: > >> Well, what you say is not fully correct, this isInternal() method could > >> be used in LFUN_MOUSE_PRESS in place of the local paste_internally > >> variable. > > > > Yes, it could be used, but why should we ask the frontend for something we > > store anyway in the cursor? > > Because if we move the X selection fill-in to selection time, then we > won't know at paste time if it was internal or external.
Why? Would cur.selection() not work anymore? I think it would still work, since we need to store that information e.g. for painting. > But if you look > at my GuiSelection patch this could be handled internally in > GuiSelection::get(). I don't understand why that should be done (and it has const correctness issues). > In this case, I agree that the isInternal() method > does not needed to be public. I still don't see why this code should be better than the existing one. The only purpose of the distinction between internal and external selection is to be able to retain the full formatting information for an internal selection. If we want that we need code like the existing one in LyXText::dispatch, and if we don't want that then we can always get the selection from the X server. In both cases I don't see the need for Selection::isInternal(). > > Nevertheless I am able to select something in LyX and paste it with middle > > mouse button into another app. I don't understand why this works. > > Maybe because X do store the contents? Maybe, but how does it get to know that? > > What happens on mouse press is that the selection is put into the internal > > clipboard. I don't know whether that is a hack (misusing the clipboard for > > pasting temporarily) or a feature (because the pasted stuff can then be > > pasted again), but it has nothing to do with Selection::isInternal. > > It is a hack clearly because we don't really use the X11 selection. This > should be solved because, right now, the X Selection can use the > internal clipboard. Maybe somebody else can tell why it is done like this? Georg
