UI: Only inhibit when active or if projector open

Having sleep or screensavers inhibited at all times was causing some
annoyances for people.  Sleep/screensavers are now only inhibited when
the program is active or when a projector is open.
This commit is contained in:
jp9000
2015-11-16 09:08:55 -08:00
parent 14bfa07168
commit 34bbc444eb
5 changed files with 60 additions and 14 deletions
+3
View File
@@ -25,12 +25,15 @@ OBSProjector::OBSProjector(QWidget *widget, obs_source_t *source_)
};
connect(this, &OBSQTDisplay::DisplayCreated, addDrawCallback);
App()->IncrementSleepInhibition();
}
OBSProjector::~OBSProjector()
{
if (source)
obs_source_dec_showing(source);
App()->DecrementSleepInhibition();
}
void OBSProjector::Init(int monitor)