diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT')
6 files changed, 31 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java index 1db02263bd..9d2aa12979 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java @@ -101,7 +101,7 @@ import org.eclipse.swt.events.*; */ public class Shell extends Decorations { int /*long*/ shellHandle, tooltipsHandle; - boolean hasFocus, mapped, moved, resized; + boolean hasFocus, mapped, moved, resized, opened; int oldX, oldY, oldWidth, oldHeight; int minWidth, minHeight; Control lastActive; @@ -435,6 +435,10 @@ void checkBorder () { /* Do nothing */ } +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 @@ -1287,6 +1291,7 @@ public void setVisible (boolean visible) { if ((style & mask) != 0) { OS.gdk_pointer_ungrab (OS.GDK_CURRENT_TIME); } + opened = true; if (!moved) { moved = true; Point location = getLocation(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java index d7fabd452e..f21f56eea5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java @@ -240,6 +240,10 @@ static int checkBits (int style, int int0, int int1, int int2, int int3, int int return style; } +void checkOpen () { + /* Do nothing */ +} + void checkOrientation (Widget parent) { style &= ~SWT.MIRRORED; if ((style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT)) == 0) { @@ -266,6 +270,7 @@ void checkOrientation (Widget parent) { void checkParent (Widget parent) { if (parent == null) error (SWT.ERROR_NULL_ARGUMENT); parent.checkWidget (); + parent.checkOpen (); } /** diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Shell.java index 8a7dad3818..ec35e687c3 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Shell.java @@ -101,7 +101,7 @@ import org.eclipse.swt.events.*; */ public class Shell extends Decorations { int shellHandle, focusProxy; - boolean reparented, realized, moved, resized; + boolean reparented, realized, moved, resized, opened; int oldX, oldY, oldWidth, oldHeight; Control lastActive; Region region; @@ -485,6 +485,9 @@ void bringToTop (boolean force) { } OS.XSetInputFocus (xDisplay, xWindow, OS.RevertToParent, OS.CurrentTime); } +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 @@ -1492,6 +1495,7 @@ public void setVisible (boolean visible) { if ((style & mask) != 0) { OS.XUngrabPointer (display.xDisplay, OS.CurrentTime); } + opened = true; if (!moved) { moved = true; Point location = getLocation (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Widget.java index cd00af572a..5ce9790494 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Widget.java @@ -200,6 +200,9 @@ static int checkBits (int style, int int0, int int1, int int2, int int3, int int if ((style & int5) != 0) style = (style & ~mask) | int5; return style; } +void checkOpen () { + /* Do nothing */ +} void checkOrientation (Widget parent) { style &= ~SWT.MIRRORED; if ((style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT)) == 0) { @@ -213,6 +216,7 @@ void checkOrientation (Widget parent) { void checkParent (Widget parent) { if (parent == null) error (SWT.ERROR_NULL_ARGUMENT); parent.checkWidget (); + parent.checkOpen (); } /** * Checks that this class can be subclassed. diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java index 24a3e93788..725e10d183 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java @@ -101,7 +101,7 @@ public class Decorations extends Canvas { Control savedFocus; Button defaultButton, saveDefault; int swFlags, hAccel, nAccel; - boolean moved, resized; + boolean moved, resized, opened; int oldX = OS.CW_USEDEFAULT, oldY = OS.CW_USEDEFAULT; int oldWidth = OS.CW_USEDEFAULT, oldHeight = OS.CW_USEDEFAULT; @@ -232,6 +232,10 @@ void checkBorder () { /* Do nothing */ } +void checkOpened () { + if (!opened) resized = false; +} + protected void checkSubclass () { if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS); } @@ -1296,6 +1300,7 @@ public void setVisible (boolean visible) { OS.ShowWindow (handle, swFlags); } if (isDisposed ()) return; + opened = true; if (!moved) { moved = true; Point location = getLocation (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java index e33b36f659..694f394e50 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java @@ -213,6 +213,10 @@ void checkOrientation (Widget parent) { style = checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0); } +void checkOpened () { + /* Do nothing */ +} + /** * Throws an exception if the specified widget can not be * used as a parent for the receiver. @@ -228,6 +232,7 @@ void checkOrientation (Widget parent) { void checkParent (Widget parent) { if (parent == null) error (SWT.ERROR_NULL_ARGUMENT); parent.checkWidget (); + parent.checkOpened (); } /** |