Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gekko513

macrumors 603
Original poster
Oct 16, 2003
6,301
1
In a Cocoa / Objective C app, how do I detect if Exposé has been activated?
 
gekko513 said:
In a Cocoa / Objective C app, how do I detect if Exposé has been activated?

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?
 
Rincewind42 said:
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?
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.
 
gekko513 said:
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.

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?
 
Rincewind42 said:
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?
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.