xdg_shell: split off initial commit handler to separate function
Some checks failed
Continuous integration build / compile (clang, alpine:edge, disabled) (push) Has been cancelled
Continuous integration build / compile (clang, alpine:edge, enabled) (push) Has been cancelled
Continuous integration build / compile (clang, archlinux:base-devel, disabled) (push) Has been cancelled
Continuous integration build / compile (clang, archlinux:base-devel, enabled) (push) Has been cancelled
Continuous integration build / compile (gcc, alpine:edge, disabled) (push) Has been cancelled
Continuous integration build / compile (gcc, alpine:edge, enabled) (push) Has been cancelled
Continuous integration build / compile (gcc, archlinux:base-devel, disabled) (push) Has been cancelled
Continuous integration build / compile (gcc, archlinux:base-devel, enabled) (push) Has been cancelled
Continuous integration build / format (push) Has been cancelled
Continuous integration build / scan-build (push) Has been cancelled

This commit is contained in:
Simon Ser 2026-06-28 19:28:54 +02:00
parent 0f0c637a06
commit 350e2ef8b9

View file

@ -244,19 +244,8 @@ handle_xdg_toplevel_map(struct wl_listener *listener, void *data)
} }
static void static void
handle_xdg_toplevel_commit(struct wl_listener *listener, void *data) handle_xdg_toplevel_initial_commit(struct cg_xdg_shell_view *xdg_shell_view)
{ {
struct cg_xdg_shell_view *xdg_shell_view = wl_container_of(listener, xdg_shell_view, commit);
if (xdg_shell_view->xdg_toplevel->base->surface->mapped) {
wlr_foreign_toplevel_handle_v1_set_fullscreen(xdg_shell_view->view.foreign_toplevel_handle,
xdg_shell_view->xdg_toplevel->current.fullscreen);
}
if (!xdg_shell_view->xdg_toplevel->base->initial_commit) {
return;
}
/* When an xdg_surface performs an initial commit, the compositor must /* When an xdg_surface performs an initial commit, the compositor must
* reply with a configure so the client can map the surface. */ * reply with a configure so the client can map the surface. */
wlr_xdg_surface_schedule_configure(xdg_shell_view->xdg_toplevel->base); wlr_xdg_surface_schedule_configure(xdg_shell_view->xdg_toplevel->base);
@ -269,6 +258,21 @@ handle_xdg_toplevel_commit(struct wl_listener *listener, void *data)
} }
} }
static void
handle_xdg_toplevel_commit(struct wl_listener *listener, void *data)
{
struct cg_xdg_shell_view *xdg_shell_view = wl_container_of(listener, xdg_shell_view, commit);
if (xdg_shell_view->xdg_toplevel->base->surface->mapped) {
wlr_foreign_toplevel_handle_v1_set_fullscreen(xdg_shell_view->view.foreign_toplevel_handle,
xdg_shell_view->xdg_toplevel->current.fullscreen);
}
if (xdg_shell_view->xdg_toplevel->base->initial_commit) {
handle_xdg_toplevel_initial_commit(xdg_shell_view);
}
}
static void static void
handle_xdg_toplevel_destroy(struct wl_listener *listener, void *data) handle_xdg_toplevel_destroy(struct wl_listener *listener, void *data)
{ {