Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine2005-09-30 16:13:43 +0000
committerVeronika Irvine2005-09-30 16:13:43 +0000
commit6e3d8f8922edf4027f74b86d4b2ca1492cb0f893 (patch)
tree895b0e1b04a41cf1d960926708b7112bbcbf7b46
parentc1a1a19474aa77db233e6db08ae5ebee1c1af114 (diff)
downloadeclipse.platform.swt-6e3d8f8922edf4027f74b86d4b2ca1492cb0f893.tar.gz
eclipse.platform.swt-6e3d8f8922edf4027f74b86d4b2ca1492cb0f893.tar.xz
eclipse.platform.swt-6e3d8f8922edf4027f74b86d4b2ca1492cb0f893.zip
Back porting fix for bug 85072 for 3.0 maintenance streamv3064e
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
index a3f2f4b637..988d40b6da 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java
@@ -1652,4 +1652,37 @@ LRESULT WM_SHOWWINDOW (int wParam, int lParam) {
return result;
}
+LRESULT WM_SYSCOMMAND (int wParam, int lParam) {
+ LRESULT result = super.WM_SYSCOMMAND (wParam, lParam);
+ if (result != null) return result;
+ /*
+ * Feature in Windows. When the last visible window in
+ * a process minimized, Windows swaps out the memory for
+ * the process. The assumption is that the user can no
+ * longer interact with the window, so the memory can be
+ * released to other applications. However, for programs
+ * that use a lot of memory, swapping the memory back in
+ * can take a long time, sometimes minutes. The fix is
+ * to intercept WM_SYSCOMMAND looking for SC_MINIMIZE
+ * and use ShowWindow() with SW_SHOWMINIMIZED to minimize
+ * the window, rather than running the default window proc.
+ *
+ * NOTE: The default window proc activates the next
+ * top-level window in the Z-order while ShowWindow()
+ * with SW_SHOWMINIMIZED does not. There is no fix for
+ * this at this time.
+ */
+ if (OS.IsWinNT) {
+ int cmd = wParam & 0xFFF0;
+ switch (cmd) {
+ case OS.SC_MINIMIZE:
+ long memory = Runtime.getRuntime ().totalMemory ();
+ if (memory >= 32 * 1024 * 1024) {
+ OS.ShowWindow (handle, OS.SW_SHOWMINIMIZED);
+ return LRESULT.ZERO;
+ }
+ }
+ }
+ return result;
+}
}

Back to the top