compositor: Check serial number ordering without overflowing
diff --git a/src/compositor.c b/src/compositor.c
index 4f5388d..9891b3c 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2213,7 +2213,7 @@
 		surface = container_of(surface_resource->data,
 				       struct weston_surface, surface);
 
-	if (serial < seat->seat.pointer->focus_serial)
+	if (seat->seat.pointer->focus_serial - serial > UINT32_MAX / 2)
 		return;
 
 	if (surface && surface != seat->sprite) {