vcl/source/control/scrbar.cxx | 7 +++++++ 1 file changed, 7 insertions(+)
New commits: commit 035830432efac57939b8630e9b4471aa15cf62da Author: Patrick Luby <[email protected]> AuthorDate: Thu Dec 12 10:45:21 2024 -0500 Commit: Xisco Fauli <[email protected]> CommitDate: Mon Dec 16 10:29:02 2024 +0100 tdf#147067 Jump to clicked spot if left mouse click with Option key Most macOS applications such as TextEdit and Safari jump to the clicked spot if the Option key is pressed during a left mouse click. Change-Id: I56149e42daf1825cfebde8be8cfbb53645b31928 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178369 Tested-by: Jenkins Reviewed-by: Patrick Luby <[email protected]> (cherry picked from commit 94508506e7f6b9e53c77b631c5d7de1e06ff78d9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178379 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 7218b1485bbb..fc56cc4be24a 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -834,6 +834,13 @@ void ScrollBar::ImplDragThumb( const Point& rMousePos ) void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) { bool bPrimaryWarps = GetSettings().GetStyleSettings().GetPrimaryButtonWarpsSlider(); +#ifdef MACOSX + // tdf#147067 Jump to clicked spot if left mouse click with Option key + // Most macOS applications such as TextEdit and Safari jump to the + // clicked spot if the Option key is pressed during a left mouse click. + if (!bPrimaryWarps && rMEvt.IsLeft() && rMEvt.GetModifier() == KEY_MOD2) + bPrimaryWarps = true; +#endif bool bWarp = bPrimaryWarps ? rMEvt.IsLeft() : rMEvt.IsMiddle(); bool bPrimaryWarping = bWarp && rMEvt.IsLeft(); bool bPage = bPrimaryWarps ? rMEvt.IsRight() : rMEvt.IsLeft();
