Closed Bug 1568676 Opened 5 years ago Closed 4 years ago

Hook up pinch gestures on Windows touchpads to perform APZ zooming

Categories

(Core :: Panning and Zooming, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Tracking Status
firefox70 --- affected

People

(Reporter: botond, Unassigned)

References

Details

(Whiteboard: apz-planning)

Once bug 789906 is in place and we can perform APZ (scaling-only, no reflow) zooming on desktop Windows, we can hook up pinch gestures on the touchpad to trigger it in addition to pinch gestures on touchscreens.

It's such a basic feature not present in a major web browser. This should be a top priority.

Great work guys! I enabled this on macOS Catalina and so far it's working pretty much perfectly.

(Minor bug report: horizontal scrolling from a zoomed state doesn't work as expected; it gets interpreted as back/forward gestures instead, unless I first start vertical scrolling and then move into a horizontal scroll from there without removing my fingers from the trackpad.)

This feature was one of literally only two things keeping me on Chrome (the other being https://bugzilla.mozilla.org/show_bug.cgi?id=1404042).

(In reply to Ryan Lester from comment #3)

(Minor bug report: horizontal scrolling from a zoomed state doesn't work as expected; it gets interpreted as back/forward gestures instead, unless I first start vertical scrolling and then move into a horizontal scroll from there without removing my fingers from the trackpad.)

Thanks, this is on file as bug 1591799.

This feature was one of literally only two things keeping me on Chrome (the other being https://bugzilla.mozilla.org/show_bug.cgi?id=1404042).

Not sure if this helps with the specific linked bug, but there has been a recent notable improvement to macOS power usage.

(Note, this bug about is about Windows. To keep things organized, kindly take any follow-up discussion of pinch-zoom on macOS to this bug.)

Has there been any progress on this? A Firefox engineer said on Reddit they were targeting to have usable pinch zoom on Nightly by Q2 2019. It's Q1 2020, and enabling that option in nightly results in extreme instability during browsing.

I get that implementing this in Firefox has presented unique challenges not seen with other browsers, and I'm not going to pretend to understand what's necessary for overcoming those issues.

But the absence of this feature is becoming increasingly noticeable to Firefox users, especially since every other major browser implemented it many months ago.

Precise and smooth zooming is integral to the visual browsing experience, and while I could be wrong, it's starting to feel like the developers haven't appropriately prioritized this.

(In reply to skennedy789 from comment #6)

Has there been any progress on this? A Firefox engineer said on Reddit they were targeting to have usable pinch zoom on Nightly by Q2 2019. It's Q1 2020, and enabling that option in nightly results in extreme instability during browsing.

What instability are you seeing specifically?

Flags: needinfo?(skennedy789)

It doesn't work for me on Windows using a precision touchpad. Instead, the visual structure of pages breaks. Content becomes concentrated into limited areas within the window. This cannot be reset until the config option is disabled and Firefox restarted.

Flags: needinfo?(skennedy789)

It sounds like you are getting "full zoom". "Full zoom" is the zoom you get when you press ctrl-+ or ctrl--, or in the View, Zoom menu. You can reset it if you accidentally trigger it with ctrl-0, or from the menu. Full zoom is what you get right now if you pinch zoom on a precision touchpad.

You can change pinch zooming on the touchpad to do the type of zooming that you are seeking by additionally modifying the pref mousewheel.with_control.action to 5 (as well as apz.allow_zooming). Note that this will also change the behaviour of ctrl+mousewheel (or anything that sends that msg), and the zooming won't be fluid, it will happen in small increments. So it's not ideal, but it is in a testable state.

(In reply to skennedy789 from comment #8)

It doesn't work for me on Windows using a precision touchpad. Instead, the visual structure of pages breaks. Content becomes concentrated into limited areas within the window. This cannot be reset until the config option is disabled and Firefox restarted.

Yeah, I get this weird behavior too on Linux. The page area suddenly becomes very and unwieldy to navigate.

No longer depends on: desktop-zoom-win
Whiteboard: desktop-
Whiteboard: desktop- → desktop-zoom-nightly

I've been implementing basic direct manipulation support in Firefox to get smooth pinch gesture events out of Windows. Windows seems to be sending different messages to the Firefox window than other windows. Specifically we expect to get a DM_POINTERHITTEST to start a direct manipulation session but we don't get it. Windows also seems more intent on sending us "faked" mouse events when the input is from a (precision) touchpad. Masayuki, would you happen to know any place in firefox where we maybe ask for legacy mouse events or something to do with touchpad events or anything that is a little different that I could try disabling?

Flags: needinfo?(masayuki)

I don't know. Mouse wheel messages are handled in WinMouseScrollHandler. It works with various old touchpad drivers hacky. When I struggled with them, some drivers referred window class name etc. So, it might help to check whether individual touchpad driver special with our windows or not first. It's defined around here: https://searchfox.org/mozilla-central/rev/fa2df28a49883612bd7af4dacd80cdfedcccd2f6/widget/windows/nsWindowDefs.h#68

Flags: needinfo?(masayuki)

(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #13)

I don't know. Mouse wheel messages are handled in WinMouseScrollHandler. It works with various old touchpad drivers hacky. When I struggled with them, some drivers referred window class name etc. So, it might help to check whether individual touchpad driver special with our windows or not first. It's defined around here: https://searchfox.org/mozilla-central/rev/fa2df28a49883612bd7af4dacd80cdfedcccd2f6/widget/windows/nsWindowDefs.h#68

I tried removing Mozilla from our Window class name, no change. I suspect it is not a touchpad driver issue as so called "precision touchpads" are supposed to be generic and talk to Windows directly without a proprietary driver.

(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #14)

I wonder, don't we need to call this API?
https://docs.microsoft.com/en-us/windows/win32/api/directmanipulation/nf-directmanipulation-idirectmanipulationmanager-activate
I don't find it.

I haven't landed my code yet as I'm still trying to figure out this issue.

Whiteboard: desktop-zoom-nightly → apz-planning

Bug 1630912 has landed so it will be possible to test this now.

To test this set apz.windows.use_direct_manipulation to true and apz.allow_zooming to true and restart your browser. Please report any bugs you find. There is one known bug with webrender, I'm not sure how common it is: bug 1632443.

Oh, and you'll need a precision touch pad. In Windows, in Settings, Devices, Touchpad it should say "Your PC has a precision touchpad".

Can we please also get this same for Firefox (using Wayland) on Linux

Linux touchpad support is covered by bug 1581126

Depends on: 1643097
No longer depends on: 1643097
Blocks: 890878

Is there anything else to do here?

Flags: needinfo?(tnikkel)

I can't think of anything.

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(tnikkel)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.