summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2013-01-29 16:54:48 -0500
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2013-01-29 16:54:48 -0500
commit1dacd3e9ed06c61e8552e31c6adebb0ab30245ee (patch)
tree4250fee5a4f2f844ba45e012c6c981a39064f61e
parentd008ab43eb2c44b8c01d0f7ff505ec8ab91774bd (diff)
downloadeclipse.platform.swt-1dacd3e9ed06c61e8552e31c6adebb0ab30245ee.tar.gz
eclipse.platform.swt-1dacd3e9ed06c61e8552e31c6adebb0ab30245ee.tar.xz
eclipse.platform.swt-1dacd3e9ed06c61e8552e31c6adebb0ab30245ee.zip
Bug 399151 - Focus is not passed to the next window after a window minimized
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java11
1 files changed, 10 insertions, 1 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 bff0bfaf6d..976fab44c5 100644
--- 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
@@ -2519,7 +2519,7 @@ LRESULT WM_SYSCOMMAND (long /*int*/ wParam, long /*int*/ lParam) {
if (result != null) return result;
/*
* Feature in Windows. When the last visible window in
- * a process minimized, Windows swaps out the memory for
+ * a process is 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
@@ -2538,6 +2538,15 @@ LRESULT WM_SYSCOMMAND (long /*int*/ wParam, long /*int*/ lParam) {
int cmd = (int)/*64*/wParam & 0xFFF0;
switch (cmd) {
case OS.SC_MINIMIZE:
+ Shell [] shells = display.getShells ();
+ int count = 0;
+ for (int i = 0; i < shells.length; i++) {
+ Shell shell = shells [i];
+ if (shell != null && shell.getVisible () && !shell.getMinimized ()) {
+ count++;
+ }
+ }
+ if (count > 1) break;
long memory = Runtime.getRuntime ().totalMemory ();
if (memory >= 32 * 1024 * 1024) {
OS.ShowWindow (handle, OS.SW_SHOWMINIMIZED);