frontend: Fix crash in output resize handler

The output resized signal sends a struct weston_output as the data, not
a struct weston_head.

Fixes 197c5e0084

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
(cherry picked from commit 52204f55ea)
This commit is contained in:
Derek Foreman 2025-04-24 09:28:52 -05:00 committed by Marius Vlad
parent ef25333fac
commit 51dfd1be3a

View file

@ -2580,23 +2580,21 @@ wet_output_overlap_post_enable(struct weston_head *head,
static void
simple_heads_output_sharing_resize(struct wl_listener *listener, void *data)
{
struct weston_head *head = data;
struct weston_head *head_to_mirror = NULL;
struct weston_output *output;
struct weston_output *output = data;
struct wet_head_tracker *head_track =
container_of(listener, struct wet_head_tracker, resized_listener);
struct wet_compositor *wet = head_track->wet;
struct weston_mode mode;
int scale = 1;
output = weston_head_get_output(head);
head_to_mirror = wet_config_find_head_to_mirror(output, wet);
if (!head_to_mirror)
return;
weston_output_set_position(head_to_mirror->output, output->pos);
wet_output_compute_output_from_mirror(head->output,
wet_output_compute_output_from_mirror(output,
head_to_mirror->output,
&mode, &scale);
weston_output_mode_set_native(head_to_mirror->output, &mode, scale);