diff -ru xfwm4-4.13.1.orig/src/device.c xfwm4-4.13.1/src/device.c
--- xfwm4-4.13.1.orig/src/device.c	2018-07-29 16:08:54.000000000 +0300
+++ xfwm4-4.13.1/src/device.c	2018-09-12 08:49:18.130254993 +0300
@@ -301,7 +301,7 @@
     guint i;
 
     xievent_mask->deviceid = XIAllMasterDevices;
-    xievent_mask->mask_len = sizeof (mask);
+    xievent_mask->mask_len = len;
     xievent_mask->mask = mask;
 
     for (i = 0; i < G_N_ELEMENTS (core_to_xi2); i++)