Skip to content

Commit

Permalink
wayland: Never use the cached size for maximized or tiled windows
Browse files Browse the repository at this point in the history
Don't use the cached floating window size for maximized or tiled windows. Fixes the initial window size when creating a window with the maximized flag set.
  • Loading branch information
Kontrabant committed Mar 11, 2023
1 parent f4c1260 commit 3e28588
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/video/wayland/SDL_waylandwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,9 @@ static void decoration_frame_configure(struct libdecor_frame *frame,
*
* https://gitlab.gnome.org/jadahl/libdecor/-/issues/40
*/
const SDL_bool use_cached_size = (floating && !wind->floating) ||
(window->is_hiding || !!(window->flags & SDL_WINDOW_HIDDEN));
const SDL_bool use_cached_size = !maximized && !tiled &&
((floating && !wind->floating) ||
(window->is_hiding || (window->flags & SDL_WINDOW_HIDDEN)));

/* This will never set 0 for width/height unless the function returns false */
if (use_cached_size || !libdecor_configuration_get_content_size(configuration, frame, &width, &height)) {
Expand Down

0 comments on commit 3e28588

Please sign in to comment.