Well we don't really have a way to address this on the server level short of polling or updating when X11 looses focus. I don't like either of those ideas. Plus Tk is old, cruddy, and broken in this regard. I would work on assuming things do it "the GTK way" and maybe work on getting a patch made for TK.
Hehe, I'm a Tcl and Tk core developer/maintainer at SourceForge...
Well that helps...
Unfortunately we can't copy images from most Gtk+ apps unless we support CLIPBOARD, and if this ambiguous situation continues to persist, there is little hope for the default Copy/Paste menus to work properly in all cases.
I fail to see how this ambiguity is a blocker. Assuming default options: option_proxy_on_select=FALSE option_proxy_clipboard=TRUE option_proxy_pb_to_clipboard=TRUE option_proxy_pb_to_primary=TRUE
we have:
1) select text in the TK Widget PRIMARY="Owned by TK" CLIPBOARD=NULL PASTEBOARD=NULL 1a) Do X11.app's Edit->Copy PRIMARY="Owned by TK" CLIPBOARD=NULL PASTEBOARD="TK Text 1" 2) do edit->copy in gimp PRIMARY="Owned by TK" CLIPBOARD="Owned by Gimp" PASTEBOARD="GIMP IMAGE" 3) select new text in TK Widget PRIMARY="Owned by TK" CLIPBOARD="Owned by Gimp" PASTEBOARD="GIMP IMAGE" 3a) Do X11.app's Edit->Copy PRIMARY="Owned by TK" CLIPBOARD="Owned by Gimp" PASTEBOARD="TK Text 2"
Jordan Hubbard and I talked some more about ideas to solve this.
What are your thoughts on the following?
1. get CLIPBOARD data when with have an XQuartz Edit->Copy.
No! That breaks probably the most common use of Edit->Copy (copying selected text from xterm/nedit/etc). PRIMARY should be sent to pasteboard on the Edit->Copy event. Why would you want Edit->Copy to have anything to do with CLIPBOARD? HIG dictates that the expected behavior is that the selected item (what is in PRIMARY) is what should be sent to the PB.
2. set pbproxy as owner of CLIPBOARD. set pbproxy as owner of PRIMARY. copy the contents to NSPasteboard.
Uhm... this makes no sense to me. Why would you copy data to NSPasteboard if you're the owner of CLIPBOARD or PRIMARY? If pbproxy is the owner of PRIMARY and/or CLIPBOARD, then it means that it's "copying" from Pasteboard TO CLIPBOARD or PRIMARY. It's when someone else owns CLIPBOARD or PRIMARY that we'll be copying that to Pasteboard.
3. respond to requests from X11 for pastes of PRIMARY and possibly CLIPBOARD
Yeah, we definitely need to do that when we own PRIMARY and CLIPBOARD.
4. if Edit->Copy occurs in XQuartz and pbproxy owns CLIPBOARD, then ignore clipboard, and only copy PRIMARY to NSPasteboard.
Yeah, that's right. What are your specific complaints about the behavior/pseudocode I mentioned earlier today? That was the culmination of about 2-3 weeks of discussion on this mailing list about what expected behaviors people expected. --Jeremy