changeset 87:f3377ab93ee8

6607163: Linux: Cannot copy image from Java to OpenOffice Summary: TARGETS should have type ATOM Reviewed-by: denis
author son
date Thu, 13 Mar 2008 16:42:52 +0300
parents 619d2d592b88
children bbd8e20d5052
files src/solaris/classes/sun/awt/X11/XSelection.java
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11/XSelection.java	Thu Mar 13 16:32:15 2008 +0300
+++ b/src/solaris/classes/sun/awt/X11/XSelection.java	Thu Mar 13 16:42:52 2008 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -281,8 +281,10 @@
         if (targetsGetter.isExecuted() && !targetsGetter.isDisposed() &&
                 (targetsGetter.getActualType() == XAtom.XA_ATOM ||
                  targetsGetter.getActualType() == XDataTransferer.TARGETS_ATOM.getAtom()) &&
-                targetsGetter.getActualFormat() == 32) {
-
+                targetsGetter.getActualFormat() == 32)
+        {
+            // we accept property with TARGETS type to be compatible with old jdks
+            // see 6607163
             int count = (int)targetsGetter.getNumberOfItems();
             if (count > 0) {
                 long atoms = targetsGetter.getData();
@@ -687,7 +689,7 @@
                         XToolkit.awtLock();
                         try {
                             XlibWrapper.XChangeProperty(XToolkit.getDisplay(), requestor,
-                                                        property, format, dataFormat,
+                                                        property, XAtom.XA_ATOM, dataFormat,
                                                         XlibWrapper.PropModeReplace,
                                                         nativeDataPtr, count);
                         } finally {