wayland: Avoid duplicate resize events when entering fullscreen

This commit is contained in:
Cameron Gutman 2022-08-12 16:39:39 -05:00
parent a28f426acb
commit 780b031b1b

View file

@ -631,16 +631,14 @@ handle_configure_xdg_toplevel(void *data,
* UPDATE: Nope, sure enough a compositor sends 0,0. This is a known bug: * UPDATE: Nope, sure enough a compositor sends 0,0. This is a known bug:
* https://bugs.kde.org/show_bug.cgi?id=444962 * https://bugs.kde.org/show_bug.cgi?id=444962
*/ */
if (!FullscreenModeEmulation(window)) { if (FullscreenModeEmulation(window)) {
GetFullScreenDimensions(window, &width, &height, NULL, NULL);
}
if (width != 0 && height != 0 && (window->w != width || window->h != height)) { if (width != 0 && height != 0 && (window->w != width || window->h != height)) {
window->w = width; window->w = width;
window->h = height; window->h = height;
wind->needs_resize_event = SDL_TRUE; wind->needs_resize_event = SDL_TRUE;
} }
} else {
GetFullScreenDimensions(window, &window->w, &window->h, NULL, NULL);
wind->needs_resize_event = SDL_TRUE;
}
/* This part is good though. */ /* This part is good though. */
if ((window->flags & SDL_WINDOW_ALLOW_HIGHDPI) && !FloatEqual(wind->scale_factor, driverdata->scale_factor)) { if ((window->flags & SDL_WINDOW_ALLOW_HIGHDPI) && !FloatEqual(wind->scale_factor, driverdata->scale_factor)) {
@ -834,8 +832,6 @@ decoration_frame_configure(struct libdecor_frame *frame,
GetFullScreenDimensions(window, &width, &height, NULL, NULL); GetFullScreenDimensions(window, &width, &height, NULL, NULL);
} }
wind->needs_resize_event = SDL_TRUE;
/* This part is good though. */ /* This part is good though. */
if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
scale_factor = driverdata->scale_factor; scale_factor = driverdata->scale_factor;