فهرست منبع

x11: Use the SDL_WindowFlags type instead of Uint32

Uint32 can potentially truncate the flag value, as it is 64 bits in SDL3.
Frank Praznik 22 ساعت پیش
والد
کامیت
4561be89a5
3فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 1 1
      src/video/x11/SDL_x11events.c
  2. 1 1
      src/video/x11/SDL_x11window.c
  3. 1 1
      src/video/x11/SDL_x11window.h

+ 1 - 1
src/video/x11/SDL_x11events.c

@@ -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
          * 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;

+ 1 - 1
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;

+ 1 - 1
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);