What happens when you copy? (was: Back to copy/paste)
What happens when you copy? (was: Back to copy/paste)
- Subject: What happens when you copy? (was: Back to copy/paste)
- From: Harald Hanche-Olsen <email@hidden>
- Date: Sat, 19 Apr 2008 16:46:01 +0200 (CEST)
I just reread the whole copy/paste thread. It is evident that people
observe wildly different behaviours around copy and paste. I tried
getting to the bottom of it from reading the public quartz-wm code.
Let's see if I have this straight:
When the user selects Edit -> Copy in the X11 app, that triggers the
x_copy function. It checks if another X client holds the primary
selection, and if it does, it performs this incantation:
_my_last_change = [_pasteboard declareTypes:_known_types owner:self];
_proxied_selection = XA_PRIMARY;
I have no idea what the first line means. But I am guessing that it
somehow triggers the running of the function whose definition begins
with
- (void) pasteboard:(NSPasteboard *)sender provideDataForType:(NSString *)type
which calls XConvertSelection, requesting data from the selection
owner. Now this is all a very asynchronous process, and the arrival of
the actual data results in a call to notify_event, which does the
heavy lifting of receiving the data and stuffing it into the
pasteboard.
Now I don't know if this description is accurate, but if it is,
somewhere in there must be the explanation for the differing behaviour
we are seeing.
In my experiments, selecting Copy in X11 always results in a seemingly
immediate result: The selection is copied to the pasteboard,
xquartz-wm claims the clipboard, and all is well. If I select some
other text but don't select Copy, the pasteboard remains unchanged.
But Adam (and others?) sees different behaviour:
+ "Adam D. I. Kramer" <email@hidden>:
> ---
>
> - Select something in an xterm, and push command-C.
>
> - De-select it, and select something ELSE.
>
> - The something ELSE pastes within X11
>
> - The something ELSE pastes within other cocoa apps, even though it
> was not copied*.
>
> ---
As far as I can figure out, that must mean that the event containing
primary selection data has arrived late, or that a second, spurious
such event arrived to be handled by notify_event in the usual manner.
Why this happens to Adam and not to me is beyond my ken.
- Harald
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden