Implementing OS X full screen feature
Posted: Wed Jun 25, 2014 1:56 pm
Starting with OS X Lion (10.7) OS X windows have a full screen property that causes the window to enter it's own space and fill the entire screen. While LiveCode stacks have a 'fullscreen' property, it does not use the OS X APIs and behaves differently. Supporting the native OS X full screen behavior is important as being able to take windows full screen is a common (and expected) behavior on the platform.
Since 6.7 will be introducing windows that use Cocoa and NSWindow, LiveCode can easily support fullscreen mode as defined by OS X.
I added support for full screen mode to one of my apps using an external. I used three handlers:
There are also the NSWindowWillEnterFullScreenNotification, NSWindowDidEnterFullScreenNotification, NSWindowWillExitFullScreenNotification, and NSWindowDidExitFullScreenNotification events that may be useful for stacks going into/out of full screen mode.
In LiveCode I think the following would be appropriate:
set/get the fullscreen of stack X
set/get the fullScreenControl of stack X
on willEnterFullScreen
on didEnterFullScreen
on willExitFullScreen
on didExitFullScreen
I'm not sure what to do with the NSWindowCollectionBehaviorFullScreenAuxiliary constant. I guess that would become a stack window 'style'?
The problem is that LiveCode already has a 'fullscreen' property so if support for the OS X feature is added we need to think of different name for the property.
Any ideas on a good property name?
Since 6.7 will be introducing windows that use Cocoa and NSWindow, LiveCode can easily support fullscreen mode as defined by OS X.
I added support for full screen mode to one of my apps using an external. I used three handlers:
- ToggleWindowIsFullScreen windowId: toggles full screen mode of a window
- WindowIsFullScreen windowId: Returns whether or not a window is in full screen mode
- SetHasFullScreenControl windowId: Turns on the full screen control for a window. This control appears in the top-right hand corner of the window.
There are also the NSWindowWillEnterFullScreenNotification, NSWindowDidEnterFullScreenNotification, NSWindowWillExitFullScreenNotification, and NSWindowDidExitFullScreenNotification events that may be useful for stacks going into/out of full screen mode.
In LiveCode I think the following would be appropriate:
set/get the fullscreen of stack X
set/get the fullScreenControl of stack X
on willEnterFullScreen
on didEnterFullScreen
on willExitFullScreen
on didExitFullScreen
I'm not sure what to do with the NSWindowCollectionBehaviorFullScreenAuxiliary constant. I guess that would become a stack window 'style'?
The problem is that LiveCode already has a 'fullscreen' property so if support for the OS X feature is added we need to think of different name for the property.
Any ideas on a good property name?