desktop-shell: Position maximized surfaces on the correct output.

During a maximize event, a surface was previously always put back to
the primary output after one frame on the correct output, while keeping
its size.  This was caused by the shell surface’s last_{width,height}
not being reset when it was either fullscreen or maximized, leading to
the unmaximize/maximize dance being done at each commit.

This was introduced in 8f9d90a84b.

Changes since v1:
- Fix the actual issue instead of a symptom.

Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
dev
Emmanuel Gil Peyrot 8 years ago committed by Quentin Glidic
parent 597dde5cf6
commit c394179488
No known key found for this signature in database
GPG Key ID: AC203F96E2C34BB7
  1. 6
      desktop-shell/shell.c

@ -2545,9 +2545,6 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
if (shsurf->resize_edges & WL_SHELL_SURFACE_RESIZE_TOP)
sy = shsurf->last_height - surface->height;
shsurf->last_width = surface->width;
shsurf->last_height = surface->height;
weston_view_to_global_float(shsurf->view, 0, 0, &from_x, &from_y);
weston_view_to_global_float(shsurf->view, sx, sy, &to_x, &to_y);
x = shsurf->view->geometry.x + to_x - from_x;
@ -2556,6 +2553,9 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
weston_view_set_position(shsurf->view, x, y);
}
shsurf->last_width = surface->width;
shsurf->last_height = surface->height;
/* XXX: would a fullscreen surface need the same handling? */
if (surface->output) {
wl_list_for_each(view, &surface->views, surface_link)

Loading…
Cancel
Save