mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-21 06:45:44 +00:00
x11: Improve sync algorithm
Track and check move and resize requests separately, and consider them done if either the window is already at the expected location, or at least one configure event which moved or resized the window was processed. The avoids a timeout condition if resizing the window caused it to be implicitly moved in order to keep it within desktop bounds. The automated positioning test now runs on GNOME/X11 without any sync requests timing out.
This commit is contained in:
@@ -1134,10 +1134,9 @@ static int video_getSetWindowSize(void *arg)
|
||||
SDL_SetWindowSize(window, desiredW, desiredH);
|
||||
SDLTest_AssertPass("Call to SDL_SetWindowSize(...,%d,%d)", desiredW, desiredH);
|
||||
|
||||
/* The sync may time out if changing the size changes the window position. */
|
||||
result = SDL_SyncWindow(window);
|
||||
SDLTest_AssertPass("SDL_SyncWindow()");
|
||||
SDLTest_AssertCheck(result >= 0, "Verify return value; expected: >=0, got: %d", result);
|
||||
SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result);
|
||||
|
||||
/* Get size */
|
||||
currentW = desiredW + 1;
|
||||
|
||||
Reference in New Issue
Block a user