diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-07-26 21:29:43 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-07-26 21:30:59 +0200 |
| commit | 6eba051dcbb8c56e3e2efea946ce0380d17a7b33 (patch) | |
| tree | 3749c9cb5cbd8be4b14936978e13b889ffcc73a3 /src/lib/cross_osx.cc | |
| parent | 2e0cf721530a17b0190c938b04176e0315950053 (diff) | |
Various OSX warnings fixes.
Diffstat (limited to 'src/lib/cross_osx.cc')
| -rw-r--r-- | src/lib/cross_osx.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index 574cc8660..aa05df016 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -24,6 +24,7 @@ #include "dcpomatic_log.h" #include "config.h" #include "exceptions.h" +#include "warnings.h" #include <dcp/raw_convert.h> #include <glib.h> extern "C" { @@ -35,6 +36,7 @@ extern "C" { #if BOOST_VERSION >= 106100 #include <boost/dll/runtime_symbol_info.hpp> #endif +#include <ApplicationServices/ApplicationServices.h> #include <sys/sysctl.h> #include <mach-o/dyld.h> #include <IOKit/pwr_mgt/IOPMLib.h> @@ -180,10 +182,7 @@ Waker::nudge () Waker::Waker () { boost::mutex::scoped_lock lm (_mutex); - /* We should use this */ - // IOPMAssertionCreateWithName (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR ("Encoding DCP"), &_assertion_id); - /* but it's not available on 10.5, so we use this */ - IOPMAssertionCreate (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, &_assertion_id); + IOPMAssertionCreateWithName (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR ("Encoding DCP"), &_assertion_id); } Waker::~Waker () @@ -566,3 +565,14 @@ disk_write_finished () } + +void +make_foreground_application () +{ + ProcessSerialNumber serial; +DCPOMATIC_DISABLE_WARNINGS + GetCurrentProcess (&serial); +DCPOMATIC_ENABLE_WARNINGS + TransformProcessType (&serial, kProcessTransformToForegroundApplication); +} + |
