Kaydet (Commit) 88363bd6 authored tarafından Herbert Dürr's avatar Herbert Dürr

#i121406# support the OSX>=10.7 fullscreen mode based on OSX Spaces

üst 29774b1d
...@@ -37,6 +37,14 @@ ...@@ -37,6 +37,14 @@
#define WHEEL_EVENT_FACTOR 1.5 #define WHEEL_EVENT_FACTOR 1.5
// for allowing fullscreen support on deployment targets < OSX 10.7
#if !defined(MAC_OS_X_VERSION_10_7)
#define NSWindowCollectionBehaviorFullScreenPrimary (1 << 7)
#define NSWindowCollectionBehaviorFullScreenAuxiliary (1 << 8)
// #define NSFullScreenWindowMask (1 << 14)
#endif
static sal_uInt16 ImplGetModifierMask( unsigned int nMask ) static sal_uInt16 ImplGetModifierMask( unsigned int nMask )
{ {
sal_uInt16 nRet = 0; sal_uInt16 nRet = 0;
...@@ -153,6 +161,17 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -153,6 +161,17 @@ static AquaSalFrame* getMouseContainerFrame()
pFrame->VCLToCocoa( aRect ); pFrame->VCLToCocoa( aRect );
NSWindow* pNSWindow = [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ]; NSWindow* pNSWindow = [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ];
[pNSWindow useOptimizedDrawing: YES]; // OSX recommendation when there are no overlapping subviews within the receiver [pNSWindow useOptimizedDrawing: YES]; // OSX recommendation when there are no overlapping subviews within the receiver
bool bAllowFullScreen = (0 == (mpFrame->mnStyle & (SAL_FRAME_STYLE_DIALOG | SAL_FRAME_STYLE_TOOLTIP | SAL_FRAME_STYLE_SYSTEMCHILD | SAL_FRAME_STYLE_FLOAT | SAL_FRAME_STYLE_TOOLWINDOW | SAL_FRAME_STYLE_INTRO)));
bAllowFullScreen &= (0 == (~mpFrame->mnStyle & (SAL_FRAME_STYLE_SIZEABLE)));
bAllowFullScreen &= (mpFrame->mpParent == NULL);
const SEL setCollectionBehavior = @selector(setCollectionBehavior:);
if( bAllowFullScreen && [pNSWindow respondsToSelector: setCollectionBehavior])
{
NSNumber* bMode = [NSNumber numberWithInt:(bAllowFullScreen ? NSWindowCollectionBehaviorFullScreenPrimary : NSWindowCollectionBehaviorFullScreenAuxiliary)];
[pNSWindow performSelector:setCollectionBehavior withObject:bMode];
}
return pNSWindow; return pNSWindow;
} }
...@@ -324,6 +343,50 @@ static AquaSalFrame* getMouseContainerFrame() ...@@ -324,6 +343,50 @@ static AquaSalFrame* getMouseContainerFrame()
return bRet; return bRet;
} }
#if 0 // windowWillEnterFullScreen doesn't do anything useful yet
-(void)windowWillEnterFullScreen: (NSNotification*)pNotification
{
YIELD_GUARD;
if( !mpFrame || !AquaSalFrame::isAlive( mpFrame ) )
return;
// TODO: implement something useful
(void)pNotification;
}
#endif
#if 0 // windowWillExitFullScreen doesn't do anything useful yet
-(void)windowWillExitFullScreen: (NSNotification*)pNotification
{
YIELD_GUARD;
if( !mpFrame || !AquaSalFrame::isAlive( mpFrame ) )
return;
// TODO: implement something useful
(void)pNotification;
}
#endif
-(void)windowDidEnterFullScreen: (NSNotification*)pNotification
{
YIELD_GUARD;
if( !mpFrame || !AquaSalFrame::isAlive( mpFrame))
return;
mpFrame->mbFullScreen = true;
(void)pNotification;
}
-(void)windowDidExitFullScreen: (NSNotification*)pNotification
{
YIELD_GUARD;
if( !mpFrame || !AquaSalFrame::isAlive( mpFrame))
return;
mpFrame->mbFullScreen = false;
(void)pNotification;
}
-(void)dockMenuItemTriggered: (id)sender -(void)dockMenuItemTriggered: (id)sender
{ {
(void)sender; (void)sender;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment