incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1167573 - in /incubator/ooo/trunk/main/vcl: aqua/source/app/vclnsapp.mm aqua/source/window/salframe.cxx inc/aqua/saldata.hxx
Date Sat, 10 Sep 2011 18:09:15 GMT
Author: erack
Date: Sat Sep 10 18:09:15 2011
New Revision: 1167573

URL: http://svn.apache.org/viewvc?rev=1167573&view=rev
Log:
ooo34gsl10: #i117587# handle application resigning/becoming active during presentation

# User Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>

Modified:
    incubator/ooo/trunk/main/vcl/aqua/source/app/vclnsapp.mm
    incubator/ooo/trunk/main/vcl/aqua/source/window/salframe.cxx
    incubator/ooo/trunk/main/vcl/inc/aqua/saldata.hxx

Modified: incubator/ooo/trunk/main/vcl/aqua/source/app/vclnsapp.mm
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/aqua/source/app/vclnsapp.mm?rev=1167573&r1=1167572&r2=1167573&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/aqua/source/app/vclnsapp.mm (original)
+++ incubator/ooo/trunk/main/vcl/aqua/source/app/vclnsapp.mm Sat Sep 10 18:09:15 2011
@@ -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

Modified: incubator/ooo/trunk/main/vcl/aqua/source/window/salframe.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/aqua/source/window/salframe.cxx?rev=1167573&r1=1167572&r2=1167573&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/aqua/source/window/salframe.cxx (original)
+++ incubator/ooo/trunk/main/vcl/aqua/source/window/salframe.cxx Sat Sep 10 18:09:15 2011
@@ -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( sa
     
     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];
     }

Modified: incubator/ooo/trunk/main/vcl/inc/aqua/saldata.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/inc/aqua/saldata.hxx?rev=1167573&r1=1167572&r2=1167573&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/inc/aqua/saldata.hxx (original)
+++ incubator/ooo/trunk/main/vcl/inc/aqua/saldata.hxx Sat Sep 10 18:09:15 2011
@@ -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



Mime
View raw message