diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-06-16 20:19:07 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-06-16 20:30:25 +0300 |
commit | e73882063c7b1abbfd842a82854887a7eaed8c02 (patch) | |
tree | 088cc93e9dded92bc8e03775cdc295ee238c84de | |
parent | 7c5b0cde8c2301dd23320831e4a528d9da6f6a2b (diff) |
WaE: 'UpdateSystemActivity' is deprecated: first deprecated in OS X 10.8
Instead use IOKit as described in
http://developer.apple.com/library/mac/#qa/qa1340/_index.html , said
to work in 10.6 or later, thus fine for us.
Change-Id: I1bfcc2b9bce6cdf5d7274e89f96b1739898fa735
-rw-r--r-- | vcl/aqua/source/window/salframe.cxx | 28 | ||||
-rw-r--r-- | vcl/inc/aqua/salframe.h | 10 |
2 files changed, 12 insertions, 26 deletions
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index c2a66e3aa5cc..d33d25130455 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -26,14 +26,12 @@ #include "vcl/svapp.hxx" #include "vcl/window.hxx" -#include "vcl/timer.hxx" #include "vcl/syswin.hxx" #include "aqua/saldata.hxx" #include "aqua/salgdi.h" #include "aqua/salframe.h" #include "aqua/salmenu.h" -#include "aqua/saltimer.h" #include "aqua/salinst.h" #include "aqua/salframeview.h" #include "aqua/aqua11yfactory.h" @@ -831,25 +829,6 @@ void AquaSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ) // ----------------------------------------------------------------------- -class PreventSleepTimer : public AutoTimer -{ -public: - PreventSleepTimer() - { - SetTimeout( 30000 ); - Start(); - } - - virtual ~PreventSleepTimer() - { - } - - virtual void Timeout() - { - UpdateSystemActivity(OverallAct); - } -}; - void AquaSalFrame::StartPresentation( sal_Bool bStart ) { if ( !mpWindow ) @@ -861,7 +840,10 @@ void AquaSalFrame::StartPresentation( sal_Bool bStart ) if( bStart ) { GetSalData()->maPresentationFrames.push_back( this ); - mpActivityTimer.reset( new PreventSleepTimer() ); + IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, + kIOPMAssertionLevelOn, + CFSTR("LibreOffice presentation running"), + &mnAssertionID); [mpWindow setLevel: NSPopUpMenuWindowLevel]; if( mbShown ) [mpWindow makeMainWindow]; @@ -869,7 +851,7 @@ void AquaSalFrame::StartPresentation( sal_Bool bStart ) else { GetSalData()->maPresentationFrames.remove( this ); - mpActivityTimer.reset(); + IOPMAssertionRelease(mnAssertionID); [mpWindow setLevel: NSNormalWindowLevel]; } } diff --git a/vcl/inc/aqua/salframe.h b/vcl/inc/aqua/salframe.h index ade5438ac580..e7c122a23c84 100644 --- a/vcl/inc/aqua/salframe.h +++ b/vcl/inc/aqua/salframe.h @@ -20,6 +20,10 @@ #ifndef _SV_SALFRAME_H #define _SV_SALFRAME_H +#include <premac.h> +#include <IOKit/pwr_mgt/IOPMLib.h> +#include <postmac.h> + #include "vcl/sysdata.hxx" #include "aqua/salmenu.h" @@ -32,8 +36,6 @@ #include <utility> #include <stdexcept> -#include <boost/shared_ptr.hpp> - class AquaSalGraphics; class AquaSalFrame; class AquaSalTimer; @@ -92,7 +94,9 @@ public: sal_uLong mnICOptions; - boost::shared_ptr< Timer > mpActivityTimer; // Timer to prevent system sleep during presentation + // To prevent display sleep during presentation + IOPMAssertionID mnAssertionID; + public: /** Constructor |