[vlc-commits] skins2: key handling (cosmetics)

Erwan Tulou git at videolan.org
Thu Mar 22 22:24:02 CET 2012


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Thu Mar 22 18:51:16 2012 +0100| [1a64a930b2974f80d7a43cba12f8bbf50718d1c0] | committer: Erwan Tulou

skins2: key handling (cosmetics)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1a64a930b2974f80d7a43cba12f8bbf50718d1c0
---

 modules/gui/skins2/src/top_window.cpp |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/modules/gui/skins2/src/top_window.cpp b/modules/gui/skins2/src/top_window.cpp
index 2cadcb2..4c27bac 100644
--- a/modules/gui/skins2/src/top_window.cpp
+++ b/modules/gui/skins2/src/top_window.cpp
@@ -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



More information about the vlc-commits mailing list