#32 Background mouse tracking

open
nobody
None
5
2002-01-23
2002-01-23
Adrian
No

Item number 2 in my wish list:

XDarwin, in rootless mode, does not currently track the
mouse when another OSX app is frontmost. This is
obviously because of the problems associated with the
enter/leave events (see feature request 507314).

There are obviously questions about the most effective
method for dealing with auto-focussing X11 windows (eg,
XDarwin would have to bring itself in front to capture
keyboard events -without any of its windows coming
forward...) However, once the enter/leave events are
sorted out, background tracking should be feasible with
some thought.

Adrian

Discussion

  • Greg Parker
    Greg Parker
    2002-01-26

    Logged In: YES
    user_id=37183

    XDarwin does not track the mouse when XDarwin is in the background because mouse tracking is expensive, and because the only way to do it without using private CG calls is to poll the event loop, which sucks.

    Auto-focus is never going to work with XDarwin in the background anyway. X11 windows displaying focus changes while in the background is misleading (just as the current display of one focused window is incorrect).

     
  • Adrian
    Adrian
    2002-01-31

    Logged In: YES
    user_id=313617

    > mouse tracking is expensive

    I don't think it has to be -OroborOSX does a passable
    job, even though it does "poll the event loop" ("which
    sucks", yes...)

    Are there "mouse moved" events in Cocoa? (There are
    in Carbon, so there must be in Cocoa... but do they
    work in the background?? Hmmm...)

    > X11 windows displaying focus changes while in the
    background is misleading

    I don't think it has to be. I may not be a great fan of auto-
    focus, but I think it can be useful in certain limited
    circumstances... the iconbars in OroborOSX are a good
    example -they are meant to be more of a 'global' item,
    similar to the Dock.

    I can make OroborOSX and XDarwin work fine with
    auto-focus in the background, except for the issue of
    spurious enter/leave events with obscured X11
    windows (item 507314).

    If I knew how to be sure which X11 window contained
    the cursor, taking all windows of all apps into account
    (how does QuartzDebug get its list? how does
    Windowshade X intercept other apps' windows?), I
    would implement all this within an hour...

    Adrian

     
  • Greg Parker
    Greg Parker
    2002-01-31

    Logged In: YES
    user_id=37183

    There are mouse-moved events in Cocoa. Neither Carbon nor Cocoa's mouse-moved events work from the background without private APIs. I believe mouse-enter and mouse-exit events are also not delivered to background apps.

    QuartzDebug presumably uses a private API to get the window list. Note that the window list may change rapidly and the function call may be expensive. Note that a full-screen transparent window on top of all other windows is going to confuse you.

     
  • Adrian
    Adrian
    2002-02-01

    Logged In: YES
    user_id=313617

    > Neither ... work from the background
    > mouse-enter and mouse-exit events ... also not

    Suspected as much... :-(

    > QuartzDebug presumably uses a private API

    And Windowshade X? (I did e-mail Unsanity when it was first
    released, but got no reply...)

    > Note that the window list may change rapidly and the function call may be expensive.

    The OSX WindowServer obviously does it itself at the moment
    (eg, window widgets for background windows).

    > full-screen transparent window on top of all other windows

    ...and "shaped" windows...

    Witness what happens if you place xeyes so its transparent
    part is over the iconbar tabs in OroborOSX, and then, while
    another app is in front, try to move over the tabs (even
    though they are visible, they don't 'light up'). -OroborOSX
    only deals with rects, so I'm painfully aware of this...

    No, it needs to be done in the same way that the OSX
    WindowServer knows what it can 'see through' to get to the
    window widgets. -Preferably even by tapping into the
    WindowServer, if possible! :-)

    Adrian