diff --git a/jdk/src/share/classes/java/awt/SecondaryLoop.java b/jdk/src/share/classes/java/awt/SecondaryLoop.java index 844efc85261..6fd97e76bd4 100644 --- a/jdk/src/share/classes/java/awt/SecondaryLoop.java +++ b/jdk/src/share/classes/java/awt/SecondaryLoop.java @@ -30,15 +30,15 @@ package java.awt; *
* Objects that implement this interface are created with the * {@link EventQueue#createSecondaryLoop} method. The interface - * provides two methods, {@link enter} and {@link exit}, + * provides two methods, {@link #enter} and {@link #exit}, * which can be used to start and stop the event loop. *
- * When the {@link enter} method is called, the current + * When the {@link #enter} method is called, the current * thread is blocked until the loop is terminated by the - * {@link exit} method. Also, a new event loop is started + * {@link #exit} method. Also, a new event loop is started * on the event dispatch thread, which may or may not be * the current thread. The loop can be terminated on any - * thread by calling its {@link exit} method. After the + * thread by calling its {@link #exit} method. After the * loop is terminated, the {@code SecondaryLoop} object can * be reused to run a new nested event loop. *
@@ -102,7 +102,7 @@ public interface SecondaryLoop { *
* This method can be called by any thread including the event * dispatch thread. This thread will be blocked until the {@link - * exit} method is called or the loop is terminated. A new + * #exit} method is called or the loop is terminated. A new * secondary loop will be created on the event dispatch thread * for dispatching events in either case. *
@@ -123,23 +123,23 @@ public interface SecondaryLoop { /** * Unblocks the execution of the thread blocked by the {@link - * enter} method and exits the secondary loop. + * #enter} method and exits the secondary loop. *
- * This method resumes the thread that called the {@link enter} + * This method resumes the thread that called the {@link #enter} * method and exits the secondary loop that was created when - * the {@link enter} method was invoked. + * the {@link #enter} method was invoked. *
* Note that if any other secondary loop is started while this * loop is running, the blocked thread will not resume execution * until the nested loop is terminated. *
* If this secondary loop has not been started with the {@link - * enter} method, or this secondary loop has already finished - * with the {@link exit} method, this method returns {@code + * #enter} method, or this secondary loop has already finished + * with the {@link #exit} method, this method returns {@code * false}, otherwise {@code true} is returned. * * @return {@code true} if this loop was previously started and - * has not yet been finished with the {@link exit} method, + * has not yet been finished with the {@link #exit} method, * {@code false} otherwise */ public boolean exit(); diff --git a/jdk/src/share/classes/sun/applet/Main.java b/jdk/src/share/classes/sun/applet/Main.java index 5b08a929a79..e5ef4fda3c3 100644 --- a/jdk/src/share/classes/sun/applet/Main.java +++ b/jdk/src/share/classes/sun/applet/Main.java @@ -339,7 +339,7 @@ public class Main { // Standard browser properties avProps.put("browser", "sun.applet.AppletViewer"); avProps.put("browser.version", "1.06"); - avProps.put("browser.vendor", "Sun Microsystems Inc."); + avProps.put("browser.vendor", "Oracle Corporation"); avProps.put("http.agent", "Java(tm) 2 SDK, Standard Edition v" + theVersion); // Define which packages can be extended by applets diff --git a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java index db92e68ffd9..19c2206fe93 100644 --- a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java +++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java @@ -94,6 +94,11 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, protected int dropStatus = STATUS_NONE; protected boolean dropComplete = false; + // The flag is used to monitor whether the drop action is + // handled by a user. That allows to distinct during + // which operation getTransferData() method is invoked. + boolean dropInProcess = false; + /* * global lock */ @@ -220,7 +225,7 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, SecurityManager sm = System.getSecurityManager(); try { - if (!dropComplete && sm != null) { + if (!dropInProcess && sm != null) { sm.checkSystemClipboardAccess(); } } catch (Exception e) { @@ -526,6 +531,8 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, setCurrentJVMLocalSourceTransferable(null); } + dropInProcess = true; + try { ((DropTargetListener)dt).drop(new DropTargetDropEvent(dtc, hots, @@ -538,6 +545,7 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, } else if (dropComplete == false) { dropComplete(false); } + dropInProcess = false; } } else { rejectDrop(); diff --git a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java index 3cfffa71979..85cd5448fd5 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. 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 @@ -134,7 +134,8 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol if (swapNeeded) { t = MotifDnDConstants.Swapper.swap(t); } - long time = t; + long time = t & 0xffffffffL; + // with correction of (32-bit unsigned to 64-bit signed) implicit conversion. /* Discard events from the previous receiver. */ if (targetEnterServerTime == XConstants.CurrentTime || diff --git a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java index a6ec86c505f..030c02f557b 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. 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 @@ -928,7 +928,9 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol { throw new IOException("Cannot get data: drag source property atom unavailable"); } - long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder); + long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder) & 0xffffffffL; + // with correction of (32-bit unsigned to 64-bit signed) implicit conversion. + XAtom selectionAtom = XAtom.get(selatom); XSelection selection = XSelection.getSelection(selectionAtom); @@ -962,7 +964,9 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol { return false; } - long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder); + long time_stamp = MotifDnDConstants.Swapper.getInt(data + 4, eventByteOrder) & 0xffffffffL; + // with correction of (32-bit unsigned to 64-bit signed) implicit conversion. + long sel_atom = MotifDnDConstants.Swapper.getInt(data + 12, eventByteOrder); long status_atom = 0; diff --git a/jdk/src/windows/classes/sun/awt/Win32GraphicsDevice.java b/jdk/src/windows/classes/sun/awt/Win32GraphicsDevice.java index 5663a9ff7f3..14b93bd0e2b 100644 --- a/jdk/src/windows/classes/sun/awt/Win32GraphicsDevice.java +++ b/jdk/src/windows/classes/sun/awt/Win32GraphicsDevice.java @@ -30,6 +30,7 @@ import java.awt.GraphicsDevice; import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; import java.awt.DisplayMode; +import java.awt.EventQueue; import java.awt.Frame; import java.awt.Rectangle; import java.awt.Window; @@ -610,11 +611,18 @@ public class Win32GraphicsDevice extends GraphicsDevice implements * * @param w full-screen window */ - protected void addFSWindowListener(Window w) { + protected void addFSWindowListener(final Window w) { // Note: even though we create a listener for Window instances of // fs windows they will not receive window events. fsWindowListener = new Win32FSWindowAdapter(this); - w.addWindowListener(fsWindowListener); + + // Fix for 6709453. Using invokeLater to avoid listening + // for the events already posted to the queue. + EventQueue.invokeLater(new Runnable() { + public void run() { + w.addWindowListener(fsWindowListener); + } + }); } /**