Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2013-01-29 21:54:48 +0000
committerCarolyn MacLeod2013-04-09 14:49:34 +0000
commitbe142a63ac27b1a038db7ed0dc3a410d48bd5cf4 (patch)
tree8e1dd0c64d1e0eb349d0910bd2624b161d93877b
parenta5128313a1e5c0053e581461661af2017cf62dd4 (diff)
downloadeclipse.platform.swt-be142a63ac27b1a038db7ed0dc3a410d48bd5cf4.tar.gz
eclipse.platform.swt-be142a63ac27b1a038db7ed0dc3a410d48bd5cf4.tar.xz
eclipse.platform.swt-be142a63ac27b1a038db7ed0dc3a410d48bd5cf4.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);

Back to the top