Commit 354371d7 authored by Marius Vlad's avatar Marius Vlad

desktop-shell: Properly set the shsurf output to that of the view

The shell_surface is (initially) being assigned the default output and
it case it starts on a different ouput, or is being moved there, it it not be
updated to the correct output of the view.

This will break the stacking order of the views by having a fullscreen
view, which will never be demoted a lower stacking order due to newer
non-fullscreen view which will have the shell_surface output set to the
default one. Doing so will ignore the fullscreen view when determining
which view should should be demoted a lower stacking order.

This is only seen in multiple output configuration.
Signed-off-by: Marius Vlad's avatarMarius Vlad <marius.vlad@collabora.com>
parent 147e67c4
Pipeline #115059 passed with stages
in 1 minute and 39 seconds
......@@ -2517,6 +2517,13 @@ set_position_from_xwayland(struct shell_surface *shsurf)
#endif
}
static void
shell_surface_update_output(struct shell_surface *sh_surf)
{
if (sh_surf->view->output && sh_surf->output != sh_surf->view->output)
shell_surface_set_output(sh_surf, sh_surf->view->output);
}
static void
map(struct desktop_shell *shell, struct shell_surface *shsurf,
int32_t sx, int32_t sy)
......@@ -2549,9 +2556,15 @@ map(struct desktop_shell *shell, struct shell_surface *shsurf,
}
if (!shell->locked) {
wl_list_for_each(seat, &compositor->seat_list, link)
wl_list_for_each(seat, &compositor->seat_list, link) {
/* update the shsurf output to the view's output as
* initially it is set to get_default_output() in
* when creating shsurf in desktop_surface_added() */
shell_surface_update_output(shsurf);
activate(shell, shsurf->view, seat,
WESTON_ACTIVATE_FLAG_CONFIGURE);
}
}
if (!shsurf->state.fullscreen && !shsurf->state.maximized) {
......@@ -2593,6 +2606,9 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
shsurf->state.maximized =
weston_desktop_surface_get_maximized(desktop_surface);
/* update shsurf output in case the view has been migrated from one
* output to another */
shell_surface_update_output(shsurf);
if (!weston_surface_is_mapped(surface)) {
map(shell, shsurf, sx, sy);
surface->is_mapped = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment