Display Cocoa window above Keynote presentation

2020-07-18 11:32发布

问题:

Some context: I am building a tool to be used on screen during a Keynote or PowerPoint presentation.

The biggest issue I've had so far is that Keynote seems to take over the desktop whenever you view a presentation. I have tried setting my Cocoa window's level to the maximum using:

[[self window] setLevel:kCGMaximumWindowLevel];

That seems to have some effect (I can have the window hover over Keynote's "control panel" that's active in the off-screen window), but it doesn't let me hover over the actual presentation.

Any ideas? Thanks in advance for the help!

回答1:

Try setting the level to NSScreenSaverWindowLevel + 1.



回答2:

Keynote has some settings in its Preferences that also must be set. Try these:

/usr/bin/defaults write com.apple.iWork.Keynote PresentationModePlayWellWithOthers 1
/usr/bin/defaults write com.apple.iWork.Keynote MouseVisibility 2

Definitely the 1st one is required. The 2nd is just for practicality.

This is in addition to what Rob suggested above in setting the window level to just above the NSScreenSaverWindowLevel.