From e69dfbd5e40d23a93418ed695c607d3b6850a74c Mon Sep 17 00:00:00 2001 From: The412Banner Date: Mon, 21 Sep 2026 16:11:20 -0400 Subject: [PATCH] Compositor log: frame-size changes, and a window being renamed Two events the log was silent about, both of which a report needed this week. A window that changes the size of the frames it commits has rebuilt its swapchain, and that is what a game suddenly filling one corner of the screen looks like from the compositor's side: FlatOut came back from the Steam menu in a smaller swapchain and the log said nothing at all, so the size had to be inferred from a screenshot. It now says both sizes on the line. And a window already on screen being renamed is something else taking it over: gamescope keeps one toplevel and retitles it as the game takes the screen. That was silent, which left the log showing a window "closed" under a name it had never been logged as opening - reading like a missing event when it was really a rename. Both are rare by nature; there is nothing to rate-limit. --- app/src/main/cpp/waylandcomp/src/compositor.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/src/main/cpp/waylandcomp/src/compositor.c b/app/src/main/cpp/waylandcomp/src/compositor.c index d0071a8d01..a3a9946498 100644 --- a/app/src/main/cpp/waylandcomp/src/compositor.c +++ b/app/src/main/cpp/waylandcomp/src/compositor.c @@ -704,6 +704,18 @@ static void take_dmabuf(struct surface *s, struct dmabuf_buffer *b, struct wl_re } } if (s->shm_img) { vkp_image_destroy(s->shm_img); s->shm_img = NULL; } + /* The size of the frames a window commits, when it changes after the first announcement: the + * program rebuilt its swapchain. It earns a line of its own, because a game whose swapchain + * came back smaller than it was is exactly what a picture suddenly filling one corner of the + * screen looks like from here - and the two sizes are the whole of the evidence. Rare by + * nature, so there is nothing to rate-limit. */ + if (s->announced_vulkan && s->buf_w && s->buf_h && + (s->buf_w != b->width || s->buf_h != b->height)) { + char name[160]; + describe(s, name, sizeof(name)); + banner_log("vulkan", "%s changed its frame size: %dx%d -> %dx%d", name, + s->buf_w, s->buf_h, b->width, b->height); + } s->buf_w = b->width; s->buf_h = b->height; s->has_content = b->img != NULL; @@ -1210,8 +1222,21 @@ static void xdg_toplevel_noop_parent(struct wl_client *c, struct wl_resource *r, static void xdg_toplevel_set_title(struct wl_client *c, struct wl_resource *r, const char *title) { struct surface *s = wl_resource_get_user_data(r); if (!s) return; + /* A window already on screen being renamed is something else taking it over: gamescope keeps + * one toplevel and retitles it as the game takes the screen. Unlogged, that left the log + * showing a window "closed" under a name it had never been logged as opening - which reads + * like a missing event and is really a rename. A title set before the window is mapped needs + * no line: the "opened" line carries it. */ + int announce = s->mapped && title && *title && (!s->title || strcmp(s->title, title) != 0); + char before[160]; + if (announce) describe(s, before, sizeof(before)); free(s->title); s->title = title ? strdup(title) : NULL; + if (announce) { + char after[160]; + describe(s, after, sizeof(after)); + banner_log("window", "renamed %s -> %s", before, after); + } } static void xdg_toplevel_set_app_id(struct wl_client *c, struct wl_resource *r, const char *id) {} static void xdg_toplevel_show_menu(struct wl_client *c, struct wl_resource *r, struct wl_resource *seat,