How to detect Exposé activation

Discussion in 'Mac Apps and Mac App Store' started by gekko513, Apr 20, 2004.

  1. gekko513 macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #1
    In a Cocoa / Objective C app, how do I detect if Exposé has been activated?
     
  2. Rincewind42 macrumors 6502a

    Rincewind42

    Joined:
    Mar 3, 2003
    Location:
    Orlando, FL
    #2
    It is not currently possible from any kind of application to detect if Exposé has been activated. It has been proposed (and I believe a feature request filed) for an asynchronous notification, but that won't arrive until at least 10.4 (depends on when the request is dealt with).

    What are you trying to do?
     
  3. mnkeybsness macrumors 68030

    mnkeybsness

    Joined:
    Jun 25, 2001
    Location:
    Moneyapolis, Minnesota
    #3
    I'm curious... why would you want to detect if Exposé was activated?
     
  4. gekko513 thread starter macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #4
    There's a bug in the window system that causes the coordinate system for a window to become corrupted if the window is programatically moved while exposé is activated.

    I'm currently developing my first OSX app. It's a widget that makes a picture move in and out of the screen, sort of like a peekaboo. When exposé is activated, the window just keeps moving ... which is kinda cool, but unfortunately causes a [self setFrameOrigin:NSMakePoint(0, 0)] to not move the window to the bottom left corner after Exposé is deactivated.

    I thought I could fix it by detecting exposé and just not move the window while it was activated. Now I'm not really sure what I can do to work around this.
     
  5. Rincewind42 macrumors 6502a

    Rincewind42

    Joined:
    Mar 3, 2003
    Location:
    Orlando, FL
    #5
    I wasn't aware of that bug, but maybe I can offer a few alternative designs.
    Maybe you can use an overlay window and just draw your image in the right position within that window rather than moving the window?
    If you use a non-exposéd window (like a floating/utility type window) then it should be hidden during Exposé, and maybe that will avoid the issue?
     
  6. gekko513 thread starter macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #6
    Moving the content instead of the window is a good idea, I have to sacrifice the possibility of peekabooing from all edges of the screen though (or use a giant window :) ). The app initially used a always-on-top-window that disappeared on show-windows-exposé, it didn't however disappear on show-desktop-exposé, so that doesn't work, unfortunately.
     

Share This Page