From c413a8d183ce7039abc9c181cb585889707a50b3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Oct 2023 16:12:22 +1100 Subject: [PATCH] Fix error clearing the windows libdecor state on failure on Wayland API docs note the state should remain unchanged when accessing the state fails. --- intern/ghost/intern/GHOST_WindowWayland.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/intern/ghost/intern/GHOST_WindowWayland.cc b/intern/ghost/intern/GHOST_WindowWayland.cc index 0b506d10503..405782789cc 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.cc +++ b/intern/ghost/intern/GHOST_WindowWayland.cc @@ -1106,13 +1106,11 @@ static void libdecor_frame_handle_configure(libdecor_frame *frame, /* Set the state. */ { enum libdecor_window_state window_state; - if (!libdecor_configuration_get_window_state(configuration, &window_state)) { - window_state = LIBDECOR_WINDOW_STATE_NONE; + if (libdecor_configuration_get_window_state(configuration, &window_state)) { + frame_pending->is_maximised = window_state & LIBDECOR_WINDOW_STATE_MAXIMIZED; + frame_pending->is_fullscreen = window_state & LIBDECOR_WINDOW_STATE_FULLSCREEN; + frame_pending->is_active = window_state & LIBDECOR_WINDOW_STATE_ACTIVE; } - - frame_pending->is_maximised = window_state & LIBDECOR_WINDOW_STATE_MAXIMIZED; - frame_pending->is_fullscreen = window_state & LIBDECOR_WINDOW_STATE_FULLSCREEN; - frame_pending->is_active = window_state & LIBDECOR_WINDOW_STATE_ACTIVE; } /* Commit the changes. */