[PATCH weston v2 06/24] libweston-desktop/xwayland: react to geometry changes

Pekka Paalanen ppaalanen at gmail.com
Wed Dec 21 14:40:04 UTC 2016


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

It so happens that Xwayland commits the first frame before XWM can set
the geometry info, making initial window position act as if there were
no decorations - the window position is off by the width of the
decorations.

Fix up the window position whenever the geometry info changes.

Regression: This causes jumping when decorated Xwayland windows are
mapped.

This makes -geometry +x+y work, but -x or -y are not right for some
reason. Apparently needs an offset from geometry or decorations.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git at sardemff7.net>
---
 libweston-desktop/xwayland.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libweston-desktop/xwayland.c b/libweston-desktop/xwayland.c
index c64650d..449675a 100644
--- a/libweston-desktop/xwayland.c
+++ b/libweston-desktop/xwayland.c
@@ -131,8 +131,15 @@ 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);
 
 	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;
 		weston_desktop_surface_set_geometry(surface->surface,
 						    surface->next_geometry);
-- 
2.10.2



More information about the wayland-devel mailing list