8046031: UI of Java Web Start app isn't updated when changing Windows theme
authorssadetsky
Tue, 17 May 2016 14:31:12 +0300
changeset 38974 32c15d7bbd56
parent 38973 8640b024f0e3
child 38975 54b83c0b4333
8046031: UI of Java Web Start app isn't updated when changing Windows theme Reviewed-by: alexsch, serb
jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/DesktopProperty.java
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/DesktopProperty.java	Mon May 16 18:12:53 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/DesktopProperty.java	Tue May 17 14:31:12 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, 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
@@ -29,6 +29,7 @@
 import java.lang.ref.*;
 import javax.swing.*;
 import javax.swing.plaf.*;
+import sun.awt.AppContext;
 
 /**
  * Wrapper for a value from the desktop. The value is lazily looked up, and
@@ -41,10 +42,8 @@
 // NOTE: Don't rely on this class staying in this location. It is likely
 // to move to a different package in the future.
 public class DesktopProperty implements UIDefaults.ActiveValue {
-    /**
-     * Indicates if an updateUI call is pending.
-     */
-    private static boolean updatePending;
+    private static final StringBuilder DESKTOP_PROPERTY_UPDATE_PENDING_KEY =
+            new StringBuilder("DesktopPropertyUpdatePending");
 
     /**
      * ReferenceQueue of unreferenced WeakPCLs.
@@ -86,14 +85,16 @@
      * Sets whether or not an updateUI call is pending.
      */
     private static synchronized void setUpdatePending(boolean update) {
-        updatePending = update;
+        AppContext.getAppContext()
+                .put(DESKTOP_PROPERTY_UPDATE_PENDING_KEY, update);
     }
 
     /**
      * Returns true if a UI update is pending.
      */
     private static synchronized boolean isUpdatePending() {
-        return updatePending;
+        return Boolean.TRUE.equals(AppContext.getAppContext()
+                .get(DESKTOP_PROPERTY_UPDATE_PENDING_KEY));
     }
 
     /**