libweston: Reconsider view primary output on output power change

When an output power state changes, it may become or no longer be the
best primary output for a view.

Fixes #819

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2023-06-30 09:31:25 -05:00 committed by Marius Vlad
parent d3fa809c55
commit 305e954f76
1 changed files with 5 additions and 0 deletions

View File

@ -8102,6 +8102,7 @@ static void
weston_output_force_power(struct weston_output *output,
enum weston_output_power_state power)
{
struct weston_view *view;
enum dpms_enum dpms;
output->power_state = power;
@ -8110,6 +8111,10 @@ weston_output_force_power(struct weston_output *output,
output->compositor->state == WESTON_COMPOSITOR_OFFSCREEN)
return;
wl_list_for_each(view, &output->compositor->view_list, link)
if (view->output_mask & (1u << output->id))
weston_view_assign_output(view);
if (!output->set_dpms || !output->enabled)
return;