From 92db57255dadc92cae7fe1ec239f3520d12fac0d Mon Sep 17 00:00:00 2001 From: Andrei Dmitriev Date: Wed, 1 Dec 2010 14:43:56 +0300 Subject: [PATCH 1/5] 6709453: (dav)Screen flickers when a JFrame switches to fullscreen mode Reviewed-by: art, dcherepanov --- .../windows/classes/sun/awt/Win32GraphicsDevice.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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); + } + }); } /** From fe02e1f7c15c85ccfd33fd6bdbfaa1d1bcdbb1a1 Mon Sep 17 00:00:00 2001 From: Denis Fokin Date: Wed, 1 Dec 2010 17:25:12 +0300 Subject: [PATCH 2/5] 6945178: SecurityException upon drag-and-drop A flag added to distinguish drop action handling. Reviewed-by: uta, art --- .../classes/sun/awt/dnd/SunDropTargetContextPeer.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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(); From 906b26182138a81d3918789d9f9c26311bce822f Mon Sep 17 00:00:00 2001 From: Andrei Dmitriev Date: Thu, 2 Dec 2010 19:53:51 +0300 Subject: [PATCH 3/5] 7002173: java.awt package docs build warnings Reviewed-by: ant --- .../share/classes/java/awt/SecondaryLoop.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) 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(); From 81df9d108c1529715d04e11a3cb80a9c64774216 Mon Sep 17 00:00:00 2001 From: Dmeetry Degrave Date: Sat, 4 Dec 2010 02:27:43 +0300 Subject: [PATCH 4/5] 6578041: Drag & Drop from Motif to Java does not work Fixing java's interpretation of unsigned 32bit int as signed during an implicit conversion to 64bit int. Reviewed-by: denis, chrisphi --- .../sun/awt/X11/MotifDnDDragSourceProtocol.java | 5 +++-- .../sun/awt/X11/MotifDnDDropTargetProtocol.java | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) 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; From dc328d312ad027fb8d65fb999db002455eb17395 Mon Sep 17 00:00:00 2001 From: Dmitry Cherepanov Date: Tue, 7 Dec 2010 21:02:34 +0300 Subject: [PATCH 5/5] 6984049: applet browser vendor rebranding changes (jdk7 only) Reviewed-by: art --- jdk/src/share/classes/sun/applet/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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