Browse Source

video: Rename 'state_not_floating' to the more descriptive 'tiled'

Frank Praznik 11 months ago
parent
commit
b1061a3ec1

+ 2 - 2
src/events/SDL_windowevents.c

@@ -72,7 +72,7 @@ int SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent,
             window->windowed.x = data1;
             window->windowed.y = data2;
 
-            if (!(window->flags & SDL_WINDOW_MAXIMIZED) && !window->state_not_floating) {
+            if (!(window->flags & SDL_WINDOW_MAXIMIZED) && !window->tiled) {
                 window->floating.x = data1;
                 window->floating.y = data2;
             }
@@ -88,7 +88,7 @@ int SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent,
             window->windowed.w = data1;
             window->windowed.h = data2;
 
-            if (!(window->flags & SDL_WINDOW_MAXIMIZED) && !window->state_not_floating) {
+            if (!(window->flags & SDL_WINDOW_MAXIMIZED) && !window->tiled) {
                 window->floating.w = data1;
                 window->floating.h = data2;
             }

+ 3 - 3
src/video/SDL_sysvideo.h

@@ -70,10 +70,10 @@ struct SDL_Window
      */
     SDL_Rect floating;
 
-    /* Toggle for drivers to indicate that the current window state is
-     * not floating, but may not have any fixed-size flags (e.g. tiled)
+    /* Toggle for drivers to indicate that the current window state is tiled,
+     * and sizes set non-programmatically shouldn't be cached.
      */
-    SDL_bool state_not_floating;
+    SDL_bool tiled;
 
     /* Whether or not the initial position was defined */
     SDL_bool undefined_x;

+ 2 - 2
src/video/wayland/SDL_waylandwindow.c

@@ -859,7 +859,7 @@ static void handle_configure_xdg_toplevel(void *data,
     wind->floating = floating;
     wind->suspended = suspended;
     wind->active = active;
-    window->state_not_floating = tiled;
+    window->tiled = tiled;
 
     if (wind->surface_status == WAYLAND_SURFACE_STATUS_WAITING_FOR_CONFIGURE) {
         wind->surface_status = WAYLAND_SURFACE_STATUS_WAITING_FOR_FRAME;
@@ -1191,7 +1191,7 @@ static void decoration_frame_configure(struct libdecor_frame *frame,
     wind->floating = floating;
     wind->suspended = suspended;
     wind->active = active;
-    window->state_not_floating = tiled;
+    window->tiled = tiled;
 
     /* Calculate the new window geometry */
     ConfigureWindowGeometry(window);