Bug 151423 - Unintended zoom in or out on command key press if Calc is still scrolling.
Summary: Unintended zoom in or out on command key press if Calc is still scrolling.
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.6.2 release
Hardware: ARM macOS (All)
: medium normal
Assignee: Patrick (volunteer)
URL:
Whiteboard: target:25.2.0 target:24.8.4
Keywords:
Depends on:
Blocks: Zoom
  Show dependency treegraph
 
Reported: 2022-10-08 13:17 UTC by Thomas Lüder
Modified: 2024-11-18 08:11 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
zoom settings 1 (80.79 KB, image/png)
2024-11-01 23:37 UTC, JR
Details
zoom settings 2 (156.64 KB, image/png)
2024-11-01 23:45 UTC, JR
Details
zoom settings 3 (151.31 KB, image/png)
2024-11-01 23:45 UTC, JR
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Lüder 2022-10-08 13:17:08 UTC
Description:
see steps to Reproduce

As the command key is used on mac to switch apps it is very annoying when you com back to calc it is totally zoomed in or out.

Steps to Reproduce:
1. start scrolling via touchpad by two finger gesture 

2. press command key while calc is still scrolling, but you have stopped touching the touchpad

3. Calc start zooming in or out depending on which way it is still scrolling.


Actual Results:
Calc zoom in or out

Expected Results:
Calc should only start zooming in or out if the command key was presst before the scrolling was started.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.3.6.2 / LibreOffice Community
Build ID: c28ca90fd6e1a19e189fc16c05f8f8924961e12e
CPU threads: 10; OS: Mac OS X 12.6; UI render: default; VCL: osx
Locale: de-DE (en_DE.UTF-8); UI: de-DE
Calc: threaded
Comment 1 Thomas Lüder 2022-12-29 11:58:38 UTC
Hi, Just to let you know why this is so annoying. On mac you use Command and Tab to switch apps. And if a scrolling is still active while switching the app the zoom level changes.

And this is still happening in the latest version from the Mac AppStore
Comment 2 steve 2023-03-14 19:17:43 UTC
Confirmed: new

This has been bothering me for years. Thanks for filing this issue.

macOS 13.2.1
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5f20f4ff21f597e55d899f5ea4dfe1c1fa5824bc
CPU threads: 8; OS: Mac OS X 13.2.1; UI render: Skia/Raster; VCL: osx
Locale: en-US (en_DE.UTF-8); UI: en-US
Calc: threaded
Comment 3 JR 2024-11-01 23:37:51 UTC
Created attachment 197347 [details]
zoom settings 1
Comment 4 JR 2024-11-01 23:43:54 UTC
I've also had this for as long as I've used Libreoffice. I've searched many times how to fix, with most of the responses being that it's not a Libreoffice bug. But it is, because I have this problem with no other app. Specifically I never have zoom happen when scrolling and then pressing command key on macOS.

These apps work perfectly without unintended scrolling:
Pages
Microsoft Excel
Discord
Safari
Firefox
Facebook Messenger
Preview
Alacrity
Apple Messages
Mailmate

I've included my settings above as attachment 197347 [details] and I'll update with two more images. Note in here I have nearly every accessibility setting off related to things like this.

Why do people say it is an OS setting? Because there is an OS setting for this "feature" called:
Use scroll gesture with modifier key to zoom

Note I have that disabled in my settings.

The core issue (it seems to me) is Libreoffice decides to ignore Accessibility settings and implement the setting whether or not it is enabled in the system settings.
Comment 5 JR 2024-11-01 23:45:09 UTC
Forgot to note, I'm on Libreoffice 24.8.0.3 and macOS 15.1 (24B83).

But I've had this fore years, maybe even back to Libreoffice 6.x.
Comment 6 JR 2024-11-01 23:45:27 UTC
Created attachment 197348 [details]
zoom settings 2
Comment 7 JR 2024-11-01 23:45:50 UTC
Created attachment 197349 [details]
zoom settings 3
Comment 8 Patrick (volunteer) 2024-11-02 01:03:01 UTC
(In reply to JR from comment #4)
> Use scroll gesture with modifier key to zoom
> 
> Note I have that disabled in my settings.
> 
> The core issue (it seems to me) is Libreoffice decides to ignore
> Accessibility settings and implement the setting whether or not it is
> enabled in the system settings.

I think that might be a solution I would be able to implement. Any idea what that system setting's underlying ID string is?

I ran the following in Terminal and nothing seems to change when I toggle that system setting:

defaults -g read | grep -i zoom
defaults read com.apple.universalaccess | grep -i zoom
Comment 9 Patrick (volunteer) 2024-11-02 01:06:22 UTC
(In reply to Patrick (volunteer) from comment #8)
> I think that might be a solution I would be able to implement. Any idea what
> that system setting's underlying ID string is?

Found the ID string:

defaults read com.apple.AppleMultitouchTrackpad HIDScrollZoomModifierMask
Comment 10 Patrick (volunteer) 2024-11-02 01:45:54 UTC
(In reply to Patrick (volunteer) from comment #9)
> Found the ID string:
> 
> defaults read com.apple.AppleMultitouchTrackpad HIDScrollZoomModifierMask

After some online reading, it seems this other default is a better one to use:

defaults read com.apple.universalaccess closeViewScrollWheelToggle
Comment 11 Patrick (volunteer) 2024-11-02 13:46:11 UTC
I have submitted the following patch:

https://gerrit.libreoffice.org/c/core/+/175946

It's a hacky fix but what the patch does is stop LibreOffice from converting vertical scrollwheel events to horizontal scrollwheel events when the Command key is pressed if the "Use scroll gesture with modifier keys to zoom" accessibility setting is disabled in the System Preferences application.
Comment 12 Patrick (volunteer) 2024-11-11 16:39:07 UTC
I found that the "Use scroll gesture with modifier keys to zoom" accessibility setting controls zooming of the entire desktop, not within an application so I abandoned the patch in comment #11.

I have submitted a new patch that takes a different approach: limit the special behavior when pressing the Command or Shift keys to only scrollwheel events generated by a mouse. With this new patch, hopefully pressing the Command or Shift keys will no longer have any effect when scrolling with a trackpad:

https://gerrit.libreoffice.org/c/core/+/176410
Comment 13 Commit Notification 2024-11-15 17:17:00 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f5ef5eafdf70a36edd5129147502a9c74df89456

tdf#151423 Only allow modifiers for mouse scrollwheel events

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Patrick (volunteer) 2024-11-15 17:22:35 UTC
I have committed a fix for this bug. The fix will be in tomorrow's (15 November 2024) nightly master builds:

https://dev-builds.libreoffice.org/daily/master/current.html

Note for macOS testers: the nightly master build installer does not overwrite any LibreOffice official versions. Instead, it will be installed as a separate application called "LibreOfficeDev" in the /Applications folder.

Because this is a "test" build, you will need to do the following steps before you launch the LibreOfficeDev application:

1. Go to the Finder and navigate to the /Applications/Utilities folder
2. Launch the "Terminal" application
3. Paste the following command in the Terminal application window and press the Return key to execute the command:

   xattr -d com.apple.quarantine /Applications/LibreOfficeDev.app
Comment 15 steve 2024-11-16 09:55:52 UTC
Verified in Version: 25.2.0.0.alpha0+ (AARCH64) / LibreOffice Community
Build ID: f5ef5eafdf70a36edd5129147502a9c74df89456
CPU threads: 12; OS: macOS 15.1; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

This was a major nuisance to macOS users for many years. Glad it is a thing of the past.
Comment 16 Commit Notification 2024-11-18 08:11:13 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/36cb8c808527d80d947a005b934de585a55b12b6

tdf#151423 Only allow modifiers for mouse scrollwheel events

It will be available in 24.8.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.