How Emacs is Adapting to Wayland

For decades, Emacs has relied on the X11 windowing system on Linux. As the Linux desktop ecosystem transitions towards Wayland, Emacs—like many long-lived applications—faces the challenge of adapting to a new display protocol while preserving its flexibility and deep configurability.

In this article, we’ll look at the current state of Emacs on Wayland, what works well today, and which areas are still under active development.


Why Wayland Matters

Wayland is designed as a simpler, more secure, and more modern replacement for the aging X11 system. Among its advantages are:

  • Improved security: Applications cannot snoop on each other’s input or capture arbitrary parts of the screen.

  • Better rendering: Smooth scaling, HiDPI support, and per-monitor refresh rates.

  • Reduced complexity: Wayland avoids the decades of legacy quirks built into X11.

For end users, the migration to Wayland is becoming unavoidable: GNOME, KDE Plasma, and other major desktops now ship Wayland sessions as the default.


How Emacs Runs on Wayland Today

As of Emacs 29 and 30, there are three main ways to run Emacs in a Wayland session:

  1. X11 Compatibility via XWayland

    • The most common approach today.

    • Emacs runs as if on X11, with the Wayland compositor providing an X11 compatibility layer.

    • Works reliably, but lacks some of Wayland’s advanced features (e.g., proper fractional scaling).

  2. Pure Wayland via GTK

    • Emacs built with pgtk (pure GTK) runs as a native Wayland client.

    • Available since Emacs 29 with the --with-pgtk configure flag.

    • Offers better HiDPI support, cleaner rendering, and correct input handling on Wayland.

  3. Terminal Emacs

    • Many users run Emacs in a terminal (e.g., Alacritty, Kitty, Foot) that is already Wayland-native.

    • This sidesteps GUI adaptation but still benefits from Wayland’s performance and input handling.


Advantages of Native Wayland Support

Running Emacs as a native Wayland application (pgtk) brings several benefits:

  • Proper HiDPI scaling across multiple monitors.

  • Smooth resizing and rendering, without X11 translation overhead.

  • Better input handling, especially for modern input methods and touchpads.

  • Future-proofing as XWayland may eventually become optional on some distributions.


Remaining Challenges

While pgtk support is promising, some challenges remain:

  • Clipboard and drag-and-drop quirks: Emacs on Wayland sometimes behaves differently than under X11, depending on the compositor.

  • Performance tuning: Some users report input latency or slower rendering compared to X11 builds.

  • Third-party package assumptions: Certain extensions expect X11-specific behavior (e.g., external window managers, xclip integration).

  • Remote sessions: X11 forwarding (over SSH) has no direct Wayland equivalent, which complicates remote GUI usage.


The Road Ahead

The Emacs community is steadily improving Wayland support:

  • Bug reports and patches are flowing into pgtk builds as more users adopt Wayland.

  • Distributions like Fedora and Arch Linux are making it easier to install native Wayland Emacs builds by default.

  • Future Emacs releases will likely refine Wayland support, focusing on performance parity and removing X11-only dependencies.

For users today, the choice is clear: if you want stability, XWayland works fine. If you want to embrace the future, try a pgtk build and help the community test and polish native Wayland support.


Conclusion

Emacs, despite its age, continues to evolve alongside the Linux ecosystem. The shift from X11 to Wayland is one of the biggest changes in decades, and Emacs is adapting quickly through its pure GTK (pgtk) port. While some rough edges remain, the path forward is clear: Emacs will continue to be a first-class citizen on modern Linux desktops.

Whether you run it in a terminal, under XWayland, or as a pure Wayland client, Emacs is here to stay—proof that even a 40-year-old editor can thrive in the next generation of Linux computing.

Tags

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Please share this article on your favorite website or platform.