Merge pull request #571 from Palakis/bugfix/569-tray-icon-crash

Utils(GetTrayIcon): refactor with frontend API function
This commit is contained in:
Stéphane Lepin
2020-07-29 17:06:01 +02:00
committed by GitHub

View File

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