2025-04-07

Disable XWAYLAND_NO_GLAMOR Today!

So a few months ago (in December 2024), I made [a blog post](https://blog.northwestw.in/p/2024/12/07/fixing-steam-games-on-wayland) about running Steam game with "gamescope" to reduce lag. However, I bought Stardew Valley recently and the technique doesn't work.

In fact, this technique doesn't work for 2D games (I don't know, I have tried like 2 of them). For Stardew Valley and Mindustry, both of the games have insane flashing when "gamescope" is used. If I don't just run them directly, they seem to suffer from screen tearing, where the upper half and lower half are slight desynced.

I really wanted to stream Stardew Valley, and I really wanted to use Wayland on Linux because X11 is just generally laggier for me. So I went on the journey to find the solution, and that didn't take long.

[This is a Reddit post I found at first.](https://www.reddit.com/r/hyprland/comments/17j12jz/finally_got_xwayland_on_nvidia_working_perfectly/) It contains a list of environment variables and some options the OP used to make Hyprland work with Nvidia. On the line with |XWAYLAND_NO_GLAMOR|, they wrote this:

`env = XWAYLAND_NO_GLAMOR,1 # with this you'll need to use gamescope for gaming`

You'd think that directly led to the solution for me, but no. I instead focused on the "nvidia-drm" options part for "fbdev=1", because I realized I didn't have that set in "modprobe".

That didn't do anything.

It was a while after directly plugging environment variables into the Steam launch options of Stardew Valley without success, I've decided to check "/etc/environment". And guess what I found. That's right. |XWAYLAND_NO_GLAMOR=1|. I honestly don't remember why and when I put it there, so I just commented it out, added a bunch of other variables from that Reddit post and rebooted.

Things worked flawlessly!

I launched Stardew Valley from Steam, and the screen tearing is gone! I decided to try removing the "gamescope" wrapper of Phasmophobia, and it runs super smoothly as well!

Disable your |XWAYLAND_NO_GLAMOR| today ;>