diff options
author | Juergen Funk <juergen.funk_ml@cib.de> | 2014-10-21 15:28:02 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-11-03 11:31:34 +0000 |
commit | fa022a9c4fe74f3f67fb3c35ef49022842d7499b (patch) | |
tree | 52e1ddc35faa091a44984f2bb1ac3c58a4ec3f43 | |
parent | 98c95ce3a759a6f691c20cb1e376fa54a9dfdbc0 (diff) |
fdo#84795 Menu, DropDown-List don't disappear with right mouse click
this includes a fix to leave disabled menu entries disabled.
This reverts commit 454f5c3018c6d61d5872f7c23c7590c2157444e4.
Change-Id: Ifb66b0b241378437f040af19ec163da3cb8d815d
Reviewed-on: https://gerrit.libreoffice.org/12061
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
-rw-r--r-- | vcl/source/control/ilstbox.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/winproc.cxx | 47 |
3 files changed, 33 insertions, 24 deletions
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 5dea2fdf416d..62db0c7afd92 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -3073,7 +3073,10 @@ void ImplListBoxFloatingWindow::StartFloat( bool bStartTracking ) if( pGrandparent->ImplIsAntiparallel() ) pGrandparentOutDev->ReMirror( aRect ); - StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN ); + // mouse-button right: close the List-Box-Float-win and don't stop the handling fdo#84795 + const sal_uLong nFlags = FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK | FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE; + + StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN | nFlags ); if( nPos != LISTBOX_ENTRY_NOTFOUND ) mpImplLB->ShowProminentEntry( nPos ); diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index c65930cc655f..546725aed72b 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2816,8 +2816,9 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_ WinBits nStyle = WB_BORDER; if (bRealExecute) nPopupModeFlags |= FLOATWIN_POPUPMODE_NEWLEVEL; - if (!pStartedFrom || !pStartedFrom->IsMenuBar()) - nPopupModeFlags |= FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK | FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE; + + // mouse-button right: close the sub-menu (float-win) and don't stop the handling fdo#84795 + nPopupModeFlags |= FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK | FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE; nPopupModeFlags |= FLOATWIN_POPUPMODE_NOKEYCLOSE; diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index be88ec3ec4bc..62974ca3621e 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -60,7 +60,9 @@ bool ImplCallPreNotify( NotifyEvent& rEvt ) || rEvt.GetWindow()->PreNotify( rEvt ); } -static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePos, + +enum ENUM_IHMFM {IHMFM_FALSE = 0, IHMFM_TRUE = 1, IHMFM_FLOAT = 2}; +static sal_uInt16 ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePos, sal_uInt16 nCode, sal_uInt16 nSVEvent, bool bMouseLeave ) { @@ -80,14 +82,14 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo if ( nSVEvent == EVENT_MOUSEMOVE ) { if ( bMouseLeave ) - return true; + return IHMFM_TRUE; if ( !pFloat || (nHitTest == HITTEST_RECT) ) { if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp ) ImplDestroyHelpWindow( true ); pChild->ImplGetFrame()->SetPointer( POINTER_ARROW ); - return true; + return IHMFM_TRUE; } } else @@ -101,13 +103,13 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat(); nPopupFlags = pLastLevelFloat->GetPopupModeFlags(); pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL ); - return true; + return IHMFM_FLOAT | IHMFM_TRUE; // don't stop the handling fdo#84795 } else if ( nHitTest == HITTEST_RECT ) { if ( !(pFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE) ) pFloat->ImplSetMouseDown(); - return true; + return IHMFM_TRUE; } } else @@ -118,7 +120,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo { if ( pFloat->ImplIsMouseDown() ) pFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL ); - return true; + return IHMFM_TRUE; } } else @@ -128,7 +130,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo if ( !(nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) ) { pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL ); - return true; + return IHMFM_TRUE; } } } @@ -143,21 +145,21 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo { if ( (nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) && (nSVEvent == EVENT_MOUSEBUTTONUP) ) - return true; + return IHMFM_TRUE; pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL ); if ( nPopupFlags & FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK ) - return false; + return IHMFM_FLOAT | IHMFM_FALSE; else - return true; + return IHMFM_TRUE; } else - return true; + return IHMFM_TRUE; } } } } - return false; + return IHMFM_FALSE; } static void ImplHandleMouseHelpRequest( vcl::Window* pChild, const Point& rMousePos ) @@ -381,7 +383,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous // #106845# if the window was disabed during capturing we have to pass the mouse events to release capturing if ( pSVData->maWinData.mpCaptureWin != pChild && (!pChild->IsEnabled() || !pChild->IsInputEnabled() || pChild->IsInModalNonRefMode() ) ) { - ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave ); + sal_uInt16 FloatHdl = (ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave ) & IHMFM_FLOAT); if ( nSVEvent == EVENT_MOUSEMOVE ) { ImplHandleMouseHelpRequest( pChild, aMousePos ); @@ -401,15 +403,18 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous pChild->ImplNotifyKeyMouseCommandEventListeners( aNEvt ); } - if ( nSVEvent == EVENT_MOUSEBUTTONDOWN ) - return true; - else + if(FloatHdl != IHMFM_FLOAT) // mouse-button left: don't stop the handling for the click fdo#84795 { - // Set normal MousePointer for disabled windows - if ( nSVEvent == EVENT_MOUSEMOVE ) - ImplSetMousePointer( pChild ); + if ( nSVEvent == EVENT_MOUSEBUTTONDOWN ) + return true; + else + { + // Set normal MousePointer for disabled windows + if ( nSVEvent == EVENT_MOUSEMOVE ) + ImplSetMousePointer( pChild ); - return false; + return false; + } } } @@ -638,7 +643,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous { ImplDelData aDelData; pChild->ImplAddDel( &aDelData ); - if ( ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave ) ) + if ( (ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave ) & ~IHMFM_FLOAT) == IHMFM_TRUE ) { if ( !aDelData.IsDead() ) { |