summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Dürr <hdu@apache.org>2012-12-18 15:25:42 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-07-29 11:28:04 +0100
commit41d2036bee3279928903cdada115d3e3cd022a06 (patch)
treee7331a2ca5a247c8e3b0d0dea85b4cffbfc970be
parentbcc239b405478040fda46d1bf1d4f3e38506d1a3 (diff)
Resolves: #i121406# support the OSX>=10.7 fullscreen mode based on OSX Spaces
(cherry picked from commit 88363bd6ddcd91c0f36131ad33f76b6e1791e4bf) Conflicts: vcl/aqua/source/window/salframeview.mm Change-Id: Idb95b840d2c54f3a8fe75437038afcfc5520007a Related: #i121406# remove willEnter/willExit-FullScreen methods... until they become more useful (cherry picked from commit 1a699e625158cd44c8af069bee63ebd9fd6e0f3d) Change-Id: I8899fe89fbbde3964321a9e8064ebc9423987948 Related: #i121406# #i119006# fix NSWindow's performSelector:withObject type NSWindow uses the type-casted plain integers instead of the boxed number objects (aka NSNumber) (cherry picked from commit 8ea45f79845ed80d5af1aadaf7af0fc3f9c4c1e6) Conflicts: vcl/aqua/source/window/salframeview.mm Change-Id: I81e8d0a806cb6246a4fc647798ffc277dae8fa70
-rw-r--r--vcl/aqua/source/window/salframeview.mm45
1 files changed, 45 insertions, 0 deletions
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index a0715d5eeeef..1afc228473f8 100644
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -33,6 +33,14 @@
#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 )
{
sal_uInt16 nRet = 0;
@@ -149,6 +157,23 @@ static AquaSalFrame* getMouseContainerFrame()
pFrame->VCLToCocoa( aRect );
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
+
+ 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])
+ {
+ const int bMode= (bAllowFullScreen ? NSWindowCollectionBehaviorFullScreenPrimary : NSWindowCollectionBehaviorFullScreenAuxiliary);
+ [pNSWindow performSelector:setCollectionBehavior withObject:(id)bMode];
+ }
+
+ // disable OSX>=10.7 window restoration until we support it directly
+ const SEL setRestorable = @selector(setRestorable:);
+ if( [pNSWindow respondsToSelector: setRestorable]) {
+ [pNSWindow performSelector:setRestorable withObject:(id)NO];
+ }
+
return (SalFrameWindow *) pNSWindow;
}
@@ -320,6 +345,26 @@ static AquaSalFrame* getMouseContainerFrame()
return bRet;
}
+-(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)sender;