From 7c8b053703b35b795647303fcddceaebb6e9b6bc Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 2 Mar 2015 00:46:43 -0800 Subject: [PATCH] UI: Indicate source is being shown in properties When viewing the properties of a source, there's no way to specify that a source is actually being shown or not to the core. This uses the new obs_source_inc_showing and obs_source_dec_showing to tell the source that it's being shown/hidden in this part of the program without necessarily having to use a new render view just to render it. --- obs/window-basic-properties.cpp | 7 +++++++ obs/window-basic-properties.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/obs/window-basic-properties.cpp b/obs/window-basic-properties.cpp index 772d57edf..7b30cf9a0 100644 --- a/obs/window-basic-properties.cpp +++ b/obs/window-basic-properties.cpp @@ -86,6 +86,13 @@ OBSBasicProperties::OBSBasicProperties(QWidget *parent, OBSSource source_) const char *name = obs_source_get_name(source); setWindowTitle(QTStr("Basic.PropertiesWindow").arg(QT_UTF8(name))); + + obs_source_inc_showing(source); +} + +OBSBasicProperties::~OBSBasicProperties() +{ + obs_source_dec_showing(source); } void OBSBasicProperties::SourceRemoved(void *data, calldata_t *params) diff --git a/obs/window-basic-properties.hpp b/obs/window-basic-properties.hpp index 6f0380836..8bce6fe00 100644 --- a/obs/window-basic-properties.hpp +++ b/obs/window-basic-properties.hpp @@ -57,6 +57,7 @@ private slots: public: OBSBasicProperties(QWidget *parent, OBSSource source_); + ~OBSBasicProperties(); void Init();