(URGENT) 2-finger pinch-zoom is working in chrome_wayland, not in firefox_wayland

67 views
Skip to first unread message

Rajapriya Radhakrishnan

unread,
Jun 8, 2022, 6:08:13 AMJun 8
to hsk...@mozilla.com, rav...@gmail.com, dev-we...@mozilla.org
Hi Skupin,

Now I'm checking the pinch-zoom in the firefox browser, please take a look at the attached demo video - https://drive.google.com/file/d/1mSCbvnpN71lXO9L6V82L2gUWg1QbI-Nd/view?usp=sharing.

Environment Details:
1. Operating System - Ubuntu 22.04 LTS, Ubuntu 20.04 LTS
2. Display Server       - Wayland and XOrg
3. Browser                 - Chrome and Firefox
> To launch chrome
# google-chrome-stable --enable-features=UseOzonePlatform --ozone-platform=wayland
> To launch firefox
# firefox --enable-features=UseOzonePlatform --ozone-platform=wayland
First I tested this action in the Firefox browser on Ubuntu-XOrg system, but it didn't work, only the browser-level zooming was working. 

Then I switched the browser to chrome and display server to wayland, I launched the browser via terminal using the above commands. When I do 2-finger pinch-zoom action on the trackpad, only browser-level zoom is happening. (As per my understanding, I say the "2 finger pinch-zoom" is different from "browser-level zoom", what I try now is pinch-zoom). In chrome browser, the pinch-zoom is working as expected without affecting the browser-zoom level.

Could you please tell me why the pinch-zoom is not working in firefox whereas it is working in chrome.


Thanks,
Rajapriya R.


Julian Descottes

unread,
Jun 8, 2022, 6:42:55 AMJun 8
to dev-we...@mozilla.org, rajapr...@gmail.com, rav...@gmail.com, dev-we...@mozilla.org, Henrik Skupin
Hi,

This question doesn't seem related to webdriver, so it would probably best to ask on a support channel for Firefox or to file a bug at https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Panning%20and%20Zooming

The launch arguments used above are not meant to be used with Firefox, they seem relevant only for Chrome/Chromium?
To enable wayland for Firefox, you need to set the environment variable `MOZ_ENABLE_WAYLAND=1`.

Regarding the feature itself, since https://bugzilla.mozilla.org/show_bug.cgi?id=1688717 , pinch zoom should be enabled by default.
But you can still make sure the preference `apz.gtk.touchpad_pinch.enabled` is set to true in about:config.

If none of that helps, I suggest filing a bug in the Core:Panning and Zooming component.

Rajapriya Radhakrishnan

unread,
Jun 8, 2022, 7:11:51 AMJun 8
to Julian Descottes, dev-we...@mozilla.org, rav...@gmail.com, Henrik Skupin
Thanks Julian for your comments.
 
Let me check the given points first. If it doesn't work, I will raise a query in the mentioned support group.

Rajapriya Radhakrishnan

unread,
Jun 8, 2022, 7:34:19 AMJun 8
to Julian Descottes, dev-we...@mozilla.org, rav...@gmail.com, Henrik Skupin
Yes Julian. 

Only after setting the environment variable `MOZ_ENABLE_WAYLAND=1` with the above config setting, pinch-zoom is working as expected. When I enabled the preference `apz.gtk.touchpad_pinch.enabled`, it was not working.

Thanks for your quick response.

Some more queries.
1. Is there any manuals to know about the about:config properties. For me, it became very difficult to check/set/reset the about:config properties without knowing the purpose of those attributes. It would be helpful, if you have any manuals.
2. To simulate this 2 finger pinch-zoom action, can I use the below algorithm? I took this algorithm from a deprecated file - marionette_driver/gestures.py.

def pinch(marionette_session, element, x1, y1, x2, y2, x3, y3, x4, y4, duration=200):
    """
        :param element: target
        :param x1, y1: 1st finger starting position relative to the target
        :param x3, y3: 1st finger ending position relative to the target
        :param x2, y2: 2nd finger starting position relative to the target
        :param x4, y4: 2nd finger ending position relative to the target
        :param duration: Amount of time in milliseconds to complete the pinch.
    """
    time = 0
    time_increment = 10
    if time_increment >= duration:
        time_increment = duration
    move_x1 = time_increment*1.0/duration * (x3 - x1)
    move_y1 = time_increment*1.0/duration * (y3 - y1)
    move_x2 = time_increment*1.0/duration * (x4 - x2)
    move_y2 = time_increment*1.0/duration * (y4 - y2)
    multiAction = MultiActions(marionette_session)
    action1 = Actions(marionette_session)
    action2 = Actions(marionette_session)
    action1.press(element, x1, y1)
    action2.press(element, x2, y2)
    while (time < duration):
        time += time_increment
        action1.move_by_offset(move_x1, move_y1).wait(time_increment/1000)
        action2.move_by_offset(move_x2, move_y2).wait(time_increment/1000)
    action1.release()
    action2.release()
    multiAction.add(action1).add(action2).perform()

Reply all
Reply to author
Forward
0 new messages