After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 568263 - gtk can't recognize the wrong X Selection TARGETS' type "TARGETS" by java applications
gtk can't recognize the wrong X Selection TARGETS' type "TARGETS" by java app...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.14.x
Other All
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 601611
Blocks:
 
 
Reported: 2009-01-19 04:10 UTC by Peng Wu
Modified: 2009-11-11 21:42 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
A patch for gtk2 to recognize the wrong selection type by java applications. (611 bytes, patch)
2009-01-19 04:17 UTC, Peng Wu
none Details | Review

Description Peng Wu 2009-01-19 04:10:33 UTC
Please describe the problem:
Try to copy some text from java application, and try to paste in gedit.
(Note: gnome-terminal will work, because it try to get text from clipboard, not use X Selection TARGETS' type)

"Paste" in this menu list should be selectable, if clipboard data is available.
But "Paste" item in this list is gray out then can't paste text from java application.
PS: this bug is also reported to SUN.
Url:http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6584971

Steps to reproduce:
1. Open a java swing application, copy some text from it.
2. Launch gedit
3. Try to use edit menu to paste text.


Actual results:
Paste menu is gray out.

Expected results:
Paste menu should be selectable.

Does this happen every time?
Yes.

Other information:
Comment 1 Peng Wu 2009-01-19 04:15:52 UTC
I tried copy from other applications, and using wish (tcl/tk), I get the
following results:
epico@linux-3h7d:~> wish
% selection get -type TARGETS
TIMESTAMP TARGETS MULTIPLE UTF8_STRING COMPOUND_TEXT TEXT STRING
When I copy from java application, I get the following message,
% selection get -type TARGETS
0xf5 0x1ae 0x1f 0x216 0x217 0x218 0x219 0x21a 0x21b 0x21c 0x215

The X Selection TARGETS' type should be ATOM, but java.awt set it as TARGETS,
too.
Comment 2 Peng Wu 2009-01-19 04:17:31 UTC
Created attachment 126736 [details] [review]
A patch for gtk2 to recognize the wrong selection type by java applications.
Comment 3 Matthias Clasen 2009-01-19 05:16:06 UTC
        * gtk/gtkselection.c (gtk_selection_data_get_targets): Accept
        a type of TARGETS instead of ATOM, too. Based on a patch by
        Peng Wu.