浏览代码

UI: Fix preview state when minimizing to tray

Makes sure preview is properly enabled/disabled when minimizing to tray,
when restoring from tray, or when starting the program up minimized to
tray
jp9000 5 年之前
父节点
当前提交
dff05d9fcc
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      UI/window-basic-main.cpp

+ 3 - 1
UI/window-basic-main.cpp

@@ -7180,8 +7180,10 @@ void OBSBasic::IconActivated(QSystemTrayIcon::ActivationReason reason)
 	AddProjectorMenuMonitors(studioProgramProjector, this,
 				 SLOT(OpenStudioProgramProjector()));
 
-	if (reason == QSystemTrayIcon::Trigger)
+	if (reason == QSystemTrayIcon::Trigger) {
+		EnablePreviewDisplay(previewEnabled && !isVisible());
 		ToggleShowHide();
+	}
 }
 
 void OBSBasic::SysTrayNotify(const QString &text,