Commit 9672d58119dd7e2236f3bb90c744406913ae6bfc

Sam Lantinga 2021-09-26T14:22:11

Need to check structure version before setting xdg_toplevel to NULL

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index 2dd251a..f12c142 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -651,7 +651,9 @@ Wayland_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
             }
         } else {
             info->info.wl.xdg_surface = NULL;
-            info->info.wl.xdg_toplevel = NULL;
+            if (version >= SDL_VERSIONNUM(2, 0, 17)) {
+                info->info.wl.xdg_toplevel = NULL;
+            }
         }
     }