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
  • On Firefox you can try to enter in about:config, agree that you take responsibility for the tweaks, and search "zoom" in the search bar. Then you can switch to "true" the first apz.allow_zooming and restart Firefox. It works on Mac, but it didn't on my PopOs installation (tried on X and Wayland) – Andrea Avesani Jul 29 '20 at 20:05

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

  • 5
    Or just open chrome flags chrome://flags/#ozone-platform-hint and select Wayland as preferred option. – Capy Nov 24 '22 at 17:48
  • 1
    in MS Edge, that flag suggested by @Capy doesn't exist. But if I run MS Edge with these options via commandline, it works and it enables both pinch to zoom and kinetic scrolling! you have to run edge this way: /usr/bin/microsoft-edge-beta --enable-features=UseOzonePlatform --ozone-platform=wayland – Allexj Apr 18 '23 at 10:59
  • @Allexj Microsoft removed that flag from edge. I tried contacting them asking for an explanation but they did not revert back – karthik nair Apr 19 '23 at 05:44
  • @karthiknair You mean they did not reply back. "Revert" means to reverse a change, e.g. "they removed the feature, but then they reverted the removal" (meaning they undid the change). – Jivan Pal Apr 19 '23 at 13:01
  • @Capy (or anyone else): Do you know if this is supposed to work under X11 also? I'm using Pop OS 22.04. – Jivan Pal Apr 19 '23 at 13:01
  • Nevermind, I got Wayland working and pinch-zooming now works for me even without changing the Chrome flag value from "Default" to "Wayland" :-) – Jivan Pal Apr 20 '23 at 15:56
  • it doesn't zoom according to the mouse position, it can only zoom in the center of the screen – Minh Nguyên Jun 29 '23 at 06:59
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,970
gyosifov
  • 121
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.

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".