// SPDX-License-Identifier: GPL-2.0-only
/* view-impl-common.c: common code for shell view->impl functions */
#include "view-impl-common.h"
+#include "config/rcxml.h"
#include "foreign-toplevel/foreign.h"
#include "labwc.h"
+#include "output.h"
+#include "output-state.h"
#include "view.h"
#include "window-rules.h"
if (view == server->active_view || !server->active_view) {
desktop_focus_topmost_view(server);
}
+
+ desktop_update_top_layer_visibility(view->server);
+
+ /*
+ * We may need to disable adaptive sync if view was fullscreen.
+ *
+ * FIXME: this logic doesn't account for multiple fullscreen
+ * views. It should probably be combined with the existing
+ * logic in desktop_update_top_layer_visibility().
+ */
+ if (view->fullscreen && rc.adaptive_sync == LAB_ADAPTIVE_SYNC_FULLSCREEN
+ && output_is_usable(view->output)) {
+ output_enable_adaptive_sync(view->output, false);
+ output_state_commit(view->output);
+ }
}
static bool
undecorate(view);
view_set_icon(view, NULL, NULL);
-
- /*
- * The layer-shell top-layer is disabled when an application is running
- * in fullscreen mode, so if that's the case, we may have to re-enable
- * it here.
- */
- if (view->fullscreen && view->output) {
- view->fullscreen = false;
- desktop_update_top_layer_visibility(server);
- if (rc.adaptive_sync == LAB_ADAPTIVE_SYNC_FULLSCREEN) {
- set_adaptive_sync_fullscreen(view);
- }
- }
-
menu_on_view_destroy(view);
/*