[Libreoffice-commits] core.git: 2 commits - vcl/aqua vcl/inc
Tor Lillqvist
tml at iki.fi
Sun Jun 16 10:38:39 PDT 2013
vcl/aqua/source/window/salframe.cxx | 31 +++++--------------------------
vcl/inc/aqua/salframe.h | 10 +++++++---
2 files changed, 12 insertions(+), 29 deletions(-)
New commits:
commit 52cc6555bcfd81b785de6862805fcb877b466ba6
Author: Tor Lillqvist <tml at iki.fi>
Date: Sun Jun 16 20:22:21 2013 +0300
Remove duplicated call to SalData::ensureThreadAutoreleasePool()
Change-Id: I788949fbec9eea3d65b9f063dec416e41ba4815b
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index d33d251..3a3c311 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -872,9 +872,6 @@ void AquaSalFrame::ToTop(sal_uInt16 nFlags)
// #i113170# may not be the main thread if called from UNO API
SalData::ensureThreadAutoreleasePool();
- // #i113170# may not be the main thread if called from UNO API
- SalData::ensureThreadAutoreleasePool();
-
if( ! (nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN) )
{
if( ! [mpWindow isVisible] || [mpWindow isMiniaturized] )
commit e73882063c7b1abbfd842a82854887a7eaed8c02
Author: Tor Lillqvist <tml at iki.fi>
Date: Sun Jun 16 20:19:07 2013 +0300
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
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index c2a66e3..d33d251 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 ade5438..e7c122a 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
More information about the Libreoffice-commits
mailing list