Commit 36955c86 authored by myfreeweb's avatar myfreeweb

desktop-shell: limit move to work area on both top and bottom, without desktop panel specifically

parent c2a28beb
Pipeline #14764 failed with stage
in 1 minute and 48 seconds
......@@ -1488,21 +1488,21 @@ constrain_position(struct weston_move_grab *move, int *cx, int *cy)
x = wl_fixed_to_int(pointer->x + move->dx);
y = wl_fixed_to_int(pointer->y + move->dy);
if (shsurf->shell->panel_position ==
WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP) {
shsurf->shell->get_output_work_area(shsurf->shell, surface->output, &area);
geometry =
weston_desktop_surface_get_geometry(shsurf->desktop_surface);
bottom = y + geometry.height + geometry.y;
if (bottom - safety < area.y)
y = area.y + safety - geometry.height
- geometry.y;
if (move->client_initiated &&
y + geometry.y < area.y)
y = area.y - geometry.y;
}
shsurf->shell->get_output_work_area(shsurf->shell, surface->output, &area);
geometry =
weston_desktop_surface_get_geometry(shsurf->desktop_surface);
bottom = y + geometry.height + geometry.y;
if (bottom - safety < area.y)
y = area.y + safety - geometry.height
- geometry.y;
if (move->client_initiated &&
y + geometry.y < area.y)
y = area.y - geometry.y;
if (move->client_initiated &&
bottom > area.y + area.height)
y = area.y + area.height - geometry.y - geometry.height;
*cx = x;
*cy = y;
......
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