aboutsummaryrefslogtreecommitdiff
path: root/src/qt/macos_appnap.h
diff options
context:
space:
mode:
authorAlexey Ivanov <alexey.ivanes@gmail.com>2018-11-01 18:22:06 +0300
committerAlexey Ivanov <alexey.ivanes@gmail.com>2018-11-01 18:22:06 +0300
commit1e0f3c44992fb82e6bf36c2ef9277b0759c17c4c (patch)
tree32b5f7fa397c16ee79b6ac1fe9f5c56b06d95902 /src/qt/macos_appnap.h
parentf6df989842a1dee7e8ad779531c328456c7148a0 (diff)
macOS: disable AppNap during sync
Signed-off-by: Alexey Ivanov <alexey.ivanes@gmail.com>
Diffstat (limited to 'src/qt/macos_appnap.h')
-rw-r--r--src/qt/macos_appnap.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/qt/macos_appnap.h b/src/qt/macos_appnap.h
new file mode 100644
index 0000000000..8c2cd840b0
--- /dev/null
+++ b/src/qt/macos_appnap.h
@@ -0,0 +1,24 @@
+// Copyright (c) 2011-2018 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#ifndef BITCOIN_QT_MACOS_APPNAP_H
+#define BITCOIN_QT_MACOS_APPNAP_H
+
+#include <memory>
+
+class CAppNapInhibitor final
+{
+public:
+ explicit CAppNapInhibitor();
+ ~CAppNapInhibitor();
+
+ void disableAppNap();
+ void enableAppNap();
+
+private:
+ class CAppNapImpl;
+ std::unique_ptr<CAppNapImpl> impl;
+};
+
+#endif // BITCOIN_QT_MACOS_APPNAP_H