diff options
author | Grant Gayed <ggayed> | 2003-12-08 15:17:45 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2003-12-08 15:17:45 +0000 |
commit | d35aa48bcaa211692c285f9c94fd78538d9e9abd (patch) | |
tree | 25e269e9161f6a67c9b334b215f0abe9a8f785ed /bundles | |
parent | 3a12479add4e4c154ec222719277774ed1afc677 (diff) | |
download | eclipse.platform.swt-d35aa48bcaa211692c285f9c94fd78538d9e9abd.tar.gz eclipse.platform.swt-d35aa48bcaa211692c285f9c94fd78538d9e9abd.tar.xz eclipse.platform.swt-d35aa48bcaa211692c285f9c94fd78538d9e9abd.zip |
48271
Diffstat (limited to 'bundles')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java | 9 | ||||
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java index d854b94f6d..e0f41e0089 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java @@ -2347,7 +2347,14 @@ public void setVisible (boolean visible) { boolean fixFocus = false; if (!visible) fixFocus = isFocusAncestor (); OS.XtSetMappedWhenManaged (topHandle, visible); - if (fixFocus) fixFocus (); + if (fixFocus) fixFocus (); + /* + * It is possible (but unlikely) that application code could + * have disposed the widget in the FocusOut event that is + * triggered by invoking fixFocus() if the widget being hidden + * has focus. If this happens, just return; + */ + if (isDisposed ()) return; sendEvent (visible ? SWT.Show : SWT.Hide); } void setZOrder (Control control, boolean above) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java index 94cd0e8794..9f2d737f13 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java @@ -2370,12 +2370,19 @@ public void setVisible (boolean visible) { if (drawCount != 0) { state = visible ? state & ~HIDDEN : state | HIDDEN; } else { + /* + * It is possible (but unlikely), that application + * code could have disposed the widget in the FocusOut + * event that is triggered by ShowWindow if the widget + * being hidden has focus. If this happens, just return. + */ OS.ShowWindow (handle, visible ? OS.SW_SHOW : OS.SW_HIDE); + if (isDisposed ()) return; } if (!visible) { /* * It is possible (but unlikely), that application - * code could have disposed the widget in the show + * code could have disposed the widget in the hide * event. If this happens, just return. */ sendEvent (SWT.Hide); |