diff options
author | Derek Foreman <derek.foreman@collabora.com> | 2023-06-30 09:31:25 -0500 |
---|---|---|
committer | Marius Vlad <marius.vlad0@gmail.com> | 2023-10-06 11:50:50 +0000 |
commit | 305e954f76fa4ca0fea7e460038110340af535b1 (patch) | |
tree | 2dd0d78801c60a4815b0e915637d484ac3561f0b /libweston/compositor.c | |
parent | d3fa809c55a6020a2dbc212ed118dbcf62c62e09 (diff) |
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>
Diffstat (limited to 'libweston/compositor.c')
-rw-r--r-- | libweston/compositor.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libweston/compositor.c b/libweston/compositor.c index 6e0a5cc2..739d065b 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -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; |