mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-04 09:44:35 +00:00
Added documentation for getting the X11 display from an SDL window
This commit is contained in:
@@ -1219,11 +1219,13 @@ The information previously available in SDL_GetWindowWMInfo() is now available a
|
|||||||
...
|
...
|
||||||
}
|
}
|
||||||
#elif defined(__LINUX__)
|
#elif defined(__LINUX__)
|
||||||
|
Display *xdisplay = NULL;
|
||||||
Window xwindow = 0;
|
Window xwindow = 0;
|
||||||
if (SDL_GetWindowWMInfo(window, &info) && info.subsystem == SDL_SYSWM_X11) {
|
if (SDL_GetWindowWMInfo(window, &info) && info.subsystem == SDL_SYSWM_X11) {
|
||||||
|
xdisplay = info.info.x11.display;
|
||||||
xwindow = info.info.x11.window;
|
xwindow = info.info.x11.window;
|
||||||
}
|
}
|
||||||
if (xwindow) {
|
if (xdisplay && xwindow) {
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1241,8 +1243,9 @@ becomes:
|
|||||||
...
|
...
|
||||||
}
|
}
|
||||||
#elif defined(__LINUX__)
|
#elif defined(__LINUX__)
|
||||||
|
Display *xdisplay = (Display *)SDL_GetProperty(SDL_GetWindowProperties(window), "SDL.window.x11.display", NULL);
|
||||||
Window xwindow = (Window)SDL_GetNumberProperty(SDL_GetWindowProperties(window), "SDL.window.x11.window", 0);
|
Window xwindow = (Window)SDL_GetNumberProperty(SDL_GetWindowProperties(window), "SDL.window.x11.window", 0);
|
||||||
if (xwindow) {
|
if (xdisplay && xwindow) {
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user