Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#143 XWarpPointer only partially works


When doing a relative XWarpPointer movement, it seems that the
MacOS mouse cursor is moved but the internal cursor position
within XDarwin is not, as successive XWarpPointer movements
are relative to the original position. This can be seen by compiling
the attached xmousekeys.c (which is intended to be used from a
window manager) and then doing something like:

./xmousekeys 100 0

This properly moves the mouse 100 pixels right. Then,

./xmousekeys 0 100

After this, the final position of the cursor *should* be 100 pixels
right and 100 pixels down (relative to its original position), but it
will only be 100 pixels down.


  • fluffy

    XWarpPointer relative-movement program

  • Logged In: YES

    This is due to a shortcoming in how events are queued and
    processed in XDarwin. (There is no easy way for the X server
    thread to post events for itself such as MotionNotify.) This
    will be fixed when I redo the event system shortly after the
    XFree86 4.2 release.

    • assigned_to: nobody --> torrey
  • Logged In: YES

    This has been fixed in the TOT.

    • status: open --> open-fixed
  • Logged In: NO

    Dear XDarwin folks,

    First, I can't thank you enough for your wonderful work in
    porting X11
    to Mac OS X! All my work is UNIX-based, and your efforts are
    me to turn my Mac at last into a machine useful for research!

    I have observed something similar to the XWarpPointer
    problem, no
    doubt of the same origin. When using the fvwm2 or AfterStep
    window managers with XDarwin (v, the CursorMove
    function provided
    by these window managers does not work. This function moves
    the pointer by a specified screen interval in x and y. On my
    *NIX boxes
    I have CursorMove bound to various keystrokes, allowing me
    to move
    the pointer around the screen without ever touching the
    mouse. (This is a fantastic feature that greatly speeds up
    my work! I really miss it on the Mac.) Under XDarwin, a
    CursorMove +10 0 does move the pointer to the right by 10%
    of the screen width ... but subsequent CursorMoves do not
    *continue* this motion. It is as if the pointer's new
    location is not being updated. For example, if the pointer
    starts at some coordinate (0,0),
    CursorMove +10 0 followed by CursorMove 0 +10 does not move
    it to
    (10,10) but rather to (0,10) --> all moves are relative to the
    pointer's original location rather than its new one. This
    occurs in both rootless and rooted mode.

    Two more related observations, in case they help:

    (1) I have fvwm2 set so that a window grabs focus when the
    moves into it (no click required). When I CursorMove from
    one window
    into another, rather than physically moving the mouse, the
    focus is
    *not* grabbed by the new window. Again it seems the new pointer
    location is not being recorded in all the right places.

    (2) In rootless mode, fvwm2 sometimes becomes confused as to
    which window is on top. Sometimes a window will stay underneath
    another even when an explicit Raise command is issued, and vice
    versa. Similarly, when moving the mouse across a window, focus
    will sometimes be transferred to an window *underneath* the top
    one if the mouse enters the region where the two overlap.
    when I switch from Quartz-based applications to XDarwin, all
    windows pop to the top ... *usually*. Sometimes an xterm will
    remain hidden under a Quartz window and it's a significant
    to get it to the front. I have not yet come up with a
    sequence of operations that generates this problem but it
    quite often (several times a day).

    Thanks for all your great work, hope you can find the time
    to solve this problem,
    Naomi C.R. Makins

  • evan bernstein
    evan bernstein

    Logged In: YES


    I also have noticed what appears to be a bug in XWarpPointer
    under 4.2.1 (both on a machine using xfree86 and oroborosX
    and using the recently release Mac X11 beta which i believe
    is based on 4.2.1).

    I've been porting a piece of code that works under linux and
    irix to the mac. It is a game of sorts, and we wanted to
    mostly contain the mouse to the window. In order to do
    this, we occaisonally (or sometimes frequently) call
    XWarpPointer and center the cursor on our window. On the
    other systems this works fine, but on OS X, it doesn't work
    quite as well as i'd like. The mouse does indeed warp, but
    when it gets there, the cursor appears to hang in that new
    position for a bit. If you move the mouse you continue to
    get mouse events, but they give you the same cursor position
    for a few moments, until finally the cursor begins to move

    This seems like it might be related to the other bugs as
    reported on this bug list. Not sure tho.

    Thanks, and if you'd like any more information or have any
    suggestions on how to get around this, I'd love to hear from
    you. Thanks.

    evan bernstein

  • Logged In: YES

    The original bug is fixed in If other related problems are not fixed with this version, please open another bug.

    • status: open-fixed --> closed-fixed