Disable touchbar on macOS < 10.13.

This commit is contained in:
John Preston 2019-05-27 17:01:29 +02:00
parent 0f08342533
commit f1e3d2f513
2 changed files with 16 additions and 0 deletions

View File

@ -83,6 +83,7 @@ protected:
void closeWithoutDestroy() override;
private:
void initTouchBar();
void hideAndDeactivate();
void createGlobalMenu();
void updateTitleCounter();

View File

@ -396,6 +396,21 @@ MainWindow::MainWindow()
}
});
initTouchBar();
}
void MainWindow::initTouchBar() {
const int version = QSysInfo::macVersion();
constexpr int kShift = 2;
if (version == QSysInfo::MV_Unknown
#ifndef OS_MAC_OLD
|| version == QSysInfo::MV_None
#endif // OS_MAC_OLD
// Allow touch bar only starting with 10.13.
|| version < kShift + 13) {
return;
}
subscribe(Core::App().authSessionChanged(), [this] {
if (AuthSession::Exists()) {
// We need only common pinned dialogs.