diff options
author | Patrick Luby <guibmacdev@gmail.com> | 2025-03-10 10:08:41 -0400 |
---|---|---|
committer | Patrick Luby <guibomacdev@gmail.com> | 2025-03-18 23:38:36 +0100 |
commit | 1c4c24042cbe0ede59513d30a676442f7f238b62 (patch) | |
tree | 889fd1c51b23bc14f6ac01d77bdaa533419a7550 /vcl | |
parent | 2b1f913c8ea90c60fed50596e27e2328b1a7d788 (diff) |
tdf#151423 allow trackpad or Magic Mouse to behave like a regular mouse
Give both trackpad and Magic Mouse users the option to restore
the legacy zoom via Command+swipe gesture.
The IgnoreKeysWhenScrollingWithTrackpadOrMagicMouse preference is
set to true by default and that disables zooming via swiping.
The problem is that while trackpad users are able to zoom via a
magnify gesture, the Magic Mouse doesn't have a magnify gesture.
Since I have not found a reliable way to distinguish a Magic Mouse
from a trackpad, Magic Mouse users have no obvious replacement
for the zoom via Command+swipe gesture.
Change-Id: Ic2fa5ba153ecb3d7a7cd4711549288b28e6591d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182740
Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/osx/salframeview.mm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 3373ca2091b5..74da526f6ba4 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -22,6 +22,7 @@ #include <memory> #include <basegfx/numeric/ftools.hxx> +#include <officecfg/Office/Common.hxx> #include <sal/macros.h> #include <tools/helpers.hxx> #include <tools/long.hxx> @@ -240,6 +241,19 @@ static void freezeWindowSizeAndReschedule( NSWindow *pWindow ) static bool isMouseScrollWheelEvent( NSEvent *pEvent ) { + // tdf#151423 allow trackpad or Magic Mouse to behave like a regular mouse + // Give both trackpad and Magic Mouse users the option to restore + // the legacy zoom via Command+swipe gesture. + // The IgnoreKeysWhenScrollingWithTrackpadOrMagicMouse preference is + // set to true by default and that disables zooming via swiping. + // The problem is that while trackpad users are able to zoom via a + // magnify gesture, the Magic Mouse doesn't have a magnify gesture. + // Since I have not found a reliable way to distinguish a Magic Mouse + // from a trackpad, Magic Mouse users have no obvious replacement + // for the zoom via Command+swipe gesture. + if ( !officecfg::Office::Common::VCL::macOS::IgnoreKeysWhenScrollingWithTrackpadOrMagicMouse::get() ) + return true; + return ( pEvent && [pEvent type] == NSEventTypeScrollWheel && [pEvent phase] == NSEventPhaseNone && [pEvent momentumPhase] == NSEventPhaseNone ); } |