changeset 7491:5658f6a542fc

Merge
author asaha
date Wed, 16 Apr 2014 21:52:35 -0700
parents 19a67abea24c a948d8801288
children 6d171562a204 65151bb5b083
files .hgtags
diffstat 3 files changed, 33 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Apr 15 23:15:53 2014 -0700
+++ b/.hgtags	Wed Apr 16 21:52:35 2014 -0700
@@ -403,6 +403,7 @@
 07be5d5508733ed37c11fcd21a13ae3c8288313b jdk7u55-b12
 92fd166252c2701092a510002f4cf9285a20473d jdk7u55-b13
 4a5651c84b1e6cf26dc9b19f00747e5004efba68 jdk7u55-b30
+ffd99c5975217a14609851602c5f5dc005234aba jdk7u55-b14
 88f1bf248cc520e0bf7ef17bc862f87aab958373 jdk7u55-b31
 db5a29c812ee25c34ce9cd97de6e0dae284a4e34 jdk7u60-b00
 def34c4a798678c424786a8f0d0508e90185958d jdk7u60-b01
@@ -419,6 +420,7 @@
 1a90de8005e3de2475fd9355dcdb6f5e60bf89cc jdk7u60-b12
 b06d4ed71ae0bc6e13f5a8437cb6388f17c66e84 jdk7u60-b13
 b7fbd9b4febf8961091fdf451d3da477602a8f1d jdk7u60-b14
+04882f9a073e8de153ec7ad32486569fd9a087ec jdk7u60-b15
 c220d329a78161f79df73048ed55db91f538e3b7 jdk7u65-b01
 a42a3bb22f6991d8f6a30e4f1782ad620c40eb65 jdk7u65-b02
 756071871d61e1ca410c63a3f1c4dabcc51a90df jdk7u65-b03
@@ -426,5 +428,6 @@
 14b3f82c245fb8d0eeb21dc99ff0b4985571910c jdk7u65-b05
 7d8e5d90789533b5cc22eeb15c19ce1bb8a20573 jdk7u65-b06
 cde691a6989fa875107a3974aa92681d286be6ec jdk7u65-b07
+d5353f8e1e02e12a1262d65ed85183425b0cdf13 jdk7u65-b08
 9ccfe70cee626ac7831cfa7b7a7eb7a88fe1cd42 jdk7u66-b00
 fc87b55d62fc1e81aaf61ff21175129b8ccc302e jdk7u66-b01
--- a/src/share/classes/java/awt/Toolkit.java	Tue Apr 15 23:15:53 2014 -0700
+++ b/src/share/classes/java/awt/Toolkit.java	Wed Apr 16 21:52:35 2014 -0700
@@ -2559,26 +2559,30 @@
         public void firePropertyChange(final PropertyChangeEvent evt) {
             Object oldValue = evt.getOldValue();
             Object newValue = evt.getNewValue();
+            String propertyName = evt.getPropertyName();
             if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
                 return;
             }
+            Runnable updater = new Runnable() {
+                public void run() {
+                    PropertyChangeSupport pcs = (PropertyChangeSupport)
+                        AppContext.getAppContext().get(PROP_CHANGE_SUPPORT_KEY);
+                    if (null != pcs) {
+                        pcs.firePropertyChange(evt);
+                    }
+                }
+            };
+            final AppContext currentAppContext = AppContext.getAppContext();
             for (AppContext appContext : AppContext.getAppContexts()) {
                 if (null == appContext || appContext.isDisposed()) {
                     continue;
                 }
-                final PeerEvent e = new PeerEvent(source,
-                        new Runnable() {
-                            @Override
-                            public void run() {
-                                PropertyChangeSupport pcs = (PropertyChangeSupport)
-                                        AppContext.getAppContext().get(PROP_CHANGE_SUPPORT_KEY);
-                                if (null != pcs) {
-                                    pcs.firePropertyChange(evt);
-                                }
-                            }
-                        },
-                        PeerEvent.ULTIMATE_PRIORITY_EVENT);
-                SunToolkit.postEvent(appContext, e);
+                if (currentAppContext == appContext) {
+                    updater.run();
+                } else {
+                    final PeerEvent e = new PeerEvent(source, updater, PeerEvent.ULTIMATE_PRIORITY_EVENT);
+                    SunToolkit.postEvent(appContext, e);
+                }
             }
         }
     }
--- a/src/windows/classes/sun/awt/windows/WToolkit.java	Tue Apr 15 23:15:53 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WToolkit.java	Wed Apr 16 21:52:35 2014 -0700
@@ -37,6 +37,7 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import sun.awt.AWTAutoShutdown;
+import sun.awt.AppContext;
 import sun.awt.SunToolkit;
 import sun.misc.ThreadGroupUtils;
 import sun.awt.Win32GraphicsDevice;
@@ -863,7 +864,18 @@
      * Windows doesn't always send WM_SETTINGCHANGE when it should.
      */
     private void windowsSettingChange() {
-        updateProperties();
+        if (AppContext.getAppContext() == null) {
+            // No AppContext, so we can update properties on the current thread,
+            // DesktopPropertyChangeSupport will only post events.
+            updateProperties();
+        } else {
+            EventQueue.invokeLater(new Runnable() {
+                @Override
+                public void run() {
+                    updateProperties();
+                }
+            });
+        }
     }
 
     private synchronized void updateProperties() {