|
From: Dave D. <dde...@es...> - 2006-07-17 11:56:36
|
Daniel J Sebald <dan...@ie...> writes: > Ethan Merritt wrote: >> On Friday 14 July 2006 03:23 pm, Daniel J Sebald wrote: >> >>>I'm not an X-pert (the usual disclaimer), but I believe there is >>>indeed some confusion here, and I think it is with the phrase >>>"clipboard". From what I'm seeing in the code, this feature of being >>>able to copy the X11 gnuplot image is not using the clipboard. >> >> >> It is. > > Not according to the little tests I've done here... OK, same > scenario, generating X11 plots in gnuplot, wanting to get those > images over to OpenWriter. > > To dump stuff into the clipboard, instead of > > export_graph(struct plot_struct *plot) > > inside gplt_x11.c attempting to become owner of PRIMARY, I > instructed it to attempt becoming owner of CLIPBOARD: [snip] > And, as per documentation which indicated to be ready as soon as > sending that command to get back an event, I've seen the event come > without any outside client requesting. > I used to be an expert in this ICCCM stuff, but it was a while ago. Within an app such as gnuplot, there is no particular difference between PRIMARY and CLIPBOARD selection. However, there is typically another client on the system which wants to permanently own the CLIPBOARD selection (eg xclipboard). So as soon as an app such as gnuplot asserts ownership, that other client immediately asks the app for the data, and then reasserts ownership of the selection, and serves the data to anyone who asks for it. So there *is* a client asking for the data, just not one that the user explicitly triggered. That's what makes the data persistent. The extra utility is not required : if there is no clipboard utility running, other clients can ask for the data in the CLIPBOARD selection and it will be served by the original owner transparently. But then the data dies when the original app dies. My knowledge in this predates gnome / gtk etc. I assume they provide the helpers that do the clipboard stuff. Incidentally, one way to monitor activity is to run xcutsel. I often run two instances, one with -selection PRIMARY and one with -selection CLIPBOARD. Then I can get text to move between them. You can also use xclipboard to move data between them. xcutsel shows you when it owns the selection. If you have xclipboard running, then as soon as you "copy 0 to clipboard" in xcutsel, it immediately loses the selection again. But if you "copy 0 to primary" it will remain highlighted until someone else takes the primary selection. Eg if you have the xcutsel's owning both primary and clipboard (assuming your window manager doesn't keep stealing clipboard). In firefox, highlight some text - it should steal the primary selection. Then choose copy from the menu - it should then also steal the clipboard selection. dd -- Dave Denholm <dde...@es...> http://www.esmertec.com |