From d08ede33cd2a6115bbaf19929bd31056e1513653 Mon Sep 17 00:00:00 2001 From: cg2121 Date: Sat, 21 Jan 2023 15:45:55 -0600 Subject: [PATCH] UI: Disable screenshot action if item has no video This disables the source screenshot action in the context menu if the source has no video. --- UI/window-basic-main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 35fdc2134..6aec6062d 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -5689,8 +5689,12 @@ void OBSBasic::CreateSourcePopupMenu(int idx, bool preview) popup.addMenu(sourceProjector); popup.addAction(QTStr("SourceWindow"), this, SLOT(OpenSourceWindow())); - popup.addAction(QTStr("Screenshot.Source"), this, - SLOT(ScreenshotSelectedSource())); + + QAction *screenshotAction = + popup.addAction(QTStr("Screenshot.Source"), this, + SLOT(ScreenshotSelectedSource())); + screenshotAction->setEnabled(flags & OBS_SOURCE_VIDEO); + popup.addSeparator(); if (flags & OBS_SOURCE_INTERACTION)