summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2003-02-04 04:14:00 +0000
committerSteve Northover <steve>2003-02-04 04:14:00 +0000
commit96fd165a61160456fdae7b1059d270095fdb471e (patch)
tree1af80043ecc1efa6b60da8c04d795a16dba685dc /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java
parentadd63531e54321a29c008d33afde4204f0cb5aee (diff)
downloadeclipse.platform.swt-96fd165a61160456fdae7b1059d270095fdb471e.tar.gz
eclipse.platform.swt-96fd165a61160456fdae7b1059d270095fdb471e.tar.xz
eclipse.platform.swt-96fd165a61160456fdae7b1059d270095fdb471e.zip
29265
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java
index e18a0fbd96..57b650e9a6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Decorations.java
@@ -89,6 +89,7 @@ public class Decorations extends Canvas {
boolean minimized, maximized;
Menu menuBar;
Menu [] menus;
+ Control savedFocus;
Button defaultButton, saveDefault;
int accelGroup;
@@ -348,6 +349,23 @@ void releaseWidget () {
image = null;
}
+boolean restoreFocus () {
+ if (savedFocus != null && savedFocus.isDisposed ()) savedFocus = null;
+ boolean restored = savedFocus != null && savedFocus.setFocus ();
+ savedFocus = null;
+ /*
+ * This code is intentionally commented. When no widget
+ * has been given focus, some platforms give focus to the
+ * default button. Motif doesn't do this.
+ */
+// if (restored) return true;
+// if (defaultButton != null && !defaultButton.isDisposed ()) {
+// if (defaultButton.setFocus ()) return true;
+// }
+// return false;
+ return restored;
+}
+
/**
* If the argument is not null, sets the receiver's default
* button to the argument, and if the argument is null, sets
@@ -489,6 +507,11 @@ public void setMinimized (boolean minimized) {
this.minimized = minimized;
}
+void setSavedFocus (Control control) {
+ if (this == control) return;
+ savedFocus = control;
+}
+
/**
* Sets the receiver's text, which is the string that the
* window manager will typically display as the receiver's