summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/aqua/source/window/salframe.cxx28
-rw-r--r--vcl/inc/aqua/salframe.h10
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