Trackpad zoom laptop

I recently re-installed Manjaro Gnome from ISO.
Previously I was able to zoom in/out using pinch gesture on my trackpad. But now this is not working.
Im not sure if this is a feature of Gnome or Firefox, but it was firefox on which i took advantage of this.

I don’t mean the standard firefox zoom (+ -) to make text larger or smaller, I mean a complete zoom of the entire viewport.

I’m pretty sure this wasnt a firefox extension, i looked those up & nothing looked familiar.
I cant find anything related to zoom in gnome trackpad settings or firefox, so im not sure what this was?

Do you know what im talking about?

Try switching to wayland and try again.

In a Xorg session you can customize touchpad gestures with touche. Also make sure gnome-shell-extension-x11gestures is installed.

im already using wayland.

oh, actually I deleted gnome-shell-extension-x11gestures + touchegg + touche because they spam the log when running wayland.
This was advice you gave me in this thread & it worked well before , so i did the same this time.
I dont use Xorg session at all.

This was correct, the things you listed only work in X11 not Wayland. I think everyone in this thread assumed you were using X11, since normally this stuff works out of the box in Wayland.

3-finger swipe to switch workspace/activites works, 2-finger scroll works, tap to click & tapndrag work.
But pinch-zoom doesnt, at least in FF. Can I test it in another app?

Check the “Window Protocol” entry in Firefox’s about:support page. If it says “XWayland” rather than “Wayland”, then Wayland mode is not enabled, and Wayland gestures may not work properly. Follow this guide to enable Wayland mode.

Thanks @fasto
Indeed firefox was Xwayland.

I copied /usr/share/applications/firefox.desktop to ~/.local/share/applications/firefox.desktop & added the environment variable. (in the 3 Exec lines)
pinch zoom now works. :grinning:

#Exec=/usr/lib/firefox/firefox %u
Exec=env MOZ_ENABLE_WAYLAND=1 /usr/lib/firefox/firefox %u

However, I cant get a the session wide MOZ_ENABLE_WAYLAND=1 solutions to work. Not sure why.
I added the conditional to .bash_profile & reboot, but it doesnt work (FF still says Xwayland)

if [ "$XDG_SESSION_TYPE" == "wayland" ]; then

Any ideas about that?

You will have to add it to your .zshrc since ZSH is the default shell in Manjaro. But it shouldn’t be necessary to do so if you have already edited firefox.desktop, since MOZ_ENABLE_WAYLAND is Firefox-only.

I noticed pinch doesnt work if I launch firefox by clicking a link in an email, which i guess bypasses the .desktop

Sorry to bug you, adding that condition to .zshrc doesnt switch FF to wayland either.

echo $XDG_SESSION_TYPE                                                                                    PIPE ✘  40s  
echo $MOZ_ENABLE_WAYLAND                                                                                               ✔ 

but FF reports Window Protocol xwayland

(I changed the condition square brackets to [[ ]] because it looks like zsh complains with single [] )

About what? Single brackets with quoted variables is POSIX compliant. If one used single brackets with no quoted variables, there may be issues. However, I would only expect a complaint from BASH, not ZSH.

When I open a new terminal i see this error.
/home/rico/.zshrc:12: = not found

When written with double brackets there is no complaint.

if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then

Additionally i found adding this to .zshrc does actually work for FF pinch, but only if i launch FF via terminal. (when using 2 brackets)
So still searching for a way to cover this for all situations.

Something else is wrong with your .zshrc then. shellcheck1 may give you some hints:

shellcheck ~/.zshrc

Please post the contents of your .zshrc if you still need help.

1 Hint: install shellcheck if the command is not found

Thanks. I tried this but not sure about the result.

Here is my .zshrc, This is default with only the last condition added

# Use powerline
# Source manjaro-zsh-configuration
if [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then
  source /usr/share/zsh/manjaro-zsh-config
# Use manjaro zsh prompt
if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
  source /usr/share/zsh/manjaro-zsh-prompt
# 2023.03.01 Firefox wayland pinch/zoom
if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then

I used double-brackets [[ in the last condition when i noticed the existing content did that, & then the terminal error stopped. So that was my reasoning.

When I run shellcheck I get the following result
I tried it with 2 brackets in the last condition, 1 bracket & without the condition at all, but in all cases shellcheck is the same.

shellcheck ~/.zshrc                                                                                1 ✘ 

In /home/rico/.zshrc line 1:
# Use powerline
^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

In /home/rico/.zshrc line 2:
^-----------^ SC2034 (warning): USE_POWERLINE appears unused. Verify use (or export if used externally).

In /home/rico/.zshrc line 5:
  source /usr/share/zsh/manjaro-zsh-config
         ^-- SC1091 (info): Not following: /usr/share/zsh/manjaro-zsh-config was not specified as input (see shellcheck -x).

In /home/rico/.zshrc line 9:
  source /usr/share/zsh/manjaro-zsh-prompt
         ^-- SC1091 (info): Not following: /usr/share/zsh/manjaro-zsh-prompt was not specified as input (see shellcheck -x).

You can ignore the shellcheck results there.

Note that the Arch Wiki uses single brackets and quotes. There’s no reason why that shouldn’t work with both ZSH and BASH.

This is the relevant entry regardless: SC2086: Double quote to prevent globbing and word splitting.

EDIT: Just to be sure, did you source your .zshrc after editing it?

source ~/.zshrc

When using a single bracket in the condition I get this

source ~/.zshrc                                                                               ✔  8s  
/home/rico/.zshrc:12: = not found

With double bracket there is no output.
Line 12 is if [ "$XDG_SESSION_TYPE" == "wayland" ]; then

Well, that’s odd. Either way, it should be working… however:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.