Commit 87b30c3c authored by Erwan Tulou's avatar Erwan Tulou Committed by Jean-Baptiste Kempf

skins2: key handling (cosmetics)

(cherry picked from commit 1a64a930b2974f80d7a43cba12f8bbf50718d1c0)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 3d2c0a22
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment