mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-19 21:55:40 +00:00
(svn r25657) -Fix [FS#4744]: [OSX] The new 10.7 fullscreen code can now also be compiled with older SDK versions.
This commit is contained in:
parent
2702fe88d7
commit
7ba4d425c8
@ -240,12 +240,12 @@ void WindowQuartzSubdriver::GetDeviceInfo()
|
|||||||
*/
|
*/
|
||||||
bool WindowQuartzSubdriver::ToggleFullscreen()
|
bool WindowQuartzSubdriver::ToggleFullscreen()
|
||||||
{
|
{
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
if ([ this->window respondsToSelector:@selector(toggleFullScreen:) ]) {
|
||||||
[this->window toggleFullScreen:this->window];
|
[ this->window performSelector:@selector(toggleFullScreen:) withObject:this->window ];
|
||||||
return true;
|
return true;
|
||||||
#else
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp)
|
bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp)
|
||||||
@ -280,15 +280,17 @@ bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
||||||
/* Add built in full-screen support when available (OS X 10.7 and higher)
|
/* Add built in full-screen support when available (OS X 10.7 and higher)
|
||||||
* This code actually compiles for 10.5 and later, but only makes sense in conjunction
|
* This code actually compiles for 10.5 and later, but only makes sense in conjunction
|
||||||
* with the quartz fullscreen support as found only in 10.7 and later
|
* with the quartz fullscreen support as found only in 10.7 and later
|
||||||
*/
|
*/
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
|
||||||
if ([this->window respondsToSelector:@selector(toggleFullScreen:)]) {
|
if ([this->window respondsToSelector:@selector(toggleFullScreen:)]) {
|
||||||
/* Constants needed to build on pre-10.7 systems. Source: NSWindow documentation. */
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
|
||||||
|
/* Constants needed to build on pre-10.7 SDKs. Source: NSWindow documentation. */
|
||||||
const int NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7;
|
const int NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7;
|
||||||
const int NSWindowFullScreenButton = 7;
|
const int NSWindowFullScreenButton = 7;
|
||||||
|
#endif
|
||||||
|
|
||||||
NSWindowCollectionBehavior behavior = [ this->window collectionBehavior ];
|
NSWindowCollectionBehavior behavior = [ this->window collectionBehavior ];
|
||||||
behavior |= NSWindowCollectionBehaviorFullScreenPrimary;
|
behavior |= NSWindowCollectionBehaviorFullScreenPrimary;
|
||||||
|
Loading…
Reference in New Issue
Block a user