Revert "desktop-shell: avoid alternating surface between outputs"

This reverts commit 4eea291512.

There were some details and cases that I've missed when writing this
commit, resulting in some weird behaviors. Trying to cover all of them
became a nightmare, and the function got really hard to read.

So it's better to revert this commit and think about other possible
solutions for the issue.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
Leandro Ribeiro 2023-02-07 12:05:47 -03:00 committed by Pekka Paalanen
parent 9c511fedba
commit 831e36c7d9

View file

@ -2063,8 +2063,8 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
weston_desktop_surface_get_surface(desktop_surface);
struct weston_view *view = shsurf->view;
struct desktop_shell *shell = data;
bool was_fullscreen, should_set_fullscreen;
bool was_maximized, should_set_maximized;
bool was_fullscreen;
bool was_maximized;
if (!weston_surface_has_content(surface) &&
weston_surface_is_unmapping(surface) &&
@ -2085,12 +2085,6 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
shsurf->state.maximized =
weston_desktop_surface_get_maximized(desktop_surface);
should_set_fullscreen = shsurf->state.fullscreen &&
(!was_fullscreen || shsurf->output !=
shsurf->fullscreen_output);
should_set_maximized = shsurf->state.maximized &&
!was_maximized;
if (!weston_surface_is_mapped(surface)) {
map(shell, shsurf);
/* as we need to survive the weston_surface destruction we'll
@ -2112,13 +2106,12 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
was_maximized == shsurf->state.maximized)
return;
if (was_fullscreen && (!shsurf->state.fullscreen ||
shsurf->output != shsurf->fullscreen_output))
if (was_fullscreen)
unset_fullscreen(shsurf);
if (was_maximized && !shsurf->state.maximized)
if (was_maximized)
unset_maximized(shsurf);
if ((should_set_fullscreen || should_set_maximized) &&
if ((shsurf->state.fullscreen || shsurf->state.maximized) &&
!shsurf->saved_position_valid) {
shsurf->saved_x = shsurf->view->geometry.x;
shsurf->saved_y = shsurf->view->geometry.y;
@ -2134,9 +2127,9 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
weston_view_update_transform(shsurf->view);
if (should_set_fullscreen) {
if (shsurf->state.fullscreen) {
shell_configure_fullscreen(shsurf);
} else if (should_set_maximized) {
} else if (shsurf->state.maximized) {
set_maximized_position(shell, shsurf);
surface->output = shsurf->output;
} else {