# SDL: wayland: Use substring matching for detecting the desktop name

**URL:** <https://discourse.libsdl.org/t/sdl-wayland-use-substring-matching-for-detecting-the-desktop-name/69484>\
**Category:** SDL Commits\
**Created:** [October 3, 2026, 4:54pm UTC](https://discourse.libsdl.org/t/sdl-wayland-use-substring-matching-for-detecting-the-desktop-name/69484 "2026-10-03T16:54:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [October 3, 2026, 4:54pm UTC](https://discourse.libsdl.org/t/sdl-wayland-use-substring-matching-for-detecting-the-desktop-name/69484/1 "2026-10-03T16:54:07Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/f48181fd33743da429877c4dbc8d7e22d67cefe7>
>
> XDG\_CURRENT\_DESKTOP can be in the form of a colon separated list (e.g. ubuntu:KD…E), so use substring matching instead of a string compare.

```diff
From f48181fd33743da429877c4dbc8d7e22d67cefe7 Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Sat, 3 Oct 2026 12:50:11 -0400
Subject: [PATCH] wayland: Use substring matching for detecting the desktop
 name

XDG_CURRENT_DESKTOP can be in the form of a colon separated list (e.g. ubuntu:KDE), so use substring matching instead of a string compare.
---
 src/video/wayland/SDL_waylandwindow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index 9143c78a51f22..81d7ffb0802db 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -82,7 +82,7 @@ static bool ShouldMaskFullscreen()
     }
 
     const char *desktop = SDL_getenv("XDG_CURRENT_DESKTOP");
- if (desktop && SDL_strcmp(desktop, "KDE") == 0) {
+ if (desktop && SDL_strstr(desktop, "KDE") != NULL) {
         mask_required = 1;
     } else {
         mask_required = 0;

```
