aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2023-11-24 12:57:59 +0300
committerIsaac Freund <mail@isaacfreund.com>2023-11-25 11:47:11 +0000
commit87346b3393f9c38430b34f548a806e54c116686f (patch)
treef3229696151c794055125fdf5f4297cbc2741ee2
parent36cc698bc5513655e5c57ba62693fce9001d86e7 (diff)
Revert "subcompositor: emit new_subsurface immediately"
new_subsurface emitted immediately isn't actually that useful. Revert the change and document that this event is special. This reverts commit 504b9491f05d3227d45ea6bcc9c347e1a6bf9586.
-rw-r--r--include/wlr/types/wlr_compositor.h7
-rw-r--r--types/wlr_subcompositor.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/include/wlr/types/wlr_compositor.h b/include/wlr/types/wlr_compositor.h
index 322e9ed2..26530951 100644
--- a/include/wlr/types/wlr_compositor.h
+++ b/include/wlr/types/wlr_compositor.h
@@ -190,7 +190,12 @@ struct wlr_surface {
*/
struct wl_signal unmap;
- struct wl_signal new_subsurface;
+ /**
+ * Note: unlike other new_* signals, new_subsurface is emitted when
+ * the subsurface is added to the parent surface's current state,
+ * not when the object is created.
+ */
+ struct wl_signal new_subsurface; // struct wlr_subsurface
struct wl_signal destroy;
} events;
diff --git a/types/wlr_subcompositor.c b/types/wlr_subcompositor.c
index f20d8042..c66d6f1d 100644
--- a/types/wlr_subcompositor.c
+++ b/types/wlr_subcompositor.c
@@ -289,6 +289,8 @@ void subsurface_handle_parent_commit(struct wlr_subsurface *subsurface) {
if (!subsurface->added) {
subsurface->added = true;
+ wl_signal_emit_mutable(&subsurface->parent->events.new_subsurface,
+ subsurface);
subsurface_consider_map(subsurface);
}
}
@@ -362,8 +364,6 @@ static void subcompositor_handle_get_subsurface(struct wl_client *client,
wl_list_init(&subsurface->current.link);
wl_list_insert(parent->pending.subsurfaces_above.prev,
&subsurface->pending.link);
-
- wl_signal_emit_mutable(&subsurface->parent->events.new_subsurface, subsurface);
}
static const struct wl_subcompositor_interface subcompositor_impl = {