ClipBoard not working with java (swing) applications

Bug #207057 reported by ValiSystem
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
synergy (Ubuntu)
Incomplete
Low
Unassigned

Bug Description

Binary package hint: synergy

Shared clipboard won't work with java application. My test case is a synergy server on ubuntu/AMD64, and copy/paste with my MacOS client do not work in java applications. A Java exception is triggered in sun.awt.X11 packages, with calls linked to Clipboard (native X function where exception is triggered : XGetAtomName, called in sun.awt.X11.XClipboard.checkChange() call stack).

Synergys may not set up the clipboard properly, or java access to clipboard does not respect completely the X11 standard.

Revision history for this message
ValiSystem (vali-system) wrote :
Revision history for this message
Selrach (charleswrobertson) wrote :

I would like to confirm that this happens to me as well. I have synergy set up to run between Ubuntu 8.04 with Intel core2 Duo 64-bit processors and a Windows XP machine. When I use java 1.6 with any development applications this bug shows up periodically, and crashes most of my java apps on startup. It only shows up when something is "copied" on my Windows XP box, and as a quick workaround to start my development apps, I have to "copy" something on my ubuntu box. Essentially I can't use the shared clipboard with java apps from windows to ubuntu unless I use an intermediary such as gedit.

Revision history for this message
Ixmal (artem-ananiev) wrote :

Here is what's going from Java's point of view. When user requests clipboard contents, AWT first requests a value of TARGETS atom for CLIPBOARD selection. The code is in XSelection.getFormats():

        XlibWrapper.XConvertSelection(XToolkit.getDisplay(), // X display connection
                getSelectionAtom().getAtom(), // CLIPBOARD atom
                XDataTransferer.TARGETS_ATOM.getAtom(), // TARGETS atom
                selectionPropertyAtom.getAtom(), // "XAWT-SELECTION" atom to fill
                XWindow.getXAWTRootWindow().getWindow(), // requestor window
                time);

The call is successful, and the next thing is to get the value of "XAWT-SELECTION" and convert it to the list of atoms. Here is the list on my linux with synergy client running: 0x189, 0x18a, 0x18b, 0x194, 0xf4, 0x195, 0x196, 0x197, 0x1f, 0x0, 0x14aa1, 0xfffffffff9530698, 0xfffffffff9530698, 0x18a, 0x18b, 0x194, 0xf4, 0x195

Value 0x0 seems odd to me, as well as other repeating values. This only happens when Java and one of synergy clients are started from 64-bit linux, regardless of where synergy server is running.

Revision history for this message
Ixmal (artem-ananiev) wrote :

I have created a native test which is very close to what we in Java. Attached.

Revision history for this message
Neopallium (bobby-neoawareness) wrote :

Attached is a fix for this bug. Also here is a link to the bug report at the synergy2 project.
http://sourceforge.net/tracker/index.php?func=detail&aid=2033712&group_id=59275&atid=490467

To apply the patch:
1. tar zxvf synergy-1.3.1.tar.gz
2. cd synergy-1.3.1
3. patch -p1 </tmp/synergy-1.3.1-64bit_bug.patch

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 or 9.04?

Changed in synergy:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Neopallium (bobby-neoawareness) wrote :

It should still happen on all 64Bit linux systems that use synergy 1.3.1 without the 64bit patch applied.

The patch hasn't been applied to the upstream(main synergy project) yet, development on synergy seems to be going slow (last update 17months ago). I would recommend that distros like Ubuntu and Fedora apply the patch to their packages.

I am using this patch on my Gentoo and Fedora systems (both are 64bit)

Revision history for this message
cyba (marcus-kempe) wrote :

I'm also on 64 bit Ubuntu 9.04 using synergy and having this problems in java applications such as Eclipse and soapUI.

Would be really nice if this fix could be incorporated in the ubuntu distro, if indeed the main synergy project is kind of dead.

David Futcher (bobbo)
tags: added: patch-forwarded-upstream
removed: patch
Revision history for this message
Derrick Rice (derrick-rice) wrote :

The new Synergy project site has this bug here:

http://synergy-foss.org/pm/issues/27

And according to the site, it is fixed in 1.3.6. I have not yet confirmed that the problem doesn't exist.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.