grabbing changed to restore grab at hiding time,
authorca
Wed, 08 Dec 1999 21:38:40 +0100
changeset 2068 302847f5d01d
parent 2067 99763d5655ce
child 2069 8703ed21c1ce
grabbing changed to restore grab at hiding time, to allow popups in popups and ext-comboBoxes
PopUpMenu.st
--- a/PopUpMenu.st	Tue Dec 07 14:03:50 1999 +0100
+++ b/PopUpMenu.st	Wed Dec 08 21:38:40 1999 +0100
@@ -1220,6 +1220,15 @@
     ].
 
     "Modified: 25.2.1997 / 22:11:53 / cg"
+!
+
+hideForAction
+    "hide the menu - if there are any pop-up-submenus, hide them also.
+     Any superMenu is not asked to regain control, since we are going to
+     hide them also."
+
+    menuView hideSubmenu.
+    super hide.
 ! !
 
 !PopUpMenu methodsFor:'dummy'!
@@ -1450,11 +1459,14 @@
 !
 
 regainControl
-    device ungrabPointer.
-    device ungrabKeyboard.
-    shown ifTrue:[
-        device grabPointerInView:self.
-        device grabKeyboardInView:self.
+|g|
+    ((g := device activePointerGrab) ~~ self) ifTrue:[
+        self forceUngrabPointer.
+        self forceUngrabKeyboard.
+        shown ifTrue:[
+            self grabPointer.
+            self grabKeyboard.
+        ]
     ].
 
     "Modified: / 20.11.1997 / 00:32:32 / cg"
@@ -1524,5 +1536,5 @@
 !PopUpMenu class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/PopUpMenu.st,v 1.82 1999-12-07 13:03:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/PopUpMenu.st,v 1.83 1999-12-08 20:38:40 ca Exp $'
 ! !