From 7e12957c028daea69037c079785efe5ed94f4a28 Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Wed, 1 Jan 2025 13:40:59 +0100 Subject: [PATCH] xdg-toplevel-view: read csd state as soon as possible We used to delay reading csd state until map time, but decoration plugins want to know this earlier. --- src/view/xdg-shell/xdg-toplevel-view.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/view/xdg-shell/xdg-toplevel-view.cpp b/src/view/xdg-shell/xdg-toplevel-view.cpp index d2fb843d1..82e4a98ce 100644 --- a/src/view/xdg-shell/xdg-toplevel-view.cpp +++ b/src/view/xdg-shell/xdg-toplevel-view.cpp @@ -243,6 +243,11 @@ wf::xdg_toplevel_view_t::xdg_toplevel_view_t(wlr_xdg_toplevel *tlvl) : xdg_tople on_request_minimize.connect(&xdg_toplevel->events.request_minimize); on_show_window_menu.connect(&xdg_toplevel->events.request_show_window_menu); on_request_fullscreen.connect(&xdg_toplevel->events.request_fullscreen); + + if (xdg_toplevel && uses_csd.count(xdg_toplevel->base->surface)) + { + this->has_client_decoration = uses_csd[xdg_toplevel->base->surface]; + } } std::shared_ptr wf::xdg_toplevel_view_t::create(wlr_xdg_toplevel *toplevel) @@ -302,11 +307,6 @@ bool wf::xdg_toplevel_view_t::is_mapped() const void wf::xdg_toplevel_view_t::map() { - if (xdg_toplevel && uses_csd.count(xdg_toplevel->base->surface)) - { - this->has_client_decoration = uses_csd[xdg_toplevel->base->surface]; - } - adjust_view_output_on_map(this); xdg_toplevel_view_base_t::map();