]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/src/top_window.cpp
skins2: key handling (cosmetics)
[vlc] / modules / gui / skins2 / src / top_window.cpp
index 2cadcb2109c8626cc32d193b44fbdb0ae6b7193e..4c27bacae38eef4c52fdc311718cdf116f7cb8ac 100644 (file)
@@ -159,28 +159,24 @@ void TopWindow::processEvent( EvtMouse &rEvtMouse )
         // Raise the window
         m_rWindowManager.raise( *this );
 
-        if( pNewHitControl && pNewHitControl->isFocusable() )
+        if( m_pFocusControl != pNewHitControl )
         {
-            // If a new control gains the focus, the previous one loses it
-            if( m_pFocusControl && m_pFocusControl != pNewHitControl )
+            if( m_pFocusControl )
             {
+                // The previous control loses the focus
                 EvtFocus evt( getIntf(), false );
                 m_pFocusControl->handleEvent( evt );
+                m_pFocusControl = NULL;
             }
-            if( pNewHitControl != m_pFocusControl )
+
+            if( pNewHitControl && pNewHitControl->isFocusable() )
             {
+                // The hit control gains the focus
                 m_pFocusControl = pNewHitControl;
                 EvtFocus evt( getIntf(), true );
                 pNewHitControl->handleEvent( evt );
             }
         }
-        else if( m_pFocusControl )
-        {
-            // The previous control loses the focus
-            EvtFocus evt( getIntf(), false );
-            m_pFocusControl->handleEvent( evt );
-            m_pFocusControl = NULL;
-        }
     }
 
     // Send a mouse event to the hit control, or to the control