[Fixed] Blurry Firefox and Chrome Text Under Wayland

2 min


Here are some tips to fix blurry texts in Wayland browsers (Firefox, Chrome).

Wayland, a modern protocol for communication between the display server and the clients, is now the default for many mainstream Linux distributions (Ubuntu, Fedora, etc.). One of the problems you might face is the text on webpages in Firefox/Chrome are a little blurry.

This is despite your selection of perfect resolution and scaling percentages as per your laptop or desktop monitors (including HiDPI). Also, the browser control texts in buttons, toolbars and menus are not as crisp as the native GTK or Qt apps in your desktop environment.

The problem lies with some settings in your browser. Your Linux distribution is not at fault, or rather the Wayland.

So, if you face this, here’s how to fix it.

Fix the blurry text in Firefox & Chrome with Wayland

Firefox

Since I have been using Wayland for almost a year, I see this has already been fixed in the latest Firefox 115. If you use an older Firefox version under Wayland, try below.

  • Close all Firefox instances.
  • Open a terminal (CTRL+ALT+T).
  • Run the following command to set the Wayland-specific environment variable:
  • export MOZ_ENABLE_WAYLAND=1 firefox
  • Now you should see Firefox with crisp texts.

If you want to make it permanent or you switch between X.Org and Wayland, you can open ~/.bash_profile file. Then add the below lines and reboot.

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

For Firefox Flatpak users, the following command should work.

sudo flatpak override --socket=wayland --env=MOZ_ENABLE_WAYLAND=1 org.mozilla.firefox

Touch gestures and pinch zoom in Firefox

For further customization, you can set the variable MOZ_USE_XINPUT2 to 1 after setting up the Wayland above. This will enable you to “pinch-to-zoom”, one-to-one trackpad scrolling”.

export MOZ_ENABLE_WAYLAND=1 MOZ_USE_XINPUT2=1 firefox

Fixing Blurry text on Google Chrome

  • You can also face the same problem in the latest version of Google Chrome under any Wayland session. To fix this, open “chrome://flags” in a new tab.
  • Then search for “ozone-platform-hint“.
  • Change the value to “Auto“.
  • Restart Chrome.
Fixing Chrome Blurry text
Fixing Chrome Blurry text

While using Firefox, you can also verify whether Firefox is running under X11 or Wayland, by visiting “about:support” from a tab. Then check the value under “Window protocol”. It should say “Wayland”.

Firefox is running under native Wayland
Firefox is running under the native Wayland

So, that’s it. Enjoy clear text while you browse the web in Firefox or Chrome.

Cheers.


Arindam

Creator and author of debugpoint.com. Connect with me via Telegram, 𝕏 (Twitter), or send us an email.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

7 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments