eiff -u -r fvwm-orig/fvwm/add_window.c fvwm-2.5.30.ds/fvwm/add_window.c
--- fvwm-orig/fvwm/add_window.c	2010-02-06 19:15:42.000000000 +0200
+++ fvwm-2.5.30.ds/fvwm/add_window.c	2013-11-16 21:22:22.939254915 +0200
@@ -246,6 +246,9 @@
 			}
 		}
 	}
+	int device=atoi(getenv("MPX"));
+	fprintf(stderr,"CaptureOneWindow: %d\n",device);
+	XISetClientPointer(dpy, w, device);
 	MyXUngrabServer(dpy);
 
 	return;
@@ -3511,6 +3514,12 @@
 			    MappedNotOverride(children[i], &win_opts))
 			{
 				XUnmapWindow(dpy, children[i]);
+
+
+				int device=atoi(getenv("MPX"));
+				fprintf(stderr,"CaptureAllWindows_initial: %d\n",device);
+				XISetClientPointer(dpy, children[i], device);
+
 				e.xmaprequest.window = children[i];
 				e.xmaprequest.parent = Scr.Root;
 				ecc.w.fw = NULL;
@@ -3547,6 +3556,10 @@
 					exc, fw, children[i], keep_on_top_win,
 					parent_win, is_recapture);
 			}
+
+				int device=atoi(getenv("MPX"));
+				fprintf(stderr,"CaptureAllWindows_recapture: %d\n",device);
+				XISetClientPointer(dpy, children[i], device);
 		}
 		hide_screen(False, NULL, NULL);
 		/* find the window that had the focus and focus it again */
diff -u -r fvwm-orig/fvwm/focus.h fvwm-2.5.30.ds/fvwm/focus.h
--- fvwm-orig/fvwm/focus.h	2009-05-17 23:47:43.000000000 +0300
+++ fvwm-2.5.30.ds/fvwm/focus.h	2013-11-18 19:22:14.175231895 +0200
@@ -9,7 +9,7 @@
 
 /* ---------------------------- global macros ------------------------------ */
 
-#define FOCUS_SET(w) XSetInputFocus(dpy, w, RevertToParent, CurrentTime)
+#define FOCUS_SET(w) XISetClientPointer(dpy, w, atoi(getenv("MPX")));fprintf(stderr,"focus:%ld\n",w);XSetInputFocus(dpy, w, RevertToParent, CurrentTime) 
 #define FOCUS_RESET() \
 	XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime)
 
diff -u -r fvwm-orig/fvwm/fvwm.c fvwm-2.5.30.ds/fvwm/fvwm.c
--- fvwm-orig/fvwm/fvwm.c	2010-02-28 02:56:58.000000000 +0200
+++ fvwm-2.5.30.ds/fvwm/fvwm.c	2013-11-16 21:06:39.279076577 +0200
@@ -24,6 +24,9 @@
 
 /* ---------------------------- included header files ---------------------- */
 
+#include <stdlib.h>
+#include <X11/extensions/XInput2.h>
+
 #include "config.h"
 
 #include <stdio.h>
@@ -2205,6 +2208,9 @@
 	FScreenInit(dpy);
 	x_fd = XConnectionNumber(dpy);
 
+	//MPX
+	XISetClientPointer(dpy, None, atoi(getenv("MPX")));
+
 #ifdef HAVE_X11_FD
 	if (fcntl(x_fd, F_SETFD, 1) == -1)
 	{
