12

Many forum posts say to hold 'ctrl' when pinching, but that doesn't do anything for me on any browser (tried firefox and chrome). Fun thing is that pinch zoom works on PDF files in the default viewer (on both wayland and xorg), also on images in the GNOME default viewer.

I've tried the whole libinput-gestures thing but it's not what I'm looking for, it lets me map 'ctrl' + '+' to the pinch gesture, which just increases the scale of the pages instead of doing this clean zoom on a particular part of the page, not throwing the layout off. I've seen posts of people saying that it should work on chrome by default, but I've had no luck with this.

On firefox I installed this extension and pinch zooming still doesn't work, only the 'shift' scroll alternative. I'd prefer to use chrome though.

How should I go about trying to enable pinch zoom? I feel like I've tried most of the things I found over several furious googling sessions.

ghadeezz
  • 121

4 Answers4

12

Works on chrome with wayland

To try it once, run the command,

google-chrome-stable --enable-features=UseOzonePlatform --ozone-platform=wayland

To make it permanent, open Chrome flags, and select Wayland as the preferred option in chrome://flags/#ozone-platform-hint

2

Setting the flag worked for me

Wayland

More recent versions of Firefox support opting into Wayland mode via an environment variable.

$ MOZ_ENABLE_WAYLAND=1 firefox

To make this permanent, see Environment variables#Graphical environment and start Firefox via the desktop launcher like you normally would.

To verify that it worked, look for Window Protocol in about:support. It should say wayland. The presence of x11 means you are running Firefox under Xorg display server, while xwayland means your system is running Wayland but executing Firefox as legacy X11 application.

If it is necessary to be regularly switching between Wayland and X.org, it may be useful to add a conditional to your shell's login startup script, e.g. ~/.bash_profile for Bash:

if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
    export MOZ_ENABLE_WAYLAND=1
fi

Source: Arch Linux Wiki article on Firefox

muru
  • 207,228
gyosifov
  • 121
  • 1
1

Pinch zoom has now been implemented in Firefox 86.

It is not enabled by default yet, but you can enable it in Firefox by visiting the URI about:config and setting apz.gtk.touchpad_pinch.enabled=true.

Martin Thornton
  • 5,996
  • 12
  • 32
  • 43
reckless
  • 378
1

Enabling Pinch Zoom in Brave Browser linux:

  1. Type brave://flags/#ozone-platform-hint in the address bar and press Enter.

  2. Change the dropdown menu next to "Ozone Platform Hint" to "auto".