mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
Make sure logical_size isn't 0 on gamescope
This commit is contained in:
@@ -21,7 +21,6 @@ typedef struct {
|
|||||||
struct zxdg_output_v1 *xdg_output;
|
struct zxdg_output_v1 *xdg_output;
|
||||||
vec2i pos;
|
vec2i pos;
|
||||||
vec2i size;
|
vec2i size;
|
||||||
vec2i logical_pos;
|
|
||||||
vec2i logical_size;
|
vec2i logical_size;
|
||||||
int32_t transform;
|
int32_t transform;
|
||||||
char *name;
|
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),
|
.output = wl_registry_bind(registry, name, &wl_output_interface, 4),
|
||||||
.pos = { .x = 0, .y = 0 },
|
.pos = { .x = 0, .y = 0 },
|
||||||
.size = { .x = 0, .y = 0 },
|
.size = { .x = 0, .y = 0 },
|
||||||
.logical_pos = { .x = 0, .y = 0 },
|
|
||||||
.logical_size = { .x = 0, .y = 0 },
|
.logical_size = { .x = 0, .y = 0 },
|
||||||
.transform = 0,
|
.transform = 0,
|
||||||
.name = NULL,
|
.name = NULL,
|
||||||
@@ -396,9 +394,14 @@ static void gsr_window_wayland_for_each_active_monitor_output_cached(const gsr_w
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
const gsr_monitor_rotation rotation = wayland_transform_to_gsr_rotation(output->transform);
|
const gsr_monitor_rotation rotation = wayland_transform_to_gsr_rotation(output->transform);
|
||||||
|
|
||||||
vec2i size = { .x = output->size.x, .y = output->size.y };
|
vec2i size = { .x = output->size.x, .y = output->size.y };
|
||||||
size = get_monitor_size_rotated(size.x, size.y, rotation);
|
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_index = get_connector_type_by_name(output->name);
|
||||||
const int connector_type_id = get_connector_type_id_by_name(output->name);
|
const int connector_type_id = get_connector_type_id_by_name(output->name);
|
||||||
const gsr_monitor monitor = {
|
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 },
|
.pos = { .x = output->pos.x, .y = output->pos.y },
|
||||||
.size = size,
|
.size = size,
|
||||||
.logical_pos = { .x = output->pos.x, .y = output->pos.y },
|
.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,
|
.connector_id = 0,
|
||||||
.rotation = rotation,
|
.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
|
.monitor_identifier = (connector_type_index != -1 && connector_type_id != -1) ? monitor_identifier_from_type_and_count(connector_type_index, connector_type_id) : 0
|
||||||
|
|||||||
Reference in New Issue
Block a user