SDL: x11: Fix boolean/enum comparison (402fc)

From 402fc52af4e731184ad6a704068b5ccd27d8f1b8 Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Wed, 27 May 2026 12:01:03 -0400
Subject: [PATCH] x11: Fix boolean/enum comparison

This could set the pending flag even if there was no state change requested, which would cause errant sync timeouts in certain situations.

(cherry picked from commit 6a3b0413dced7a1b50b21c5d7e6649ed8b777972)
---
 src/video/x11/SDL_x11window.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c
index d2881945f5ff6..ddc4cdadd6e7b 100644
--- a/src/video/x11/SDL_x11window.c
+++ b/src/video/x11/SDL_x11window.c
@@ -1882,7 +1882,8 @@ static SDL_FullscreenResult X11_SetWindowFullscreenViaWM(SDL_VideoDevice *_this,
         X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0,
                        SubstructureNotifyMask | SubstructureRedirectMask, &e);
 
-        if (!!(window->flags & SDL_WINDOW_FULLSCREEN) != fullscreen) {
+        // Only set the pending flag if the fullscreen state actually changed.
+        if (((window->flags & SDL_WINDOW_FULLSCREEN) != 0) != (fullscreen != 0)) {
             data->pending_operation |= X11_PENDING_OP_FULLSCREEN;
         }