Skip to content

Commit

Permalink
Disable the screensaver only when playing video.
Browse files Browse the repository at this point in the history
  • Loading branch information
zorbathut committed Oct 26, 2024
1 parent bed40ac commit 7e2dd1e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ Core::Core( MplayerWindow *mpw, QWidget* parent )

#ifdef USE_POWERSAVING
screensaver = new ScreenSaver(this);
connect( this, SIGNAL(aboutToStartPlaying()), this, SLOT(disableScreensaver()) );
connect( proc, SIGNAL(processExited()), this, SLOT(enableScreensaver()) );
connect( proc, SIGNAL(error(QProcess::ProcessError)), this, SLOT(enableScreensaver()) );
#endif
Expand Down Expand Up @@ -4797,16 +4796,13 @@ void Core::sendMediaInfo() {
//! Called when the state changes
void Core::watchState(Core::State state) {
#ifdef USE_POWERSAVING
#if 1
qDebug("Core::watchState: %d", state);
//qDebug("Core::watchState: has video: %d", !mdat.novideo);

if ((state == Playing) /* && (!mdat.novideo) */) {
if (state == Playing) {
disableScreensaver();
} else {
enableScreensaver();
}
#endif
#endif

if ((proc->isMPlayer()) && (state == Playing) && (change_volume_after_unpause)) {
Expand Down

0 comments on commit 7e2dd1e

Please sign in to comment.