bounds and anonymus union in absinthe_toplevel

This commit is contained in:
2026-04-29 17:32:57 +07:00
parent f7367395f0
commit 5af4ca8015
10 changed files with 68 additions and 60 deletions
+8 -6
View File
@@ -12,7 +12,7 @@ void xwayland_activate(struct wl_listener *listener, void *data)
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel, xwayland_activate);
if (!absinthe_toplevel_is_unmanaged(toplevel))
wlr_xwayland_surface_activate(toplevel->toplevel.x11, 1);
wlr_xwayland_surface_activate(toplevel->xwayland_surface, 1);
}
void xwayland_associate(struct wl_listener *listener, void *data)
@@ -21,9 +21,9 @@ void xwayland_associate(struct wl_listener *listener, void *data)
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel, xwayland_associate);
toplevel->map.notify = absinthe_toplevel_map;
wl_signal_add(&toplevel->toplevel.x11->surface->events.map, &toplevel->map);
wl_signal_add(&toplevel->xwayland_surface->surface->events.map, &toplevel->map);
toplevel->unmap.notify = absinthe_toplevel_unmap;
wl_signal_add(&toplevel->toplevel.x11->surface->events.unmap, &toplevel->unmap);
wl_signal_add(&toplevel->xwayland_surface->surface->events.unmap, &toplevel->unmap);
}
void xwayland_dissociate(struct wl_listener *listener, void *data)
@@ -41,14 +41,16 @@ void xwayland_configure(struct wl_listener *listener, void *data)
struct absinthe_toplevel *toplevel = wl_container_of(listener, toplevel, xwayland_configure);
struct wlr_xwayland_surface_configure_event *event = data;
if (!toplevel->toplevel.x11->surface || !toplevel->toplevel.x11->surface->mapped) {
wlr_xwayland_surface_configure(toplevel->toplevel.x11, event->x, event->y, event->width, event->height);
if (!toplevel->xwayland_surface->surface || !toplevel->xwayland_surface->surface->mapped) {
wlr_xwayland_surface_configure(toplevel->xwayland_surface, event->x, event->y, event->width,
event->height);
return;
}
if (absinthe_toplevel_is_unmanaged(toplevel)) {
wlr_scene_node_set_position(&toplevel->scene_tree->node, event->x, event->y);
wlr_xwayland_surface_configure(toplevel->toplevel.x11, event->x, event->y, event->width, event->height);
wlr_xwayland_surface_configure(toplevel->xwayland_surface, event->x, event->y, event->width,
event->height);
return;
}
}