From 19add54c0c2684126091c5db89590c9f3b0b96c3 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 20 Jan 2026 14:39:11 +0100 Subject: [PATCH] Make sure logical_size isn't 0 on gamescope --- src/window/wayland.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/window/wayland.c b/src/window/wayland.c index fc51c51..f126aad 100644 --- a/src/window/wayland.c +++ b/src/window/wayland.c @@ -21,7 +21,6 @@ typedef struct { struct zxdg_output_v1 *xdg_output; vec2i pos; vec2i size; - vec2i logical_pos; vec2i logical_size; int32_t transform; char *name; @@ -125,7 +124,6 @@ static void registry_add_object(void *data, struct wl_registry *registry, uint32 .output = wl_registry_bind(registry, name, &wl_output_interface, 4), .pos = { .x = 0, .y = 0 }, .size = { .x = 0, .y = 0 }, - .logical_pos = { .x = 0, .y = 0 }, .logical_size = { .x = 0, .y = 0 }, .transform = 0, .name = NULL, @@ -396,9 +394,14 @@ static void gsr_window_wayland_for_each_active_monitor_output_cached(const gsr_w continue; const gsr_monitor_rotation rotation = wayland_transform_to_gsr_rotation(output->transform); + vec2i size = { .x = output->size.x, .y = output->size.y }; size = get_monitor_size_rotated(size.x, size.y, rotation); + vec2i logical_size = { .x = output->logical_size.x, .y = output->logical_size.y }; + if(logical_size.x == 0 || logical_size.y == 0) + logical_size = size; + const int connector_type_index = get_connector_type_by_name(output->name); const int connector_type_id = get_connector_type_id_by_name(output->name); const gsr_monitor monitor = { @@ -407,7 +410,7 @@ static void gsr_window_wayland_for_each_active_monitor_output_cached(const gsr_w .pos = { .x = output->pos.x, .y = output->pos.y }, .size = size, .logical_pos = { .x = output->pos.x, .y = output->pos.y }, - .logical_size = { .x = output->logical_size.x, .y = output->logical_size.y }, + .logical_size = logical_size, .connector_id = 0, .rotation = rotation, .monitor_identifier = (connector_type_index != -1 && connector_type_id != -1) ? monitor_identifier_from_type_and_count(connector_type_index, connector_type_id) : 0