src/hbcore/gui/hbpopupmanager.cpp
changeset 6 c3690ec91ef8
parent 5 627c4a0fd0e7
child 21 4633027730f5
child 34 ed14f46c0e55
--- a/src/hbcore/gui/hbpopupmanager.cpp	Fri Jun 11 13:58:22 2010 +0300
+++ b/src/hbcore/gui/hbpopupmanager.cpp	Wed Jun 23 18:33:25 2010 +0300
@@ -182,14 +182,13 @@
 {
     Q_UNUSED( obj );
     switch( event->type() ) {
-        case QEvent::LayoutRequest: {
-                updateGeometry();
-            break;
-        }
-        case QEvent::ContextMenu: {
+        case QEvent::LayoutRequest:
+        case QEvent::ContextMenu:
+        case QEvent::Close:
+            {
             updateGeometry();
             break;
-        }
+            }
         default:
             break;
     }
@@ -493,7 +492,8 @@
 
             // Move the focus to the initial focus item if there is no current focus item or
             // the ancestor of the current fucus item is popup
-            if( !scene->focusItem() || popup->hasFocus() || popup->isAncestorOf(scene->focusItem())) {
+            if( !scene->focusItem() || scene->focusItem() == popup ||
+                popup->isAncestorOf(scene->focusItem())) {
                 initialFocusedItem->setFocus();
                 initialFocusedItem = 0;
             }