From a7f72365540d5b6ca68cb54106e7301d172a7cf8 Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Sun, 8 Oct 2023 10:21:53 +0200 Subject: [PATCH] xdg-shell: handle changes in wm_geometry offset while not in a transaction In those cases, we only need to update the position of the scenegraph node. --- src/view/xdg-shell/xdg-toplevel.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/view/xdg-shell/xdg-toplevel.cpp b/src/view/xdg-shell/xdg-toplevel.cpp index 9fa99e34c..e0d638911 100644 --- a/src/view/xdg-shell/xdg-toplevel.cpp +++ b/src/view/xdg-shell/xdg-toplevel.cpp @@ -166,6 +166,20 @@ void wf::xdg_toplevel_t::handle_surface_commit() expand_dimensions_by_margins(get_current_wlr_toplevel_size(), _current.margins); if ((toplevel_size == wf::dimensions(current().geometry)) || !current().mapped) { + if (toplevel) + { + wlr_box wm_box; + wlr_xdg_surface_get_geometry(toplevel->base, &wm_box); + + if (this->wm_offset != wf::origin(wm_box)) + { + // Trigger reppositioning in the view implementation + xdg_toplevel_applied_state_signal event_applied; + event_applied.old_state = current(); + this->emit(&event_applied); + } + } + // Size did not change, there are no transactions going on - apply the new texture directly apply_pending_state(); return;