diff --git a/examples/embedded.c b/examples/embedded.c
index ff8b8851f066a0f0fcc3568403118f97b36f9175..c488e0111cdf0a8289d85f34284ae628ec09aa85 100644
--- a/examples/embedded.c
+++ b/examples/embedded.c
@@ -16,6 +16,12 @@
 
 #include "xdg-shell-client-protocol.h"
 
+struct surface {
+	struct wlr_surface *wlr;
+	struct wl_listener commit;
+	struct wl_listener destroy;
+};
+
 static struct wl_display *remote_display = NULL;
 static struct wl_compositor *compositor = NULL;
 static struct wl_subcompositor *subcompositor = NULL;
@@ -119,8 +125,34 @@ static void output_handle_frame(struct wl_listener *listener, void *data) {
 	wlr_scene_output_send_frame_done(scene_output, &now);
 }
 
+static void surface_handle_commit(struct wl_listener *listener, void *data) {
+	struct surface *surface = wl_container_of(listener, surface, commit);
+	struct wlr_xdg_toplevel *xdg_toplevel =
+		wlr_xdg_toplevel_try_from_wlr_surface(surface->wlr);
+	if (xdg_toplevel != NULL && xdg_toplevel->base->initial_commit) {
+		wlr_xdg_toplevel_set_size(xdg_toplevel, 0, 0);
+	}
+}
+
+static void surface_handle_destroy(struct wl_listener *listener, void *data) {
+	struct surface *surface = wl_container_of(listener, surface, destroy);
+	wl_list_remove(&surface->commit.link);
+	wl_list_remove(&surface->destroy.link);
+	free(surface);
+}
+
 static void handle_new_surface(struct wl_listener *listener, void *data) {
 	struct wlr_surface *wlr_surface = data;
+
+	struct surface *surface = calloc(1, sizeof(*surface));
+	surface->wlr = wlr_surface;
+
+	surface->commit.notify = surface_handle_commit;
+	wl_signal_add(&wlr_surface->events.commit, &surface->commit);
+
+	surface->destroy.notify = surface_handle_destroy;
+	wl_signal_add(&wlr_surface->events.destroy, &surface->destroy);
+
 	wlr_scene_surface_create(&scene->tree, wlr_surface);
 }
 
diff --git a/examples/output-layers.c b/examples/output-layers.c
index cd05d9f0eba3327e3562c55bbbf846ec785cda8c..d7fadac3ad4d97ab4ff6a1a263189bee55506970 100644
--- a/examples/output-layers.c
+++ b/examples/output-layers.c
@@ -204,6 +204,12 @@ static void output_surface_handle_commit(struct wl_listener *listener,
 	struct output_surface *output_surface =
 		wl_container_of(listener, output_surface, commit);
 
+	struct wlr_xdg_toplevel *xdg_toplevel =
+		wlr_xdg_toplevel_try_from_wlr_surface(output_surface->wlr_surface);
+	if (xdg_toplevel != NULL && xdg_toplevel->base->initial_commit) {
+		wlr_xdg_toplevel_set_size(xdg_toplevel, 0, 0);
+	}
+
 	struct wlr_buffer *buffer = NULL;
 	if (output_surface->wlr_surface->buffer != NULL) {
 		buffer = wlr_buffer_lock(&output_surface->wlr_surface->buffer->base);
diff --git a/examples/scene-graph.c b/examples/scene-graph.c
index fb530c0674a09a08be8fc92c14723483d724e94d..42198653465ab90d7de41d366b7daca9a81644c8 100644
--- a/examples/scene-graph.c
+++ b/examples/scene-graph.c
@@ -94,9 +94,16 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) {
 
 static void surface_handle_commit(struct wl_listener *listener, void *data) {
 	struct surface *surface = wl_container_of(listener, surface, commit);
+
 	wlr_scene_rect_set_size(surface->border,
 			surface->wlr->current.width + 2 * border_width,
 			surface->wlr->current.height + 2 * border_width);
+
+	struct wlr_xdg_toplevel *xdg_toplevel =
+		wlr_xdg_toplevel_try_from_wlr_surface(surface->wlr);
+	if (xdg_toplevel != NULL && xdg_toplevel->base->initial_commit) {
+		wlr_xdg_toplevel_set_size(xdg_toplevel, 0, 0);
+	}
 }
 
 static void surface_handle_destroy(struct wl_listener *listener, void *data) {