DEV Community

Weather Clock Dash
Weather Clock Dash

Posted on

Firefox Native Wayland Support: How to Enable It and What Changes

Firefox 121+ has full native Wayland support. Here's how to enable it properly and what to expect.

Why This Matters

Without native Wayland, Firefox runs through XWayland (an X11 compatibility layer for Wayland). This works but has drawbacks:

  • Slightly reduced performance (extra translation layer)
  • Screen sharing limitations (XWayland screens show as one display in some compositors)
  • Higher CPU usage on some hardware
  • Input lag on pointer/touch events in some cases

With native Wayland, Firefox uses the Wayland protocol directly — better performance, proper screen sharing, native gestures.

Enabling Native Wayland in Firefox

Option 1: Environment Variable

Set MOZ_ENABLE_WAYLAND=1 before launching Firefox:

MOZ_ENABLE_WAYLAND=1 firefox
Enter fullscreen mode Exit fullscreen mode

To make permanent, add to your shell profile:

# ~/.bashrc or ~/.zshrc
export MOZ_ENABLE_WAYLAND=1
Enter fullscreen mode Exit fullscreen mode

Or in your desktop launcher (~/.local/share/applications/firefox.desktop):

Exec=env MOZ_ENABLE_WAYLAND=1 firefox %u
Enter fullscreen mode Exit fullscreen mode

Option 2: about:config

In newer Firefox versions (121+), check widget.use-xdg-desktop-portal.file-picker and related Wayland settings in about:config. Some distros ship Firefox with Wayland enabled by default.

Verify It's Running in Wayland Mode

Go to about:support → look for "Window Protocol" → should show wayland instead of x11.

Fractional Scaling

One long-standing issue: Wayland fractional scaling (125%, 150%) can cause blurry rendering in Firefox.

Workaround: in about:config, set layout.css.devPixelsPerPx to a value matching your scale factor. For 125% scaling:

layout.css.devPixelsPerPx = 1.25
Enter fullscreen mode Exit fullscreen mode

This tells Firefox's CSS engine to use your actual scale, improving sharpness.

Screen Sharing

Wayland screen sharing requires a XDG desktop portal (xdg-desktop-portal and the appropriate backend for your compositor).

On GNOME: xdg-desktop-portal-gnome
On KDE: xdg-desktop-portal-kde
On wlroots-based compositors: xdg-desktop-portal-wlr

Firefox will use the portal to request screen access. The portal shows a picker for which screen/window to share.

Check about:config for media.getusermedia.screensharing.enabled (should be true) and media.getusermedia.screensharing.allowed_domains for allowed domains.

If screen sharing doesn't work:

  1. Check the portal package is installed
  2. Check the portal service is running: systemctl --user status xdg-desktop-portal
  3. Check Firefox is actually running in Wayland mode (about:support)

Touch and Gesture Support

With native Wayland, Firefox receives proper touch events. Pinch-to-zoom works on touchpads that support it (touchscreens too).

If gestures feel wrong: check whether dom.w3c_touch_events.enabled is set correctly in about:config. Should be 1 (default).

Hardware Video Decode (VA-API)

Native Wayland helps with VA-API (hardware video decode on Intel/AMD GPUs). To enable:

  1. about:config → media.ffmpeg.vaapi.enabled = true
  2. Restart Firefox
  3. Check about:media or about:support for hardware decode status

Requires ffmpeg with VA-API support and the appropriate VA-API driver for your GPU.

Benefit: significantly reduced CPU usage for video playback, better battery life on laptops.

Tab Sessions and Wayland Window Management

One note for power users: with Wayland's isolation model, Firefox can't "see" other windows (unlike X11). This is a security feature but means some window management scripts that worked on X11 may not work.

For managing Firefox tab sessions without X11 scripting, Tab Manager & Session Saver works entirely within the browser — no external scripts needed. Save named sessions, restore without external tooling.


Native Wayland support in Firefox has improved substantially. For GNOME and KDE users especially, the combination of MOZ_ENABLE_WAYLAND=1 + xdg-desktop-portal gives you proper screen sharing, gestures, and performance improvements over XWayland.

Top comments (0)