X11 vs Wayland: Choosing Your Display Server

What X11 and Wayland are, when to use each one, and how to switch between them on Ubuntu-based GNOME desktops.

Intermediate Updated 3 min read Tested on Zorin OS 18.1 Pro (Ubuntu 24.04 Noble base) Hardware Lenovo ThinkPad L14 Gen 2

What This Guide Achieves

Explain the difference between Wayland and X11 display servers, when to use each, and how to switch between them.


The Problem (Windows User Perspective)

On Windows, you never think about the “display server” — it’s invisible. On Linux, there are two competing display servers: Wayland (newer) and X11/Xorg (older but more compatible). Your choice affects which tools work and how some apps behave.


Which One Are You Using?

echo $XDG_SESSION_TYPE
  • x11 → You’re on X11 (Xorg)
  • wayland → You’re on Wayland

Wayland vs X11 — Quick Comparison

FeatureX11 (Xorg)Wayland
Age~40 years old~15 years old
SecurityLess secure (any app can read any window)More secure (strict app isolation)
PerformanceGoodBetter (less screen tearing)
HiDPI scalingBasicBetter
CompatibilityEverything worksSome tools don’t work
Automation toolswmctrl, xdotool, xclip all worknot always works
Screen sharingWorks everywhereSome apps struggle

Use X11 if you:

  • Use wmctrl, xdotool, or xclip for automation
  • Run Stata or other apps that have Wayland bugs (window resizing issues)
  • Need screen recording or screen sharing in apps like Zoom
  • Use any tool that needs to control other windows programmatically

When to Use Wayland

Use Wayland if you:

  • Want the latest security and performance improvements
  • Don’t use any X11-specific automation tools
  • Have a HiDPI display and want better scaling

How to Switch

At the Login Screen

  1. Log out of your current session
  2. On the login screen, click on your username
  3. Look for a gear icon (usually bottom-right corner)
  4. Select the X11/Xorg session if you need maximum compatibility. The exact label names vary by distro — look for an option containing “Xorg” in the session name (e.g. “Ubuntu on Xorg”).
  5. Enter your password and log in

Making It Permanent

The selection persists between reboots — whichever you chose last will be used on next login.


Known Issues with Wayland on the Tested Setup

IssueDescription
Stata window resizingGTK bug causes Stata GUI to not resize properly under Wayland
wmctrl/xdotool don’t workThese X11-only tools fail silently on Wayland
xclip doesn’t workClipboard automation requires X11 — use wl-clipboard on Wayland instead
Some Electron appsOlder Electron apps may have rendering issues

Forcing an App to Use X11 on Wayland

If you’re on Wayland but need one specific app to use X11:

GDK_BACKEND=x11 stata-mp

Or add it permanently to the app’s .desktop file:

Exec=env GDK_BACKEND=x11 stata-mp

What Didn’t Work (and Why)

ApproachWhy It Failed
Using Wayland with wmctrl/xdotool automation scriptsThese tools works properly on X11 — they fail silently on Wayland
Running Stata on WaylandWindow resizing GTK bug — must force X11 backend
Assuming all apps work on bothSome apps (especially older ones) only work properly on X11

Discussion