SDL: wayland: make sure the desktop mode is in the fullscreen mode list

From 4c6d949e6d64798d5a03cee952300e0b66a29d7b Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 31 Jan 2025 14:53:40 -0800
Subject: [PATCH] wayland: make sure the desktop mode is in the fullscreen mode
 list

Fixes https://github.com/libsdl-org/SDL/issues/12079
---
 src/video/wayland/SDL_waylandvideo.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c
index d1066b4d92a1e..fc8edc1e025a5 100644
--- a/src/video/wayland/SDL_waylandvideo.c
+++ b/src/video/wayland/SDL_waylandvideo.c
@@ -1025,6 +1025,10 @@ static void display_handle_done(void *data,
     // Expose the unscaled, native resolution if the scale is 1.0 or viewports are available...
     if (internal->scale_factor == 1.0 || video->viewporter) {
         SDL_AddFullscreenDisplayMode(dpy, &native_mode);
+        if (native_mode.w != desktop_mode.w ||
+            native_mode.h != desktop_mode.h) {
+            SDL_AddFullscreenDisplayMode(dpy, &desktop_mode);
+        }
     } else {
         // ...otherwise expose the integer scaled variants of the desktop resolution down to 1.
         int i;