summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Funk <juergen.funk_ml@cib.de>2014-10-09 15:44:29 +0200
committerSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2014-10-10 10:09:44 +0000
commit53c836701e22b1babd3702b502facd76236df7ff (patch)
treed6424718c91fadbac958b71e385767a06352ac31
parentfaa6455995966e41653204779d055b885b27fc4c (diff)
Fix fdo#84795 Menu, DropDown-List not disappears with right mouse click
Set for menu and float-list-box the PopupModeFlags to FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK + FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE Improving the comments Change-Id: I313e4ec38637fa3d46567e08bdb9560ce8475b6a Reviewed-on: https://gerrit.libreoffice.org/11881 Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com> Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
-rw-r--r--vcl/source/control/ilstbox.cxx5
-rw-r--r--vcl/source/window/menu.cxx5
-rw-r--r--vcl/source/window/winproc.cxx21
3 files changed, 19 insertions, 12 deletions
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index a1dea0d77724..d936d3b2f6dc 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 582fdcb63800..cc34a1f595e8 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 a677af194432..18e2f4511ede 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -101,7 +101,7 @@ 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 false; // don't stop the handling fdo#84795
}
else if ( nHitTest == HITTEST_RECT )
{
@@ -381,7 +381,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 );
+ bool bStopHdl = ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave );
if ( nSVEvent == EVENT_MOUSEMOVE )
{
ImplHandleMouseHelpRequest( pChild, aMousePos );
@@ -401,15 +401,18 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, sal_uInt16 nSVEvent, bool bMous
pChild->ImplNotifyKeyMouseCommandEventListeners( aNEvt );
}
- if ( nSVEvent == EVENT_MOUSEBUTTONDOWN )
- return true;
- else
+ if(bStopHdl) // 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;
+ }
}
}