Explorar el Código

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.
jp9000 hace 10 años
padre
commit
7c8b053703
Se han modificado 2 ficheros con 8 adiciones y 0 borrados
  1. 7 0
      obs/window-basic-properties.cpp
  2. 1 0
      obs/window-basic-properties.hpp

+ 7 - 0
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)

+ 1 - 0
obs/window-basic-properties.hpp

@@ -57,6 +57,7 @@ private slots:
 
 public:
 	OBSBasicProperties(QWidget *parent, OBSSource source_);
+	~OBSBasicProperties();
 
 	void Init();