Am Mittwoch, 3. Januar 2007 10:33 schrieb Abdelrazak Younes:
> Georg Baum wrote:
> > Note also that the concept of "internal selction" is wrong. The 
selection 
> > as implemented in LyX (following the concept at freedesktop.org) is 
always 
> > global. If you want to change that then this needs to be discussed 
first.
> 
> I did not touch yet the X11 Selection only the system Clipboard. This is 
> just naming, "isInternal()" as "was it set from within the 
> application?". Do you prefer owns()?

No, this was not about naming. What I meant was: LyX does not care whether 
the selection was set from within or not. It simply sends the selection to 
the X server when it has one, and gets the current selection back when it 
is requested. Therefore a Selection::isInternal() method is only 
confusing, because it is not needed. Besides that the comment is wrong.

lyx::frontend::GuiSelection is BTW exactly the place where a real selection 
with middle mouse paste could be emulated on windows: Just store the 
string in put(), return it back in get() and clear it in haveSelection() 
if needed. Then the only thing that would be missing for Enrico is a 
connection of this emulated selection to the external clipboard, but you 
could even do that without destroying the simple mental model of 
selection: In lyx::frontend::GuiSelection::get(), return the system 
clipboard if it was set from outside of LyX and the LyX internal selection 
is empty.
This could even be implemented without any #ifdef by simply using 
qApp->clipboard()->supportsSelection(), and would work automatically on 
all platforms that don't have a selection. This way, no preference setting 
would be needed, and the behaviour on windows and X11 would be as 
identical as possible. Or did I miss anything?


Georg

Reply via email to