Back to the clipboard, part II.

Havoc Pennington hp at
Thu Oct 31 14:33:13 GMT 2002

Lubos Lunak <l.lunak at> writes:  
>  Now, here comes PRIMARY, which will be a problem. I couldn't find in any 
> "oficial" X11 docs the definiton of its behaviour, only independent docs 
> describing how apps should do it (e.g. [2] or [3]). They of course either 
> don't go into sufficient level of details, or they contradict each other in 
> the details. I personally consider the right behaviour to be the table in 
> [3], which the small change that the first row shouldn't say 'text 
> highlighted with mouse', but simply 'highlighted, not matter how'.

Right, I agree with that table. ([2] does intend to say the same
thing, but the table is better presented.) I do think this table
reflects the intent of the ICCCM, as well.

> The only selected text 
> is simply THE selection, even if you select the text using
> Shift+arrows.

(I think it'd be pretty weird if keyboard selection did something
different from mouse selection.)

>  This also means that 'copy link location' this way shouldn't set
> PRIMARY, as the link wouldn't be the selection

I filed a bug on a long time ago about "copy link
location"; my suggestion was that if they are going to set PRIMARY in
addition to CLIPBOARD, then the menu item should display the link as
selected. It would then look like this menu item automatically
selected the link and then copied it. Thus maintaining the invariant
that MMB pastes the currently-selected text.

I don't remember the bug number but I think the bug is
still open.
>  I also tried with MS Windows. There's usually one selection per application, 
> so the problems with unselecting usually don't happen (unless you do 'New 
> Window' in IE, they it looks like two apps, but in fact it's only one, having 
> only one selection).

I would have expected the selection to be per-window or per-document,
it's sort of surprising that they don't do it that way.

>  Lineedits in config dialogs unselect as soon as they 
> loose the focus. I also noted that selecting something in Notepad and 
> selecting a lineedit in its config dialog doesn't unselect the
> edited text. 

This sounds like per-window though.

Maybe it's one of those areas (like window placement) where Windows is
really inconsistent. ;-)
> If you select a lineedit and unselect, MMB still works.

This part may be OK, we've considered having GTK do this (to hold
PRIMARY until someone else claims it, even if we no longer display a
selection). The thing that causes problems is to keep displaying the
selection when you don't hold PRIMARY anymore, or to re-assert
ownership of PRIMARY when the unselect happens.


More information about the kde-core-devel mailing list