aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-01-31 15:47:20 +0100
committerSimon Ser <contact@emersion.fr>2023-01-31 16:20:10 +0100
commite69dd909f71c13c72c9d317465e75ad1f65b514e (patch)
tree6f9fffc1d7c52ce431ab5b6584412cf84b0f5a2e
parentd36dd96e8dbec4308472ff866ef4b353fc83ad90 (diff)
xdg-shell: reset added/committed flag on unmap
When a client attaches a NULL buffer to its wl_surface, it's unmapped. This resets the xdg_surface in its initial state. An extra NULL commit makes the compositor send an initial configure event. Note, wlr_xdg_toplevel.added is separate from wlr_xdg_surface.added. Closes: https://github.com/swaywm/sway/issues/7397
-rw-r--r--types/xdg_shell/wlr_xdg_popup.c2
-rw-r--r--types/xdg_shell/wlr_xdg_toplevel.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/types/xdg_shell/wlr_xdg_popup.c b/types/xdg_shell/wlr_xdg_popup.c
index b528c0db..e6bdb8aa 100644
--- a/types/xdg_shell/wlr_xdg_popup.c
+++ b/types/xdg_shell/wlr_xdg_popup.c
@@ -449,6 +449,8 @@ void unmap_xdg_popup(struct wlr_xdg_popup *popup) {
popup->seat = NULL;
}
+
+ popup->committed = false;
}
void destroy_xdg_popup(struct wlr_xdg_popup *popup) {
diff --git a/types/xdg_shell/wlr_xdg_toplevel.c b/types/xdg_shell/wlr_xdg_toplevel.c
index 2ef1379f..a8728141 100644
--- a/types/xdg_shell/wlr_xdg_toplevel.c
+++ b/types/xdg_shell/wlr_xdg_toplevel.c
@@ -535,6 +535,8 @@ void unmap_xdg_toplevel(struct wlr_xdg_toplevel *toplevel) {
toplevel->requested.fullscreen = false;
toplevel->requested.maximized = false;
toplevel->requested.minimized = false;
+
+ toplevel->added = false;
}
void destroy_xdg_toplevel(struct wlr_xdg_toplevel *toplevel) {