summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Kovatch <skovatch>2011-02-07 16:48:57 +0000
committerScott Kovatch <skovatch>2011-02-07 16:48:57 +0000
commit02f0ef9cfec4b6452ddc1aa6045fea59dd39394d (patch)
tree1573d37bae962cdc1d9d9410ee3861da2a3d9464
parentb265e38867bfd45d7359718a0580ad942a65de59 (diff)
downloadeclipse.platform.swt-02f0ef9cfec4b6452ddc1aa6045fea59dd39394d.tar.gz
eclipse.platform.swt-02f0ef9cfec4b6452ddc1aa6045fea59dd39394d.tar.xz
eclipse.platform.swt-02f0ef9cfec4b6452ddc1aa6045fea59dd39394d.zip
329872 - commit change from 3.6 branch to HEAD.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java
index 99742b07a4..31c02090f9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java
@@ -122,7 +122,7 @@ import org.eclipse.swt.graphics.*;
public class Shell extends Decorations {
int shellHandle, windowGroup;
boolean resized, moved, drawing, reshape, update, deferDispose, active, disposed, opened, fullScreen, center;
- boolean showWithParent, ignoreBounds;
+ boolean showWithParent, ignoreBounds, isActivating;
int invalRgn;
Control lastActive;
Rect rgnRect;
@@ -1103,6 +1103,7 @@ int kEventWindowActivated (int nextHandler, int theEvent, int userData) {
deferDispose = true;
Display display = this.display;
display.activeShell = this;
+ isActivating = true;
display.setMenuBar (menuBar);
if (menuBar != null) OS.DrawMenuBar ();
sendEvent (SWT.Activate);
@@ -1110,6 +1111,7 @@ int kEventWindowActivated (int nextHandler, int theEvent, int userData) {
if (!restoreFocus () && !traverseGroup (true)) setFocus ();
if (isDisposed ()) return result;
display.activeShell = null;
+ isActivating = false;
Shell parentShell = this;
while (parentShell.parent != null) {
parentShell = (Shell) parentShell.parent;
@@ -1189,7 +1191,13 @@ int kEventWindowDeactivated (int nextHandler, int theEvent, int userData) {
}
void kEventWindowDeactivated () {
- if (active) {
+ /*
+ * Bug in Mac OS X. When calling SelectWindow on a window with kWindowModalityWindowModal during
+ * kEventWindowGetClickModality, multiple activation events are sent to the window even though the
+ * window is already active. This will cause flicker as windows activate and deactivate.
+ * Fix is to ignore deactivation events while processing an activation event.
+ */
+ if (active && !isActivating) {
active = false;
deferDispose = true;
Display display = this.display;