From 56507a6122ca9e83619bf60338e2e7fb0cd9165f Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Sat, 13 Sep 2025 15:42:12 -0400 Subject: [PATCH] x11: Use the SDL_WindowFlags type instead of Uint32 Uint32 can potentially truncate the flag value, as it is 64 bits in SDL3. (cherry picked from commit 4561be89a5163aa393788be83bec99c7c49f6f27) --- src/video/x11/SDL_x11events.c | 2 +- src/video/x11/SDL_x11window.c | 2 +- src/video/x11/SDL_x11window.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index d639346b6b..72eb79b3f1 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -1514,7 +1514,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) * expected by SDL and its clients. Defer emitting the size/move events until the corresponding * PropertyNotify arrives for consistency. */ - const Uint32 changed = X11_GetNetWMState(_this, data->window, xevent->xproperty.window) ^ data->window->flags; + const SDL_WindowFlags changed = X11_GetNetWMState(_this, data->window, xevent->xproperty.window) ^ data->window->flags; if (changed & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_MAXIMIZED)) { SDL_copyp(&data->pending_xconfigure, &xevent->xconfigure); data->emit_size_move_after_property_notify = true; diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 5422f9abf5..b6a9a8818b 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -283,7 +283,7 @@ static void X11_SetKeyboardFocus(SDL_Window *window, bool set_active_focus) } } -Uint32 X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwindow) +SDL_WindowFlags X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwindow) { SDL_VideoData *videodata = _this->internal; Display *display = videodata->display; diff --git a/src/video/x11/SDL_x11window.h b/src/video/x11/SDL_x11window.h index 893334075f..36e259a77f 100644 --- a/src/video/x11/SDL_x11window.h +++ b/src/video/x11/SDL_x11window.h @@ -128,7 +128,7 @@ struct SDL_WindowData }; extern void X11_SetNetWMState(SDL_VideoDevice *_this, Window xwindow, SDL_WindowFlags flags); -extern Uint32 X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwindow); +extern SDL_WindowFlags X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwindow); extern bool X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props); extern char *X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow);