|
|
@@ -5555,7 +5555,7 @@ inline void OBSBasic::OnActivate()
|
|
|
App()->IncrementSleepInhibition();
|
|
|
UpdateProcessPriority();
|
|
|
|
|
|
- if (trayIcon)
|
|
|
+ if (trayIcon && trayIcon->isVisible())
|
|
|
trayIcon->setIcon(QIcon::fromTheme(
|
|
|
"obs-tray-active",
|
|
|
QIcon(":/res/images/tray_active.png")));
|
|
|
@@ -5573,10 +5573,10 @@ inline void OBSBasic::OnDeactivate()
|
|
|
App()->DecrementSleepInhibition();
|
|
|
ClearProcessPriority();
|
|
|
|
|
|
- if (trayIcon)
|
|
|
+ if (trayIcon && trayIcon->isVisible())
|
|
|
trayIcon->setIcon(QIcon::fromTheme(
|
|
|
"obs-tray", QIcon(":/res/images/obs.png")));
|
|
|
- } else if (trayIcon) {
|
|
|
+ } else if (trayIcon && trayIcon->isVisible()) {
|
|
|
if (os_atomic_load_bool(&recording_paused))
|
|
|
trayIcon->setIcon(QIcon(":/res/images/obs_paused.png"));
|
|
|
else
|
|
|
@@ -7551,7 +7551,8 @@ void OBSBasic::IconActivated(QSystemTrayIcon::ActivationReason reason)
|
|
|
void OBSBasic::SysTrayNotify(const QString &text,
|
|
|
QSystemTrayIcon::MessageIcon n)
|
|
|
{
|
|
|
- if (trayIcon && QSystemTrayIcon::supportsMessages()) {
|
|
|
+ if (trayIcon && trayIcon->isVisible() &&
|
|
|
+ QSystemTrayIcon::supportsMessages()) {
|
|
|
QSystemTrayIcon::MessageIcon icon =
|
|
|
QSystemTrayIcon::MessageIcon(n);
|
|
|
trayIcon->showMessage("OBS Studio", text, icon, 10000);
|
|
|
@@ -8069,7 +8070,7 @@ void OBSBasic::PauseRecording()
|
|
|
|
|
|
ui->statusbar->RecordingPaused();
|
|
|
|
|
|
- if (trayIcon)
|
|
|
+ if (trayIcon && trayIcon->isVisible())
|
|
|
trayIcon->setIcon(QIcon(":/res/images/obs_paused.png"));
|
|
|
|
|
|
os_atomic_set_bool(&recording_paused, true);
|
|
|
@@ -8098,7 +8099,7 @@ void OBSBasic::UnpauseRecording()
|
|
|
|
|
|
ui->statusbar->RecordingUnpaused();
|
|
|
|
|
|
- if (trayIcon)
|
|
|
+ if (trayIcon && trayIcon->isVisible())
|
|
|
trayIcon->setIcon(
|
|
|
QIcon(":/res/images/tray_active.png"));
|
|
|
|