ecere: Native Decorations: Fix for proper positioning of windows when dock is at...
authorJerome St-Louis <jerome@ecere.com>
Mon, 15 Aug 2011 04:53:03 +0000 (00:53 -0400)
committerJerome St-Louis <jerome@ecere.com>
Mon, 15 Aug 2011 04:53:03 +0000 (00:53 -0400)
ecere/src/gui/GuiApplication.ec
ecere/src/gui/drivers/Win32Interface.ec

index 98bfa32..7b3faea 100644 (file)
@@ -378,8 +378,19 @@ public class GuiApplication : Application
 
       if((windowResized || windowMoved) && moveChildren)
       {
-         //Window child;
+         Window child;
          desktop.Position(x, y, w, h, true, true, true, true, false, false);
+
+         // Maximized native decorations windows suffer when we drag the dock around, so remaximize them
+         // It's a little jumpy, but oh well.
+         for(child = desktop.children.first; child; child = child.next)
+         {
+            if(child.nativeDecorations && child.rootWindow == child && child.state == maximized)
+            {
+               child.state = normal;
+               child.state = maximized;
+            }
+         }
          /*for(child = desktop.children.first; child; child = child.next)
          {
             if(!child.systemParent)
index 613c177..1241b46 100644 (file)
@@ -882,8 +882,9 @@ class Win32Interface : Interface
                placement.length = sizeof(WINDOWPLACEMENT);
                GetWindowRect(windowHandle, &rcWindow);
                GetWindowPlacement(windowHandle, &placement);
-               x = rcWindow.left;
-               y = rcWindow.top;
+
+               x = rcWindow.left - desktopX;
+               y = rcWindow.top  - desktopY;
                w = rcWindow.right - rcWindow.left;
                h = rcWindow.bottom - rcWindow.top;
 
@@ -953,8 +954,8 @@ class Win32Interface : Interface
                   else if(wParam == SIZE_RESTORED && window.state != normal && window.visible)
                      window.state = normal;
 
-                  x = rcWindow.left;
-                  y = rcWindow.top;
+                  x = rcWindow.left - desktopX;
+                  y = rcWindow.top  - desktopY;
                   w = rcWindow.right - rcWindow.left;
                   h = rcWindow.bottom - rcWindow.top;