|
From: Daniel J S. <dan...@ie...> - 2006-07-18 09:59:21
|
Daniel J Sebald wrote: > SO, the idea is to force the requestor window to clear all pending updates before sending the event. Here's the additional command: > > XChangeProperty(dpy, reply.xselection.requestor, > reply.xselection.property, reply.xselection.target, > 32, PropModeReplace, (unsigned char *) requested_pixmap, 1); > > XClearWindow(dpy, reply.xselection.requestor); > > XSendEvent(dpy, reply.xselection.requestor, False, 0L, &reply); > > XFlush(dpy); No, make that XFlush, not XClearWindow. (Write concept, wrong function.) So here's the critical replacement: + /* Make sure things are ready on the requestor window. */ + XFlush(dpy); + XSendEvent(dpy, reply.xselection.requestor, False, 0L, &reply); - /* we never block on XNextEvent(), so must flush manually - * (took me *ages* to find this out !) - */ - XFlush(dpy); The flush should be before sending the event. (That comment may be a red herring.) I've updated the patch on SourceForge for those who want to give it a try. It is very X-like now. Highlights image when selected. (Prints SELECTED in the window text when either a Pixmap or some text is selected.) Can copy to clipboard. I've also added a #define option for XPM support. (The library -lXpm has to be added to the list of libraries in the Makefile.) gnuplot_x11 will then support image/x-xpixmap requests so that Abiword now works as well as OpenWriter. In fact, Abiword seems to behave a little more nicely. The XPM support was simple. We could easily create a clipboard buffer for the core of gnuplot if other formats like image/png and so on work as easily as that one did. Dan |