vcl/source/control/scrbar.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 94508506e7f6b9e53c77b631c5d7de1e06ff78d9
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Thu Dec 12 10:45:21 2024 -0500
Commit:     Patrick Luby <guibomac...@gmail.com>
CommitDate: Thu Dec 12 17:51:55 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 <guibomac...@gmail.com>

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();

Reply via email to