gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

X11 copy/paste and drag-and-drop


From: Eric Wasylishen
Subject: X11 copy/paste and drag-and-drop
Date: Sun, 7 Aug 2011 16:09:16 -0600

Hey,

I did some investigating of why copy/paste from X11 apps to GNUstep doesn't 
work well (only plain text was working), and drag-and-drop doesn't work at all 
for me between GS and non-GS apps.

I fixed one set of bugs in xpbs a few days ago, so now you can copy and paste 
rich text from OpenOffice.org to Ink, as long as you copy the text in 
OpenOffice to the clipboard _before_ Ink/gpbs are started.

The remaining problem is that we aren't updating the list of types on the 
pasteboard when the selection changes in non-GS applications. I committed part 
of a fix for this; now xpbs.m is notified when the selection owner changes 
(e.g. from plain text in gnome-terminal to rich text in OpenOffice.org.) 
However, it doesn't yet do anything with this information.  My current idea is 
something like: 

- xpbs receives notification that the selection owner changed
- xpbs calls a private NSPasteboard method -invalidateCurrentTypes, which means 
the next time someone calls -[NSPasteboard types],  we need to ask X11 for the 
currently available types (as implemented by -[XPbOwner availableTypes]

I'm not really sure how to implement this as I don't fully understand the 
interaction between gpbs.m and NSPasteboard.m, but I think the approach would 
work.


I also debugged a drag-and-drop session from Abiword to Ink, and the place 
where it fails is
[[NSPasteboard pasteboardWithName: NSDragPboard] types] returning nil, when it 
should have returned the types being dragged. So, it's essentially the same 
underlying problem as copy/paste, since the dragged data is just another X11 
selection like PRIMARY or CLIPBOARD.

Regards,
Eric


reply via email to

[Prev in Thread] Current Thread [Next in Thread]