mirror of https://github.com/libsdl-org/SDL.git
video: Send pending coordinates for moved, hidden windows
Some backends can't actually position a window until it is shown/mapped, so assume that it will be where it was asked to be as long as it is hidden.
This commit is contained in:
parent
b9504f247c
commit
d66483dfcc
|
|
@ -2925,11 +2925,12 @@ bool SDL_GetWindowPosition(SDL_Window *window, int *x, int *y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
const bool use_current = !(window->flags & SDL_WINDOW_HIDDEN) && !window->last_position_pending;
|
||||||
if (x) {
|
if (x) {
|
||||||
*x = window->x;
|
*x = use_current ? window->x : window->pending.x;
|
||||||
}
|
}
|
||||||
if (y) {
|
if (y) {
|
||||||
*y = window->y;
|
*y = use_current ? window->y : window->pending.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue