Cursor duplication problem

  • Hi

    I'm working on an app that needs to access a full screen opengl
    context which contains an image with the contents of the screen. This
    image is created with a simple mem copy and does not contain the
    cursor image (Apple does not include it in the screen buffer). To
    capture this as an image and display the cursor, my app calls NSCursor
    currentCursor, extracts its image and copies it to the position
    reported by the cursor.

    This, to my understanding, is the only workaround for apple's
    shortcoming and is indeed referenced in most screen capture apps'
    troubleshooters/faqs.

    The real problem is that there's an inconsistency which manifests
    itself when a user uses mousewheel zooming by hitting ctrl-wheel.
    Apparently that neat effect is achieved by zooming in and out on a
    composition containing both the screen buffer and the _real_ mouse
    overlay (not the one my app creates). The end result is a double
    cursor appearance
    in which one is constant size (my cursor) and the other is apple's
    regular/magnified size.

    There are two possible solutions:
    1 - Does anyone know of a way to detect current screen zoomlevel? I've
    searched the docs and googled around to no avail. If i could detect it
    i could bypass my own cursor drawing until zoom was back at 1.0.

    2 - Does anyone know of a way to include the cursor when capturing the
    screen using opengl? I know this could belong to another list too but
    most of the post is really cocoa specific.

    There is one other issue with [NSCursor currentCursor]. Apparently it
    always returns arrowCursor. This too is a known problem and i was
    wondering if a workaround has been discovered.

    Thanks for reading,

    Filipe
  • On 18.01.2008, at 18:23, Filipe Varela wrote:
    > There is one other issue with [NSCursor currentCursor]. Apparently
    > it always returns arrowCursor. This too is a known problem and i was
    > wondering if a workaround has been discovered.

      Are you trying to get a cursor set in your app? Because every app
    has its own cursor, so if you query +currentCursor expecting to get
    the current cursor in another app, you'll get whatever cursor was last
    set in *your* app, which, by default, would be the arrow.

    Cheers,
    -- M. Uli Kusterer
    "The Witnesses of TeachText are everywhere..."
    http://www.zathras.de
  • My app does not set cursors. If, however, what you say is what
    actually happens, then the docs are misleading as they clearly state
    that currentCursor returns "The cursor currently displayed on the
    screen."

    Cheers,

    Filipe

    On 2008/01/18, at 17:38, Uli Kusterer wrote:

    > On 18.01.2008, at 18:23, Filipe Varela wrote:
    >> There is one other issue with [NSCursor currentCursor]. Apparently
    >> it always returns arrowCursor. This too is a known problem and i
    >> was wondering if a workaround has been discovered.
    >
    >
    > Are you trying to get a cursor set in your app? Because every app
    > has its own cursor, so if you query +currentCursor expecting to get
    > the current cursor in another app, you'll get whatever cursor was
    > last set in *your* app, which, by default, would be the arrow.
    >
    > Cheers,
    > -- M. Uli Kusterer
    > "The Witnesses of TeachText are everywhere..."
    > http://www.zathras.de
    >
    >
    >
    >
  • My app does not set cursors. If, however, what you say is what
    actually happens, then the docs are misleading as they clearly state
    that currentCursor returns "The cursor currently displayed on the
    screen."

    Cheers,

    Filipe

    On 2008/01/18, at 17:38, Uli Kusterer wrote:

    > On 18.01.2008, at 18:23, Filipe Varela wrote:
    >> There is one other issue with [NSCursor currentCursor]. Apparently
    >> it always returns arrowCursor. This too is a known problem and i
    >> was wondering if a workaround has been discovered.
    >
    >
    > Are you trying to get a cursor set in your app? Because every app
    > has its own cursor, so if you query +currentCursor expecting to get
    > the current cursor in another app, you'll get whatever cursor was
    > last set in *your* app, which, by default, would be the arrow.
    >
    > Cheers,
    > -- M. Uli Kusterer
    > "The Witnesses of TeachText are everywhere..."
    > http://www.zathras.de
    >
    >
    >
    >
  • File a documentation bug. You're right, it's not clear.

    Filipe Varela wrote:
    > My app does not set cursors. If, however, what you say is what
    > actually happens, then the docs are misleading as they clearly state
    > that currentCursor returns "The cursor currently displayed on the
    > screen."
    >
    > Cheers,
    >
    > Filipe
    >
    > On 2008/01/18, at 17:38, Uli Kusterer wrote:
    >
    >> On 18.01.2008, at 18:23, Filipe Varela wrote:
    >>> There is one other issue with [NSCursor currentCursor]. Apparently
    >>> it always returns arrowCursor. This too is a known problem and i was
    >>> wondering if a workaround has been discovered.
    >>
    >>
    >> Are you trying to get a cursor set in your app? Because every app has
    >> its own cursor, so if you query +currentCursor expecting to get the
    >> current cursor in another app, you'll get whatever cursor was last
    >> set in *your* app, which, by default, would be the arrow.
    >>
    >> Cheers,
    >> -- M. Uli Kusterer
    >> "The Witnesses of TeachText are everywhere..."
    >> http://www.zathras.de
    >>
    >>
    >>
    >>

  • On 18.01.2008, at 18:44, Filipe Varela wrote:
    > My app does not set cursors.

      Then it gets the default, the arrow cursor.

    > If, however, what you say is what actually happens,

      Are you calling me a liar? ;-)

    > then the docs are misleading as they clearly state that
    > currentCursor returns "The cursor currently displayed on the screen."

      Yes, slightly misleading. As a guideline, it helps to think that
    everything a Mac application does is local to itself, and for security
    and stability issues, it doesn't have access to data from other
    applications. Only a few special APIs (like distributed objects, Apple
    Events and the low-level CGWindow stuff) have access to other apps'
    data. In particular, AppKit is mostly agnostic of happenings in other
    apps. The window list will only give you windows in your apps, etc.

    Cheers,
    -- M. Uli Kusterer
    "The Witnesses of TeachText are everywhere..."
    http://www.zathras.de
  • >> My app does not set cursors. If, however, what you say is what
    >> actually happens, then the docs are misleading as they clearly
    >> state that currentCursor returns "The cursor currently displayed on
    >> the screen."
    >
    > File a documentation bug. You're right, it's not clear.

    In addition, please file a bug if you’re interested in API that
    provides this image.

    -Ben
  • Thanks for all the replies.

    -- FYI --
    1 - Filed documentation bug - 5696261
    2 - Filed GL bug for inconsistent cursor image presence - 5696263

    Development halted until (2) is addressed... :(

    Cheers,

    Filipe

    On 2008/01/18, at 19:09, Benjamin Stiglitz wrote:

    >>> My app does not set cursors. If, however, what you say is what
    >>> actually happens, then the docs are misleading as they clearly
    >>> state that currentCursor returns "The cursor currently displayed
    >>> on the screen."
    >>
    >> File a documentation bug. You're right, it's not clear.
    >
    > In addition, please file a bug if you’re interested in API that
    > provides this image.
    >
    > -Ben
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