summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java5
2 files changed, 13 insertions, 3 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 4228e0a882..c628d5cc0a 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
@@ -104,7 +104,7 @@ import org.eclipse.swt.graphics.*;
*/
public class Shell extends Decorations {
int shellHandle, windowGroup;
- boolean resized, moved, drawing, reshape, update, activate, disposed;
+ boolean resized, moved, drawing, reshape, update, activate, disposed, opened;
int invalRgn;
Control lastActive;
Region region;
@@ -371,6 +371,10 @@ void bringToTop (boolean force) {
}
}
+void checkOpen () {
+ if (!opened) resized = false;
+}
+
/**
* Requests that the window manager close the receiver in
* the same way it would be closed when the user clicks on
@@ -1373,6 +1377,9 @@ public void setVisible (boolean visible) {
void setWindowVisible (boolean visible) {
if (OS.IsWindowVisible (shellHandle) == visible) return;
if (visible) {
+ sendEvent (SWT.Show);
+ if (isDisposed ()) return;
+ opened = true;
if (!moved) {
moved = true;
sendEvent (SWT.Move);
@@ -1387,8 +1394,6 @@ void setWindowVisible (boolean visible) {
updateLayout (false);
}
}
- sendEvent (SWT.Show);
- if (isDisposed ()) return;
int inModalKind = OS.kWindowModalityNone;
if ((style & SWT.PRIMARY_MODAL) != 0) inModalKind = OS.kWindowModalityWindowModal;
if ((style & SWT.APPLICATION_MODAL) != 0) inModalKind = OS.kWindowModalityAppModal;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java
index 4a5be7a27d..d713ddd17a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java
@@ -223,6 +223,10 @@ void calculateVisibleRegion (int control, int visibleRgn, boolean clipChildren)
OS.DisposeRgn (tempRgn);
}
+void checkOpen () {
+ /* Do nothing */
+}
+
void checkOrientation (Widget parent) {
style &= ~SWT.MIRRORED;
if ((style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT)) == 0) {
@@ -237,6 +241,7 @@ void checkOrientation (Widget parent) {
void checkParent (Widget parent) {
if (parent == null) error (SWT.ERROR_NULL_ARGUMENT);
parent.checkWidget ();
+ parent.checkOpen ();
}
/**