diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2016-10-09 10:13:12 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2016-10-11 00:06:43 +0300 |
commit | e48d1086d79c319b31d48b984840a424780deefa (patch) | |
tree | 9fab985c3b633c04ff952002e2d6e4157a86ce14 | |
parent | 8e8afc358b7537d493b478b429e1711c6ab46bdc (diff) |
The key event is not needed for the non-ToolBox case
Change-Id: I8d593665f1c2bcafa583eca311cd86ab618dec3d
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 8a82de7b689d..497d316de133 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -1043,10 +1043,12 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin if( mpOldBorderWin.get() == GetWindow() ) mpOldBorderWin = nullptr; // no border window found + bool bAllowTearOff = bool( nFlags & FloatWinPopupFlags::AllowTearOff ); + bool bIsToolBox = GetWindow()->GetType() == WINDOW_TOOLBOX; + // the new parent for popup mode VclPtr<FloatingWindow> pWin; - bool bAllowTearOff = bool( nFlags & FloatWinPopupFlags::AllowTearOff ); - if ( bAllowTearOff && !dynamic_cast< ToolBox* >( GetWindow() ) ) + if ( bAllowTearOff && !bIsToolBox ) pWin = VclPtr<FloatingWindow>::Create( mpParent, WB_STDPOPUP ); else pWin = VclPtr<ImplPopupFloatWin>::Create( mpParent, this, bAllowTearOff ); @@ -1087,7 +1089,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin mpFloatWin->StartPopupMode( pParentToolBox, nFlags ); GetWindow()->Show(); - if( pParentToolBox->IsKeyEvent() ) + if( bIsToolBox && pParentToolBox->IsKeyEvent() ) { // send HOME key to subtoolbar in order to select first item KeyEvent aEvent( 0, vcl::KeyCode( KEY_HOME ) ); |