Open Bug 1681542 Opened 3 years ago Updated 2 years ago

Improve ctrl+pinch behavior

Categories

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

Desktop
Windows
defect

Tracking

()

Tracking Status
firefox-esr78 --- unaffected
firefox83 --- wontfix
firefox84 --- wontfix
firefox85 --- fix-optional

People

(Reporter: mbalfanz, Assigned: tnikkel)

References

(Blocks 1 open bug)

Details

Users have reported that ctrl+pinch behaves very differently since DesktopZooming was enabled.

I can replicate the problem on Windows.

STR:

  • set apz.allow_zooming to false
  • visit any website (e.g. this bug)
  • pinch and observe behavior
  • ctrl + pinch again and observe behavior

For me, ctrl + pinch becomes extremely fast and makes it hard to incrementally change the reflow zoom when apz.allow_zooming is enabled. Users have reported laggy behavior.

I think it would be great if ctrl+pinch could behave the same as it does when DesktopZooming is disabled.

Edit: updated STR

Hmm, ctrl+pinch, interesting. Under the hood, when we don't treat a pinch as pinch zooming it gets converted into a wheel+ctrl event. So a pinch without ctrl gets converted into a wheel event with ctrl. I would expect ctrl+pinch to not be much different. I can take a look.

Severity: -- → S2
Priority: -- → P2
Regressed by: 1671235

Set release status flags based on info from the regressing bug 1671235

I tested this today again and realized my assumption that this is APZ related may be false. The behavior of ctrl-pinch and normal pinch was always different. Now with DTZ enabled, the user expectation is that ctrl+pinch would work like pinch previously.

Better STRs are:

  • set apz.allow_zooming to false
  • visit/refresh a website
  • pinch and observe how the reflow zoom changes
  • ctrl-pinch and observe how the reflow zoom changes

ER:

  • ctrl-pinch should behave like pinch when apz.allow_zooming is disabled

AR:

  • ctrl-pinch is hardly usuable

(I'll change the original comment's STRs as well)

Thanks for the clarification Martin! I think this is not a regression then, but will keep it as an S2 as it seems like fixing this would be an easy way to allow users to perform reflow zoom with touchpads even with DTZ enabled.

No longer regressed by: 1671235
Keywords: regression

Assigning to Timothy per comment 1 (mostly to get it off the triage dashboard).

Assignee: nobody → tnikkel

I ran across this bug when looking at layout/layout-adjacent S2 bugs.

Given comment 4 and the time that's passed, this doesn't sound like it's really inflicting S2-level pain/impact on users at this point -- should we reclassify as S3 to reflect reality & keep the S2 list appropriately/narrowly focused?

Flags: needinfo?(botond)

I was wondering the same thing.

This issue is on our agenda to discuss at tomorrow's APZ planning meeting. I'll be on PTO, but perhaps Dan can reflect the result of the discussion in this bug (e.g. change the severity if appropriate).

Flags: needinfo?(botond) → needinfo?(drobertson)

Thanks for the ping! I'll update this bug after the APZ meeting.

Reclassifying to S3 after discussion in the APZ meeting.

Severity: S2 → S3
Flags: needinfo?(drobertson)
Priority: P2 → P3

I want to record what I'm seeing so everyone can get on the same page.

When apz.allow_zooming=true I see pinch -> smooth zoom, ctrl+pinch -> reflow zoom.
When apz.allow_zooming=false I see pinch -> treated as a mostly useless pan, ctrl+pinch -> treated as a mostly useless pan.
When apz.allow_zooming=false and apz.windows.force_disable_direct_manipulation=true I see pinch -> reflow zoom, ctrl+pinch -> reflow zoom.

(The speed of reflow zoom is harder to measure, so I'll leave that issue for now.)

When dmanip is enabled and apz zooming is disabled then we instruct dmanip to only send us pan events
https://searchfox.org/mozilla-central/rev/0948667bc62415d48abff27e1405fb4ab4d65d75/widget/windows/DirectManipulationOwner.cpp#581
that explains the last two lines above.

The reason we reflow zoom with ctrl+pinch in the default configuration is this line
https://searchfox.org/mozilla-central/rev/0948667bc62415d48abff27e1405fb4ab4d65d75/gfx/layers/apz/src/APZCTreeManager.cpp#1660
apz rejects the event and instead converts it to a widget wheel event to dispatch using the non-apz code path.

As for the speed of reflow zoom, we use direct manipulation to receive pinches. Without dmanip we would just get ctrl+scrollwheel events. It is quite conceivable that the process of receiving a dmanip pinch and then converting it to a widget wheel event would get a different delta then just receiving a ctrl+scrollwheel event. So that could explain any potential speed difference (I haven't measured yet to see if there is a difference, it's a little tricky.)

Should we be doing reflow zoom from ctrl+pinch? Both Chrome and Edge do smooth zoom with all of pinch + {shift, ctrl, alt, win}. I looked at the history of why that code does that, it comes from bug 1540988. In that bug a cmd+scroll doing smooth zoom was the problem. Comment 9 https://bugzilla.mozilla.org/show_bug.cgi?id=1540988#c9 says: "The basic problem is that command+scroll can easily get turned into command+pinch and both have a somewhat-similar effect so the user may not realize they ended up doing a pinch instead of a reflow zoom." This is a little puzzling to me, I'm not sure how cmd+scroll gets turned into a pinch gesture input type. And indeed I removed the modify check added by that bug and performed cmd+scroll and it did reflow zoom as expected (not smooth zoom).

(In reply to Timothy Nikkel (:tnikkel) from comment #10)

Comment 9 https://bugzilla.mozilla.org/show_bug.cgi?id=1540988#c9 says: "The basic problem is that command+scroll can easily get turned into command+pinch and both have a somewhat-similar effect so the user may not realize they ended up doing a pinch instead of a reflow zoom." This is a little puzzling to me, I'm not sure how cmd+scroll gets turned into a pinch gesture input type.

What I suspect Kats meant by that is that when you perform a two-finger scrolling gesture, it's possible that the distance between the two fingers changes slightly as well. Depending on how sensitive the gesture detection is (this part may have improved since the time that comment was written), the two-finger gesture could sometimes be detected as a pinch. If this happens without Ctrl being pressed, you notice your mistake pretty quickly (as you get zooming mixed with your scrolling), but if this happens with Ctrl pressed, you get pinch-zoom mixed with reflow-zoom which is harder to notice.

You need to log in before you can comment on or make changes to this bug.