Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Gheorghe2011-09-06 16:14:45 -0400
committerNiraj Modi2014-07-07 05:46:11 -0400
commit7167a8d257b060f461eda3825966aebb9f68e8b2 (patch)
tree1c5f81fc938ced338ddc0eb29b2536b29de3eac9
parent7336c8083ccfd8694a3ef3bb25b703807e9c45a4 (diff)
downloadeclipse.platform.swt-R3_6_maintenance.tar.gz
eclipse.platform.swt-R3_6_maintenance.tar.xz
eclipse.platform.swt-R3_6_maintenance.zip
355149 - Workbench window rendering very slow when restored fromv3659jR3_6_maintenance
minimized state if previously maximized
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java1
-rw-r--r--[-rwxr-xr-x]bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java20
2 files changed, 20 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
index f785acbcbb..e94de35a75 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
@@ -2140,6 +2140,7 @@ public class OS extends C {
public static final int WM_VSCROLL = 0x115;
public static final int WM_WINDOWPOSCHANGED = 0x47;
public static final int WM_WINDOWPOSCHANGING = 0x46;
+ public static final int WPF_RESTORETOMAXIMIZED = 0x0002;
public static final int WS_BORDER = 0x800000;
public static final int WS_CAPTION = 0xc00000;
public static final int WS_CHILD = 0x40000000;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java
index 6052f6bf20..ea39737805 100755..100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java
@@ -107,6 +107,7 @@ public class Decorations extends Canvas {
boolean moved, resized, opened;
int oldX = OS.CW_USEDEFAULT, oldY = OS.CW_USEDEFAULT;
int oldWidth = OS.CW_USEDEFAULT, oldHeight = OS.CW_USEDEFAULT;
+ RECT maxRect = new RECT();
/**
* Prevents uninitialized instances from being created outside the package.
@@ -485,6 +486,11 @@ public Rectangle getBounds () {
WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();
lpwndpl.length = WINDOWPLACEMENT.sizeof;
OS.GetWindowPlacement (handle, lpwndpl);
+ if ((lpwndpl.flags & OS.WPF_RESTORETOMAXIMIZED) != 0) {
+ int width = maxRect.right - maxRect.left;
+ int height = maxRect.bottom - maxRect.top;
+ return new Rectangle (maxRect.left, maxRect.top, width, height);
+ }
int width = lpwndpl.right - lpwndpl.left;
int height = lpwndpl.bottom - lpwndpl.top;
return new Rectangle (lpwndpl.left, lpwndpl.top, width, height);
@@ -515,6 +521,9 @@ public Rectangle getClientArea () {
WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();
lpwndpl.length = WINDOWPLACEMENT.sizeof;
OS.GetWindowPlacement (handle, lpwndpl);
+ if ((lpwndpl.flags & OS.WPF_RESTORETOMAXIMIZED) != 0) {
+ return new Rectangle (0, 0, oldWidth, oldHeight);
+ }
int width = lpwndpl.right - lpwndpl.left;
int height = lpwndpl.bottom - lpwndpl.top;
/*
@@ -630,6 +639,9 @@ public Point getLocation () {
WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();
lpwndpl.length = WINDOWPLACEMENT.sizeof;
OS.GetWindowPlacement (handle, lpwndpl);
+ if ((lpwndpl.flags & OS.WPF_RESTORETOMAXIMIZED) != 0) {
+ return new Point (maxRect.left, maxRect.top);
+ }
return new Point (lpwndpl.left, lpwndpl.top);
}
}
@@ -705,6 +717,11 @@ public Point getSize () {
WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();
lpwndpl.length = WINDOWPLACEMENT.sizeof;
OS.GetWindowPlacement (handle, lpwndpl);
+ if ((lpwndpl.flags & OS.WPF_RESTORETOMAXIMIZED) != 0) {
+ int width = maxRect.right - maxRect.left;
+ int height = maxRect.bottom - maxRect.top;
+ return new Point (width, height);
+ }
int width = lpwndpl.right - lpwndpl.left;
int height = lpwndpl.bottom - lpwndpl.top;
return new Point (width, height);
@@ -1757,8 +1774,9 @@ LRESULT WM_SIZE (int /*long*/ wParam, int /*long*/ lParam) {
if (resized) {
int newWidth = 0, newHeight = 0;
switch ((int)/*64*/wParam) {
- case OS.SIZE_RESTORED:
case OS.SIZE_MAXIMIZED:
+ OS.GetWindowRect (handle, maxRect);
+ case OS.SIZE_RESTORED:
newWidth = OS.LOWORD (lParam);
newHeight = OS.HIWORD (lParam);
break;

Back to the top