Tracking rect strangeness in Leopard

  • Greetings,

    I have an application that uses tracking rects extensively to
    provide roll-over information and animation. These have stopping
    working consistently in Leopard.

    When the window is first created it creates tracking rects using
    -[NSView addTrackingRect:owner:userData:assumeInside:]. In
    Leopard I never get a single mouseEntered/mouseExited message
    for any of these tracking rects. No amount of clicking,
    dragging, scrolling, resizing, changing focus, or
    deactivating/activating the application or window seems to make
    any difference.

    However, if I hide the application or minimize the window, when
    the window is made visible again all of the tracking rects start
    working, and mouseEntered/mouseExited messsages come pouring in.
    Note that these are not new tracking rects; these were the same
    ones created earlier that weren't working.

    Once they start working I can't get them to stop again.
    Everything works just as it did in Tiger not matter what I try.
    The only way to reproduce the problem is to close the window and
    create a new one, at which point the tracking rects in the new
    window won't work.

    The only confounding issue is that these tracking rects are
    being created for a subclass of NSView that lives in a
    transparent child window that overlays my document window.

    Has anyone experienced this problem or a similar one? Any known workarounds?

    Thanks,

    James
    --
    James Bucanek
  • James Bucanek <mailto:<subscriber...> wrote (Monday,
    January 14, 2008 1:52 PM -0700):
    > I have an application that uses tracking rects extensively to provide
    > roll-over information and animation. These have stopping working
    > consistently in Leopard.
    >
    > When the window is first created it creates tracking rects using
    > -[NSView addTrackingRect:owner:userData:assumeInside:]. In Leopard I
    > never get a single mouseEntered/mouseExited message for any of these
    > tracking rects. No amount of clicking, dragging, scrolling, resizing,
    > changing focus, or deactivating/activating the application or window
    > seems to make any difference.
    >
    > However, if I hide the application or minimize the window, when the
    > window is made visible again all of the tracking rects start working,
    > and mouseEntered/mouseExited messsages come pouring in. Note that
    > these are not new tracking rects; these were the same ones created
    > earlier that weren't working.
    >
    > Once they start working I can't get them to stop again. Everything
    > works just as it did in Tiger not matter what I try. The only way to
    > reproduce the problem is to close the window and create a new one, at
    > which point the tracking rects in the new window won't work.
    >
    > The only confounding issue is that these tracking rects are being
    > created for a subclass of NSView that lives in a transparent child
    > window that overlays my document window.

    To follow up on my own post, the problem seems to be the fact
    that the view with the tracking rects is in a child window.

    I think I've solved the problem by using the contentView of the
    parent window as my target for creating the tracking rects
    (since, conveniently, the messages from a tracking rect can be
    sent to a different object than the view object the contains
    them). All I really have to do is translate the tracking rect
    from the coordinate system of the view in the child window to
    the coordinate system of the view in parent window.

    I'll file a bug.

    --
    James Bucanek
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today