Skip to content

Commit 6519158

Browse files
committed
wayland: Ignore bogus libdecor content sizes if an unmapped window is suspended
If a client takes a long time to present the first frame after creating the window, a configure event to set the suspended state may arrive with libdecor increasing the content size by the decoration dimensions, which should be ignored. (cherry picked from commit 9d5d701)
1 parent 00718d6 commit 6519158

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/video/wayland/SDL_waylandwindow.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,8 +1295,13 @@ static void decoration_frame_configure(struct libdecor_frame *frame,
12951295
} else {
12961296
/* Don't apply the supplied dimensions if they haven't changed from the last configuration
12971297
* event, or a newer size set programmatically can be overwritten by old data.
1298+
*
1299+
* If a client takes a long time to present the first frame after creating the window, a
1300+
* configure event to set the suspended state may arrive with the content size increased
1301+
* by the decoration dimensions, which should also be ignored.
12981302
*/
1299-
if (width != wind->last_configure.width || height != wind->last_configure.height) {
1303+
if ((width != wind->last_configure.width || height != wind->last_configure.height) &&
1304+
!(wind->shell_surface_status == WAYLAND_SHELL_SURFACE_STATUS_WAITING_FOR_FRAME && wind->suspended != suspended)) {
13001305
wind->requested.logical_width = width;
13011306
wind->requested.logical_height = height;
13021307

0 commit comments

Comments
 (0)