From 03cdd297e089cfb77e20b1f9a3ab8fc6ac396152 Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Fri, 21 Mar 2025 13:40:03 -0400
Subject: [PATCH] video: Fix boolean logic for getting the pending window
position
---
src/video/SDL_video.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index fd1a84ae64081..78b95014aa326 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -2925,12 +2925,12 @@ bool SDL_GetWindowPosition(SDL_Window *window, int *x, int *y)
}
}
} else {
- const bool use_current = !(window->flags & SDL_WINDOW_HIDDEN) && !window->last_position_pending;
+ const bool use_pending = (window->flags & SDL_WINDOW_HIDDEN) && window->last_position_pending;
if (x) {
- *x = use_current ? window->x : window->pending.x;
+ *x = use_pending ? window->pending.x : window->x;
}
if (y) {
- *y = use_current ? window->y : window->pending.y;
+ *y = use_pending ? window->pending.y : window->y;
}
}
return true;