aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorllyyr <llyyr.public@gmail.com>2024-07-04 03:01:25 +0530
committerSimon Ser <contact@emersion.fr>2024-07-03 23:38:38 +0200
commitfdcfe00781d3ee31df99acb43ccd3873d2229809 (patch)
treeafbb104ff828df6bd2a844d6501559719d52eac2
parent5233a0bd2ef84ab6d1eeb2ebcde3d0c73794cdb9 (diff)
xdg_shell: don't send configure events to uninitialized surfaces
the surface isn't initialized yet when we first handle it in `handle_xdg_shell_toplevel`, move setting WM capabilities to handle_commit instead. Fixes warnings from wlroots about a configure being scheduled for uninitialized surface
-rw-r--r--sway/desktop/xdg_shell.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 7c417891..fdfa7b65 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -289,6 +289,8 @@ static void handle_commit(struct wl_listener *listener, void *data) {
}
// XXX: https://github.com/swaywm/sway/issues/2176
wlr_xdg_surface_schedule_configure(xdg_surface);
+ wlr_xdg_toplevel_set_wm_capabilities(view->wlr_xdg_toplevel,
+ XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
// TODO: wlr_xdg_toplevel_set_bounds()
return;
}
@@ -575,7 +577,4 @@ void handle_xdg_shell_toplevel(struct wl_listener *listener, void *data) {
wlr_scene_xdg_surface_create(xdg_shell_view->view.content_tree, xdg_toplevel->base);
xdg_toplevel->base->data = xdg_shell_view;
-
- wlr_xdg_toplevel_set_wm_capabilities(xdg_toplevel,
- XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
}