From 36b0bea4708e17def2d636d2a200a7498565b6c8 Mon Sep 17 00:00:00 2001 From: The412Banner Date: Sun, 20 Sep 2026 04:49:13 -0400 Subject: [PATCH] Compositor: tell a nested toplevel the output's size labwc's Wayland backend, configured with 0x0, opened wlroots' default 1280x720 window and the whole desktop was upscaled from it - the r29 and r30 logs both show the output at 1280x720 whatever rc.xml and wlr-randr asked. The configure now carries the output's size; gamescope is told the same numbers on its command line, so nothing changes for the Steam client. --- app/src/main/cpp/waylandcomp/src/compositor.c | 9 ++++++--- tools/linuxfs/desktop/autostart | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/cpp/waylandcomp/src/compositor.c b/app/src/main/cpp/waylandcomp/src/compositor.c index 291ec91fbc..6589066add 100644 --- a/app/src/main/cpp/waylandcomp/src/compositor.c +++ b/app/src/main/cpp/waylandcomp/src/compositor.c @@ -1215,8 +1215,10 @@ static void xdg_toplevel_resize(struct wl_client *c, struct wl_resource *r, stru uint32_t serial, uint32_t edges) {} static void xdg_toplevel_set_i32(struct wl_client *c, struct wl_resource *r, int32_t w, int32_t h) {} static void xdg_toplevel_noop(struct wl_client *c, struct wl_resource *r) {} -/* Size 0x0 = the client picks; active, and fullscreen when asked. gamescope waits for the - * fullscreen state before it drops its libdecor frame, and never draws until it arrives. */ +/* The output's size; active, and fullscreen when asked. gamescope waits for the fullscreen + * state before it drops its libdecor frame, and never draws until it arrives; it was told the + * same size on its command line. A nested wlroots compositor (labwc) has no other way to learn + * it: given 0x0 it opens its default 1280x720 and the whole desktop is upscaled from that. */ static void send_toplevel_configure(struct surface *s) { struct wl_array states; wl_array_init(&states); @@ -1226,7 +1228,8 @@ static void send_toplevel_configure(struct surface *s) { st = wl_array_add(&states, sizeof(uint32_t)); *st = XDG_TOPLEVEL_STATE_FULLSCREEN; } - xdg_toplevel_send_configure(s->xdg_toplevel, 0, 0, &states); + xdg_toplevel_send_configure(s->xdg_toplevel, g_output_w > 0 ? g_output_w : 0, + g_output_h > 0 ? g_output_h : 0, &states); wl_array_release(&states); xdg_surface_send_configure(s->xdg_surface, wl_display_next_serial(g_display)); } diff --git a/tools/linuxfs/desktop/autostart b/tools/linuxfs/desktop/autostart index 91102f0964..41a9fccb89 100644 --- a/tools/linuxfs/desktop/autostart +++ b/tools/linuxfs/desktop/autostart @@ -13,7 +13,7 @@ run() { fi } # The output at the app's real size, in case rc.xml's mode did not take. -[ -n "${BL_WIDTH:-}" ] && wlr-randr --output WL-1 --custom-mode "${BL_WIDTH}x${BL_HEIGHT}" >/dev/null 2>&1 +[ -n "${BL_WIDTH:-}" ] && wlr-randr --output WL-1 --custom-mode "${BL_WIDTH}x${BL_HEIGHT}" 2>&1 | sed 's/^/[wlr-randr] /' swaybg -m fill -i /usr/share/backgrounds/steamdeck.png & # Desktop icons (pcmanfm-qt manages the desktop surface) and the panel with the app menu. run pcmanfm-qt pcmanfm-qt --desktop --profile lxqt