SDL: Added documentation for getting the X11 window from an SDL window

From 3976bbef2ad3896c4411c4fcd5bfc5e3bd64bb4b Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 28 Dec 2023 15:56:37 -0800
Subject: [PATCH] Added documentation for getting the X11 window from an SDL
 window

---
 docs/README-migration.md | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/docs/README-migration.md b/docs/README-migration.md
index 7f554277a043..fb30e16c7c3e 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -1199,22 +1199,40 @@ The Windows and X11 events are now available via callbacks which you can set wit
 
 The information previously available in SDL_GetWindowWMInfo() is now available as window properties, e.g.
 ```c
-    HWND hwnd = NULL;
     SDL_SysWMinfo info;
     SDL_VERSION(&info.version);
+
+#if defined(__WIN32__)
+    HWND hwnd = NULL;
     if (SDL_GetWindowWMInfo(window, &info) && info.subsystem == SDL_SYSWM_WINDOWS) {
         hwnd = info.info.win.window;
     }
     if (hwnd) {
         ...
     }
+#elif defined(__LINUX__)
+    Window xwin = 0;
+    if (SDL_GetWindowWMInfo(window, &info) && info.subsystem == SDL_SYSWM_X11) {
+        xwin = info.info.x11.window;
+    }
+    if (xwin) {
+        ...
+    }
+#endif

becomes:

-    HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), "SDL.window.win32.hwnd");
+#if defined(__WIN32__)
+    HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), "SDL.window.win32.hwnd", NULL);
    if (hwnd) {
        ...
    }
+#elif defined(__LINUX__)
+    Window xwin = (Window)SDL_GetNumberProperty(SDL_GetWindowProperties(window), "SDL.window.x11.window", 0);
+    if (xwin) {
+        ...
+    }
+#endif

SDL_thread.h