Commit 5f93b9f6 authored by Pekka Paalanen's avatar Pekka Paalanen Committed by Daniel Stone

libweston-desktop/xwayland: react to geometry changes

Fix up the window position whenever the geometry info changes.

If the window geometry changes, we want to keep the input-responding
content anchored to top-left. It is done by manipulating the dx,dy
arguments originating from a wl_surface.attach request.
Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <>
Reviewed-by: Louis-Francis Ratté-Boulianne's avatarLouis-Francis Ratté-Boulianne <>
Acked-by: Daniel Stone's avatarDaniel Stone <>
parent 7ace831c
......@@ -131,12 +131,19 @@ weston_desktop_xwayland_surface_committed(struct weston_desktop_surface *dsurfac
int32_t sx, int32_t sy)
struct weston_desktop_xwayland_surface *surface = user_data;
struct weston_geometry oldgeom;
assert(dsurface == surface->surface);
#ifdef WM_DEBUG
weston_log("%s: xwayland surface %p\n", __func__, surface);
if (surface->has_next_geometry) {
oldgeom = weston_desktop_surface_get_geometry(surface->surface);
sx -= surface->next_geometry.x - oldgeom.x;
sy -= surface->next_geometry.y - oldgeom.x;
surface->has_next_geometry = false;
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