Kaydet (Commit) e7388206 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst 7c5b0cde
...@@ -26,14 +26,12 @@ ...@@ -26,14 +26,12 @@
#include "vcl/svapp.hxx" #include "vcl/svapp.hxx"
#include "vcl/window.hxx" #include "vcl/window.hxx"
#include "vcl/timer.hxx"
#include "vcl/syswin.hxx" #include "vcl/syswin.hxx"
#include "aqua/saldata.hxx" #include "aqua/saldata.hxx"
#include "aqua/salgdi.h" #include "aqua/salgdi.h"
#include "aqua/salframe.h" #include "aqua/salframe.h"
#include "aqua/salmenu.h" #include "aqua/salmenu.h"
#include "aqua/saltimer.h"
#include "aqua/salinst.h" #include "aqua/salinst.h"
#include "aqua/salframeview.h" #include "aqua/salframeview.h"
#include "aqua/aqua11yfactory.h" #include "aqua/aqua11yfactory.h"
...@@ -831,25 +829,6 @@ void AquaSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ) ...@@ -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 ) void AquaSalFrame::StartPresentation( sal_Bool bStart )
{ {
if ( !mpWindow ) if ( !mpWindow )
...@@ -861,7 +840,10 @@ void AquaSalFrame::StartPresentation( sal_Bool bStart ) ...@@ -861,7 +840,10 @@ void AquaSalFrame::StartPresentation( sal_Bool bStart )
if( bStart ) if( bStart )
{ {
GetSalData()->maPresentationFrames.push_back( this ); GetSalData()->maPresentationFrames.push_back( this );
mpActivityTimer.reset( new PreventSleepTimer() ); IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep,
kIOPMAssertionLevelOn,
CFSTR("LibreOffice presentation running"),
&mnAssertionID);
[mpWindow setLevel: NSPopUpMenuWindowLevel]; [mpWindow setLevel: NSPopUpMenuWindowLevel];
if( mbShown ) if( mbShown )
[mpWindow makeMainWindow]; [mpWindow makeMainWindow];
...@@ -869,7 +851,7 @@ void AquaSalFrame::StartPresentation( sal_Bool bStart ) ...@@ -869,7 +851,7 @@ void AquaSalFrame::StartPresentation( sal_Bool bStart )
else else
{ {
GetSalData()->maPresentationFrames.remove( this ); GetSalData()->maPresentationFrames.remove( this );
mpActivityTimer.reset(); IOPMAssertionRelease(mnAssertionID);
[mpWindow setLevel: NSNormalWindowLevel]; [mpWindow setLevel: NSNormalWindowLevel];
} }
} }
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
#ifndef _SV_SALFRAME_H #ifndef _SV_SALFRAME_H
#define _SV_SALFRAME_H #define _SV_SALFRAME_H
#include <premac.h>
#include <IOKit/pwr_mgt/IOPMLib.h>
#include <postmac.h>
#include "vcl/sysdata.hxx" #include "vcl/sysdata.hxx"
#include "aqua/salmenu.h" #include "aqua/salmenu.h"
...@@ -32,8 +36,6 @@ ...@@ -32,8 +36,6 @@
#include <utility> #include <utility>
#include <stdexcept> #include <stdexcept>
#include <boost/shared_ptr.hpp>
class AquaSalGraphics; class AquaSalGraphics;
class AquaSalFrame; class AquaSalFrame;
class AquaSalTimer; class AquaSalTimer;
...@@ -92,7 +94,9 @@ public: ...@@ -92,7 +94,9 @@ public:
sal_uLong mnICOptions; sal_uLong mnICOptions;
boost::shared_ptr< Timer > mpActivityTimer; // Timer to prevent system sleep during presentation // To prevent display sleep during presentation
IOPMAssertionID mnAssertionID;
public: public:
/** Constructor /** Constructor
......
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