diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-04-06 11:56:51 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-17 13:39:34 +0200 |
commit | f18fc2ef12d8004ce28b4412f5ceca77d68605c6 (patch) | |
tree | 959df43c2b6ae1923deb12ce6a79a22e5b24eb8f /vcl/aqua/source/app/vclnsapp.mm | |
parent | b7e00ffeaace7a35b5e69fb23b97d2d486221c90 (diff) |
ooo34gsl10: #i117587# handle application resigning/becoming active during presentation [hg:98a8c4a45d03]
Diffstat (limited to 'vcl/aqua/source/app/vclnsapp.mm')
-rwxr-xr-x | vcl/aqua/source/app/vclnsapp.mm | 26 |
1 files changed, 20 insertions, 6 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 |