diff options
-rw-r--r-- | vcl/source/window/menubarwindow.cxx | 9 | ||||
-rw-r--r-- | vcl/source/window/menubarwindow.hxx | 1 | ||||
-rw-r--r-- | vcl/source/window/taskpanelist.cxx | 10 |
3 files changed, 13 insertions, 7 deletions
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 8f496ea25dc6..4b72e0b5bbf9 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -1178,4 +1178,13 @@ bool MenuBarWindow::HandleMenuButtonEvent( sal_uInt16 i_nButtonId ) return false; } +bool MenuBarWindow::CanGetFocus() const +{ + /* #i83908# do not use the menubar if it is native and invisible + this relies on MenuBar::ImplCreate setting the height of the menubar + to 0 in this case + */ + return GetSizePixel().Height() > 0; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/menubarwindow.hxx b/vcl/source/window/menubarwindow.hxx index 8565eb03b7bf..57127b1fbaac 100644 --- a/vcl/source/window/menubarwindow.hxx +++ b/vcl/source/window/menubarwindow.hxx @@ -148,6 +148,7 @@ public: bool GetMBWHideAccel() const { return mbHideAccel; } void SetMBWMenuKey(bool val) { mbMenuKey = val; } bool GetMBWMenuKey() const { return mbMenuKey; } + bool CanGetFocus() const; }; #endif // INCLUDED_VCL_SOURCE_WINDOW_MENUBARWINDOW_HXX diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx index 238f8fa739d0..3b9a3d9e62a0 100644 --- a/vcl/source/window/taskpanelist.cxx +++ b/vcl/source/window/taskpanelist.cxx @@ -23,6 +23,7 @@ #include <vcl/taskpanelist.hxx> #include <svdata.hxx> +#include "menubarwindow.hxx" #include <functional> #include <algorithm> @@ -161,9 +162,7 @@ bool TaskPaneList::HandleKeyEvent(const KeyEvent& rKeyEvent) bool bForward = !aKeyCode.IsShift(); if( aKeyCode.GetCode() == KEY_F6 && ! aKeyCode.IsMod2() ) // F6 { - bool bSplitterOnly; - - bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift(); + bool bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift(); // is the focus in the list ? auto p = mTaskPanes.begin(); @@ -280,12 +279,9 @@ vcl::Window* TaskPaneList::FindNextFloat( vcl::Window *pWindow, bool bForward ) if( p == mTaskPanes.end() ) break; // do not wrap, send focus back to document at end of list /* #i83908# do not use the menubar if it is native and invisible - this relies on MenuBar::ImplCreate setting the height of the menubar - to 0 in this case */ if( (*p)->IsReallyVisible() && !(*p)->ImplIsSplitter() && - ( (*p)->GetType() != WINDOW_MENUBARWINDOW || (*p)->GetSizePixel().Height() > 0 ) - ) + ( (*p)->GetType() != WINDOW_MENUBARWINDOW || static_cast<MenuBarWindow*>(p->get())->CanGetFocus() ) ) { pWindow = *p; break; |