Weston under X crashes

Niklas Hambüchen mail at nh2.me
Thu Oct 11 07:14:13 PDT 2012

Running src/weston and moving around the weston window with my tiling
window manager (i3) while moving the mouse sometimes makes it segfault
for me.

The patch below seems to fix it for me; what breaks is the line

	if (!valid && prev != NULL) {
		if (x < prev->x)

in clip_pointer_motion() because none of the

		if (pixman_region32_contains_point(&output->region,
						   x, y, NULL)) ...
		if (pixman_region32_contains_point(&output->region,
						   old_x, old_y, NULL))

actually matches so that prev == NULL.

I don't really know the hidden assumption behind this (no comments, yay
;)) - I guess it assumes that either the current or the old x/y are
within the region, which doesn't seem to be the case for me.


PS: Once again, I have no clue if the patch is actually the right thing
to do.

>From 9a595282ba798ad388576bcbbc53ab970983c956 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail at nh2.me>
Date: Thu, 11 Oct 2012 15:04:57 +0100
Subject: [PATCH] clip_pointer_motion: Cope for old_x/y not being in the
 output region either

 src/compositor.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compositor.c b/src/compositor.c
index eac805d..991ecdd 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1433,7 +1433,7 @@ clip_pointer_motion(struct weston_seat *seat,
wl_fixed_t *fx, wl_fixed_t *fy)
 			prev = output;

-	if (!valid) {
+	if (!valid && prev != NULL) {
 		if (x < prev->x)
 			*fx = wl_fixed_from_int(prev->x);
 		else if (x >= prev->x + prev->width)

More information about the wayland-devel mailing list