forked from Mirrors/openclonk
mac: Use OSX Mavericks occlusionState API to test whether window is visible and needs drawing or not (should still work on Mountain Lion due to runtime check for API availability)
parent
59742510d9
commit
a599974a9b
|
@ -115,12 +115,22 @@
|
|||
// better not to draw anything when the game has already finished
|
||||
if (Application.fQuitMsgReceived)
|
||||
return;
|
||||
|
||||
// don't draw if tab-switched away from fullscreen
|
||||
if ([self.controller isFullScreenConsideringLionFullScreen] && ![NSApp isActive])
|
||||
return;
|
||||
if ([self.window isMiniaturized] || ![self.window isVisible])
|
||||
return;
|
||||
//[self.context update];
|
||||
if ([NSApp respondsToSelector:@selector(occlusionState)])
|
||||
{
|
||||
// Mavericks - query app occlusion state
|
||||
if (([NSApp occlusionState] & NSApplicationOcclusionStateVisible) == 0)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([self.controller isFullScreenConsideringLionFullScreen] && ![NSApp isActive])
|
||||
return;
|
||||
if ([self.window isMiniaturized] || ![self.window isVisible])
|
||||
return;
|
||||
}
|
||||
|
||||
C4Window* stdWindow = self.controller.stdWindow;
|
||||
|
||||
if (stdWindow)
|
||||
|
|
Loading…
Reference in New Issue