desktop-shell: Add back the saved position and rotation for fullscreen/maximized
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
+16
-4
@@ -1950,14 +1950,13 @@ unset_fullscreen(struct shell_surface *shsurf)
|
|||||||
shsurf->saved_x, shsurf->saved_y);
|
shsurf->saved_x, shsurf->saved_y);
|
||||||
else
|
else
|
||||||
weston_view_set_initial_position(shsurf->view, shsurf->shell);
|
weston_view_set_initial_position(shsurf->view, shsurf->shell);
|
||||||
|
shsurf->saved_position_valid = false;
|
||||||
|
|
||||||
if (shsurf->saved_rotation_valid) {
|
if (shsurf->saved_rotation_valid) {
|
||||||
wl_list_insert(&shsurf->view->geometry.transformation_list,
|
wl_list_insert(&shsurf->view->geometry.transformation_list,
|
||||||
&shsurf->rotation.transform.link);
|
&shsurf->rotation.transform.link);
|
||||||
shsurf->saved_rotation_valid = false;
|
shsurf->saved_rotation_valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Layer is updated in set_surface_type(). */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1974,14 +1973,13 @@ unset_maximized(struct shell_surface *shsurf)
|
|||||||
shsurf->saved_x, shsurf->saved_y);
|
shsurf->saved_x, shsurf->saved_y);
|
||||||
else
|
else
|
||||||
weston_view_set_initial_position(shsurf->view, shsurf->shell);
|
weston_view_set_initial_position(shsurf->view, shsurf->shell);
|
||||||
|
shsurf->saved_position_valid = false;
|
||||||
|
|
||||||
if (shsurf->saved_rotation_valid) {
|
if (shsurf->saved_rotation_valid) {
|
||||||
wl_list_insert(&shsurf->view->geometry.transformation_list,
|
wl_list_insert(&shsurf->view->geometry.transformation_list,
|
||||||
&shsurf->rotation.transform.link);
|
&shsurf->rotation.transform.link);
|
||||||
shsurf->saved_rotation_valid = false;
|
shsurf->saved_rotation_valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Layer is updated in set_surface_type(). */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -2490,6 +2488,20 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
|
|||||||
if (was_maximized)
|
if (was_maximized)
|
||||||
unset_maximized(shsurf);
|
unset_maximized(shsurf);
|
||||||
|
|
||||||
|
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;
|
||||||
|
shsurf->saved_position_valid = true;
|
||||||
|
|
||||||
|
if (!wl_list_empty(&shsurf->rotation.transform.link)) {
|
||||||
|
wl_list_remove(&shsurf->rotation.transform.link);
|
||||||
|
wl_list_init(&shsurf->rotation.transform.link);
|
||||||
|
weston_view_geometry_dirty(shsurf->view);
|
||||||
|
shsurf->saved_rotation_valid = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (shsurf->state.fullscreen) {
|
if (shsurf->state.fullscreen) {
|
||||||
shell_configure_fullscreen(shsurf);
|
shell_configure_fullscreen(shsurf);
|
||||||
} else if (shsurf->state.maximized) {
|
} else if (shsurf->state.maximized) {
|
||||||
|
|||||||
Reference in New Issue
Block a user