This commit is contained in:
Lana Steuck 2010-12-13 16:21:36 -08:00
commit 80dcc0914c
6 changed files with 41 additions and 20 deletions

View File

@ -30,15 +30,15 @@ package java.awt;
* <p>
* 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.
* <p>
* 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.
* <p>
@ -102,7 +102,7 @@ public interface SecondaryLoop {
* <p>
* 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.
* <p>
@ -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.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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();

View File

@ -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

View File

@ -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();

View File

@ -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 ||

View File

@ -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;

View File

@ -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);
}
});
}
/**