x11: Use the SDL_WindowFlags type instead of Uint32

Uint32 can potentially truncate the flag value, as it is 64 bits in SDL3.
This commit is contained in:
Frank Praznik
2025-09-13 15:42:12 -04:00
parent de1b52f161
commit 4561be89a5
3 changed files with 3 additions and 3 deletions

View File

@@ -1658,7 +1658,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 * expected by SDL and its clients. Defer emitting the size/move events until the corresponding
* PropertyNotify arrives for consistency. * 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)) { if (changed & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_MAXIMIZED)) {
SDL_copyp(&data->pending_xconfigure, &xevent->xconfigure); SDL_copyp(&data->pending_xconfigure, &xevent->xconfigure);
data->emit_size_move_after_property_notify = true; data->emit_size_move_after_property_notify = true;

View File

@@ -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; SDL_VideoData *videodata = _this->internal;
Display *display = videodata->display; Display *display = videodata->display;

View File

@@ -128,7 +128,7 @@ struct SDL_WindowData
}; };
extern void X11_SetNetWMState(SDL_VideoDevice *_this, Window xwindow, SDL_WindowFlags flags); 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 bool X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props);
extern char *X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow); extern char *X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow);