SDL_syswm.h has been removed and replaced with window properties

This commit is contained in:
Sam Lantinga
2023-11-07 14:38:19 -08:00
parent aea6e6de6f
commit fd4a2cce9e
82 changed files with 277 additions and 1069 deletions

View File

@@ -32,7 +32,6 @@
#ifdef SDL_VIDEO_DRIVER_X11
#include "../../video/x11/SDL_x11video.h"
#endif
#include <SDL3/SDL_syswm.h>
#include <sys/inotify.h>
#include <unistd.h>
@@ -689,7 +688,6 @@ SDL_bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
void SDL_IBus_UpdateTextRect(const SDL_Rect *rect)
{
SDL_Window *focused_win;
SDL_SysWMinfo info;
int x = 0, y = 0;
SDL_DBusContext *dbus;
@@ -704,18 +702,19 @@ void SDL_IBus_UpdateTextRect(const SDL_Rect *rect)
SDL_GetWindowPosition(focused_win, &x, &y);
if (SDL_GetWindowWMInfo(focused_win, &info, SDL_SYSWM_CURRENT_VERSION) == 0) {
#ifdef SDL_ENABLE_SYSWM_X11
if (info.subsystem == SDL_SYSWM_X11) {
Display *x_disp = info.info.x11.display;
int x_screen = info.info.x11.screen;
Window x_win = info.info.x11.window;
Window unused;
#ifdef SDL_VIDEO_DRIVER_X11
{
SDL_PropertiesID props = SDL_GetWindowProperties(focused_win);
Display *x_disp = (Display *)SDL_GetProperty(props, "SDL.window.x11.display");
int x_screen = (int)(intptr_t)SDL_GetProperty(props, "SDL.window.x11.screen");
Window x_win = (Window)SDL_GetProperty(props, "SDL.window.x11.window");
Window unused;
if (x_disp && x_win) {
X11_XTranslateCoordinates(x_disp, x_win, RootWindow(x_disp, x_screen), 0, 0, &x, &y, &unused);
}
#endif
}
#endif
x += ibus_cursor_rect.x;
y += ibus_cursor_rect.y;