Merge pull request #316 from Rosuav/no-tray-icon

Return nullptr if there are no tray icons
This commit is contained in:
Stéphane Lepin 2019-05-03 22:18:54 +02:00 committed by GitHub
commit ef853e34d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -390,7 +390,8 @@ QSystemTrayIcon* Utils::GetTrayIcon() {
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
if (!main) return nullptr;
return main->findChildren<QSystemTrayIcon*>().first();
QList<QSystemTrayIcon*> trays = main->findChildren<QSystemTrayIcon*>();
return trays.isEmpty() ? nullptr : trays.first();
}
void Utils::SysTrayNotify(QString text,