summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2011-04-06 11:56:51 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-17 13:39:34 +0200
commitf18fc2ef12d8004ce28b4412f5ceca77d68605c6 (patch)
tree959df43c2b6ae1923deb12ce6a79a22e5b24eb8f /vcl
parentb7e00ffeaace7a35b5e69fb23b97d2d486221c90 (diff)
ooo34gsl10: #i117587# handle application resigning/becoming active during presentation [hg:98a8c4a45d03]
Diffstat (limited to 'vcl')
-rwxr-xr-xvcl/aqua/source/app/vclnsapp.mm26
-rw-r--r--vcl/aqua/source/window/salframe.cxx5
-rw-r--r--vcl/inc/aqua/saldata.hxx3
3 files changed, 26 insertions, 8 deletions
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index cfb4d5e62454..fc4945e1e184 100755
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -453,37 +453,51 @@
- (void)applicationWillBecomeActive:(NSNotification *)pNotification
{
(void)pNotification;
- if (GetSalData()->mpMainController->remoteControl) {
-
+ SalData* pSalData = GetSalData();
+ if (pSalData->mpMainController->remoteControl)
+ {
// [remoteControl startListening: self];
// does crash because the right thing to do is
// [GetSalData()->mpMainController->remoteControl startListening: self];
// but the instance variable 'remoteControl' is declared protected
// workaround : declare remoteControl instance variable as public in RemoteMainController.m
- [GetSalData()->mpMainController->remoteControl startListening: self];
+ [pSalData->mpMainController->remoteControl startListening: self];
#ifdef DEBUG
NSLog(@"Apple Remote will become active - Using remote controls");
#endif
}
+ for( std::list< AquaSalFrame* >::const_iterator it = pSalData->maPresentationFrames.begin();
+ it != pSalData->maPresentationFrames.end(); ++it )
+ {
+ [(*it)->mpWindow setLevel: NSPopUpMenuWindowLevel];
+ if( [(*it)->mpWindow isVisible] )
+ [(*it)->mpWindow orderFront: NSApp];
+ }
}
- (void)applicationWillResignActive:(NSNotification *)pNotification
{
(void)pNotification;
- if (GetSalData()->mpMainController->remoteControl) {
-
+ SalData* pSalData = GetSalData();
+ if (pSalData->mpMainController->remoteControl)
+ {
// [remoteControl stopListening: self];
// does crash because the right thing to do is
// [GetSalData()->mpMainController->remoteControl stopListening: self];
// but the instance variable 'remoteControl' is declared protected
// workaround : declare remoteControl instance variable as public in RemoteMainController.m
- [GetSalData()->mpMainController->remoteControl stopListening: self];
+ [pSalData->mpMainController->remoteControl stopListening: self];
#ifdef DEBUG
NSLog(@"Apple Remote will resign active - Releasing remote controls");
#endif
}
+ for( std::list< AquaSalFrame* >::const_iterator it = pSalData->maPresentationFrames.begin();
+ it != pSalData->maPresentationFrames.end(); ++it )
+ {
+ [(*it)->mpWindow setLevel: NSNormalWindowLevel];
+ }
}
- (BOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (BOOL) bWinVisible
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index 8749774459d3..eec0a0ec3602 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -120,6 +120,7 @@ AquaSalFrame::~AquaSalFrame()
SalData* pSalData = GetSalData();
pSalData->maFrames.remove( this );
pSalData->maFrameCheck.erase( this );
+ pSalData->maPresentationFrames.remove( this );
DBG_ASSERT( this != s_pCaptureFrame, "capture frame destroyed" );
if( this == s_pCaptureFrame )
@@ -853,13 +854,15 @@ void AquaSalFrame::StartPresentation( sal_Bool bStart )
if( bStart )
{
+ GetSalData()->maPresentationFrames.push_back( this );
mpActivityTimer.reset( new PreventSleepTimer() );
- [mpWindow setLevel: NSScreenSaverWindowLevel];
+ [mpWindow setLevel: NSPopUpMenuWindowLevel];
if( mbShown )
[mpWindow makeMainWindow];
}
else
{
+ GetSalData()->maPresentationFrames.remove( this );
mpActivityTimer.reset();
[mpWindow setLevel: NSNormalWindowLevel];
}
diff --git a/vcl/inc/aqua/saldata.hxx b/vcl/inc/aqua/saldata.hxx
index 5dc528b04f4b..e9bceb06bb67 100644
--- a/vcl/inc/aqua/saldata.hxx
+++ b/vcl/inc/aqua/saldata.hxx
@@ -83,8 +83,9 @@ struct SalData
SALTIMERPROC mpTimerProc; // timer callback proc
AquaSalInstance *mpFirstInstance; // pointer of first instance
- std::list<AquaSalFrame*> maFrames; // pointer of first frame
+ std::list<AquaSalFrame*> maFrames; // list of all frames
std::hash_set<const AquaSalFrame*,FrameHash> maFrameCheck; // for fast check of frame existance
+ std::list<AquaSalFrame*> maPresentationFrames; // list of frames in presentation mode
SalObject *mpFirstObject; // pointer of first object window
SalVirtualDevice *mpFirstVD; // first VirDev
SalPrinter *mpFirstPrinter; // first printing printer