Kaydet (Commit) 41d2036b authored tarafından Herbert Dürr's avatar Herbert Dürr Kaydeden (comit) Caolán McNamara

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

(cherry picked from commit 88363bd6)

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 1a699e62)

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 8ea45f79)

Conflicts:
	vcl/aqua/source/window/salframeview.mm

Change-Id: I81e8d0a806cb6246a4fc647798ffc277dae8fa70
üst bcc239b4
......@@ -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;
......
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