changeset 7244:dddec7c8b7c2

Fix for RT-36915 [Monocle] Add support for minimize to monocle Reviewed by dblaukopf, dhill Tested with HelloSanity
author Lisa.Selle@oracle.com
date Wed, 11 Jun 2014 13:44:09 -0400
parents 18ca3f87dab2
children 9229486ecaea
files modules/graphics/src/main/java/com/sun/glass/ui/monocle/MonocleWindow.java
diffstat 1 files changed, 23 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/MonocleWindow.java	Wed Jun 11 13:32:05 2014 -0400
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/MonocleWindow.java	Wed Jun 11 13:44:09 2014 -0400
@@ -204,10 +204,31 @@
 
     @Override
     protected boolean _minimize(long nativeWindowPointer, boolean minimize) {
-        if (minimize) {
+        int x = getX();
+        int y = getY();
+        int width = getWidth();
+        int height = getHeight();
+        if (minimize && !(state == STATE_MINIMIZED)) {
             state = STATE_MINIMIZED;
-        } else {
+            cachedX = x;
+            cachedY = y;
+            cachedW = width;
+            cachedH = height;
+            // remove the window from the list of visible windows in the
+            // superclass
+            remove(this);
+            notifyResize(WindowEvent.MINIMIZE, width, height);
+
+        } else if (!minimize && state == STATE_MINIMIZED) {
             state = STATE_NORMAL;
+            x = cachedX;
+            y = cachedY;
+            width = cachedW;
+            height = cachedH;
+            // this call will add the window back into the visible list of
+            // windows in the superclass
+            add(this);
+            notifyResize(WindowEvent.RESTORE, width, height);
         }
         return true;
     }