mojira.dev
MC-311145

The game window has no borders on Ubuntu in windowed mode when using GNOME with Wayland

When playing Minecraft in windowed mode, it doesn’t have any window borders from the OS.

Environment

Ubuntu 26.04, fully updated as of today, Linux kernel 7.0.0-29, using Vulkan renderer

Linked issues

Attachments

Comments 13

Thank you for helping us improve Minecraft! We saved your files:

[media]

Thank you for your report!

Is this issue present in the latest version of Minecraft?

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

It is still present in 26.3 snapshot 10. The first version where it happens is 26.3 snapshot 4. Snapshot 3 and everything before work properly.

Just to double check since we think we’ve isolated this to GNOME desktops with Wayland, could you launch the game with GDK_BACKEND=x11 and see if it still happens?

I can’t do that because x11 has been removed from GNOME 50

3 more comments

This is not a problem with Minecraft itself, but with GNOME’s not-so-intelligent, for lack of a better word, decision to not implement xdg-decoration (or server side window decorations) on Wayland. Mojang would have to do one of these:

  • Fallback to X11 on Linux by default

  • Fallback to X11 only on GNOME

  • Use SDL’s basic wayland decorations on GNOME

  • Implement libdecor (which would make it so Minecraft Java pulls the entirety of the GTK widget toolset, as well as parts of GNOME and libadwaita just to have decorations on this one desktop.)

Not really Mojang’s fault sadly, it’s the fault of this feature incomplete environment.

Interesting, but why did it start with 26.3 snapshot 4? Why can’t it just be like it was before?

This is just a bug report, not an indictment of Gnome’s decisions. Like it or not, it’s a widely deployed OS with an opinionated setup, and it worked in 26.2, so it’s not unreasonable to bring up if Mojang has a knob to turn that they want to prioritize.

Root cause: the launcher leaks GDK_BACKEND=x11 into the game process.

The launcher (CEF/Chromium) sets GDK_BACKEND=x11 and GTK_CSD=0 for its own processes, and the game's Java process inherits both (visible in /proc/<java pid>/environ). On Wayland, SDL3 draws window decorations through libdecor, and libdecor's GTK plugin cannot initialise GTK when GDK_BACKEND=x11 is set. libdecor then finds no other plugin and gives up:

libdecor-gtk-WARNING: Failed to initialize GTK
Failed to load plugin 'libdecor-gtk.so': failed to init
No plugins found, falling back on no decorations

Reproduced outside the game with the game's own LWJGL SDL build (lwjgl-sdl 3.4.3, SDL 3.4.14) on native Wayland:

  • normal session environment: GTK plugin loads, decorations are drawn

  • GDK_BACKEND=x11: the failure above, no decorations

  • GTK_CSD=0 alone: decorations are drawn (not the cause)

Suggested fix: the launcher should remove GDK_BACKEND (and GTK_CSD) from the environment before starting the game.

Workarounds: start the launcher with SDL_VIDEO_DRIVER=x11 (runs the game through XWayland, where GNOME draws the title bar), or install libdecor-0-plugin-1-cairo (a fallback plugin that doesn't use GTK).

Environment: Ubuntu 26.04.1, GNOME on Wayland, Mesa 26.0.8, Minecraft 26.3, launcher core 3.41.29, bootstrap 2.6.12, libdecor 0.2.5.

Unsure that the GDK_BACKEND and GTK_CSD environment variables are actually to blame for game trying to use X11 here. I’ve been experiencing the bug through multimc (which is based on qt5) and even when checking environment variables of both launcher and minecraft, neither of those two have popped up.

Both workarounds do fix things though, so it seemingly is something to do with how game & gtk try to use x11 for some reason.

zelda oot

(Unassigned)

Plausible

Platform HC

Normal

UI

26.3 Snapshot 9, 26.3 Snapshot 10, 26.3 Pre-Release 1

Retrieved