This commit is contained in:
Devin J. Pohly 2026-01-11 00:09:59 +03:00 committed by GitHub
commit ab7e34b81a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 13 deletions

View file

@ -122,6 +122,19 @@ handle_xwayland_surface_request_fullscreen(struct wl_listener *listener, void *d
}
}
static void
handle_xwayland_surface_set_geometry(struct wl_listener *listener, void *data)
{
struct cg_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, set_geometry);
struct cg_view *view = &xwayland_view->view;
if (!xwayland_view_should_manage(view)) {
view->lx = xwayland_view->xwayland_surface->x;
view->ly = xwayland_view->xwayland_surface->y;
view_position(view);
}
}
static void
handle_xwayland_surface_unmap(struct wl_listener *listener, void *data)
{
@ -137,11 +150,6 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *data)
struct cg_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, map);
struct cg_view *view = &xwayland_view->view;
if (!xwayland_view_should_manage(view)) {
view->lx = xwayland_view->xwayland_surface->x;
view->ly = xwayland_view->xwayland_surface->y;
}
view_map(view, xwayland_view->xwayland_surface->surface);
if (xwayland_view->xwayland_surface->title)
@ -164,6 +172,7 @@ handle_xwayland_surface_destroy(struct wl_listener *listener, void *data)
wl_list_remove(&xwayland_view->dissociate.link);
wl_list_remove(&xwayland_view->destroy.link);
wl_list_remove(&xwayland_view->request_fullscreen.link);
wl_list_remove(&xwayland_view->set_geometry.link);
xwayland_view->xwayland_surface = NULL;
view_destroy(view);
@ -214,6 +223,8 @@ handle_xwayland_surface_new(struct wl_listener *listener, void *data)
view_init(&xwayland_view->view, server, CAGE_XWAYLAND_VIEW, &xwayland_view_impl);
xwayland_view->xwayland_surface = xwayland_surface;
xwayland_view->view.lx = xwayland_surface->x;
xwayland_view->view.ly = xwayland_surface->y;
xwayland_view->associate.notify = handle_xwayland_associate;
wl_signal_add(&xwayland_surface->events.associate, &xwayland_view->associate);
@ -223,4 +234,6 @@ handle_xwayland_surface_new(struct wl_listener *listener, void *data)
wl_signal_add(&xwayland_surface->events.destroy, &xwayland_view->destroy);
xwayland_view->request_fullscreen.notify = handle_xwayland_surface_request_fullscreen;
wl_signal_add(&xwayland_surface->events.request_fullscreen, &xwayland_view->request_fullscreen);
xwayland_view->set_geometry.notify = handle_xwayland_surface_set_geometry;
wl_signal_add(&xwayland_surface->events.set_geometry, &xwayland_view->set_geometry);
}