title: Moving the mouse cursor doesn't work as expected on X11
body: <p>I'm trying to move the mouse pointer while the left button is down (Button1).
  But it doesn't work. For example, if I launch GIMP, I see a dot (cursor down), then the cursor moves but without drawing. I was expecting to see a drawn line (move while holding left button down).</p>
  
  <pre><code>Display * display = XOpenDisplay(0);
  XEvent event;
  memset (&amp;event, 0, sizeof (event));
  event.xbutton.button = Button1;
  event.xbutton.same_screen = True;
  event.xbutton.subwindow = DefaultRootWindow (display);
  while (event.xbutton.subwindow)
  {
  event.xbutton.window = event.xbutton.subwindow;
  XQueryPointer (display, event.xbutton.window,
             &amp;event.xbutton.root, &amp;event.xbutton.subwindow,
             &amp;event.xbutton.x_root, &amp;event.xbutton.y_root,
             &amp;event.xbutton.x, &amp;event.xbutton.y,
             &amp;event.xbutton.state);
  }
  // Press
  event.type = ButtonPress;
  if (XSendEvent (display, PointerWindow, True, 0xFFF, &amp;event) == 0)
  fprintf (stderr, "Error to send the event!\n");
  
  XFlush (display);
  
  // Move
  XWarpPointer(display, None, 0, 0, 0, 0, 0, 50, 50);
  
  XFlush (display);
  
  // Release
  event.type = ButtonRelease;
  event.xbutton.state = 0x100;
  
  if (XSendEvent (display, PointerWindow, True, 0xFFF, &amp;event) == 0)
  fprintf (stderr, "Error to send the event!\n");
  
  XFlush (display);
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks!</p>
  
  <p>Nicolas.</p>