6607163: Linux: Cannot copy image from Java to OpenOffice
authorson
Thu, 13 Mar 2008 16:42:52 +0300
changeset 110 dc692e475ed0
parent 109 ddfda358e547
child 111 adfeae7879c2
6607163: Linux: Cannot copy image from Java to OpenOffice Summary: TARGETS should have type ATOM Reviewed-by: denis
jdk/src/solaris/classes/sun/awt/X11/XSelection.java
--- a/jdk/src/solaris/classes/sun/awt/X11/XSelection.java	Thu Mar 13 16:32:15 2008 +0300
+++ b/jdk/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 {