1
0
Fork 0

[Backend/Utils] Added screensaver resetting whilst playing.

This commit is contained in:
NamedKitten 2018-11-21 08:03:28 +00:00
parent bd41d19d24
commit d5f4ab408f
4 changed files with 16 additions and 2 deletions

View file

@ -501,6 +501,7 @@ DirectMpvPlayerBackend::handle_mpv_event(mpv_event* event)
if (prop->format == MPV_FORMAT_DOUBLE) {
double time = *(double*)prop->data;
emit positionChanged(time);
Utils::ResetScreensaver();
}
} else if (strcmp(prop->name, "duration") == 0) {
if (prop->format == MPV_FORMAT_DOUBLE) {

View file

@ -468,6 +468,7 @@ MpvPlayerBackend::handle_mpv_event(mpv_event* event)
if (prop->format == MPV_FORMAT_DOUBLE) {
double time = *(double*)prop->data;
emit positionChanged(time);
Utils::ResetScreensaver();
}
} else if (strcmp(prop->name, "duration") == 0) {
if (prop->format == MPV_FORMAT_DOUBLE) {

View file

@ -59,7 +59,6 @@ createTimestamp(int seconds)
void
SetDPMS(bool on)
{
qDebug() << getPlatformName();
if (getPlatformName() != "xcb") {
return;
}
@ -72,11 +71,16 @@ SetDPMS(bool on)
qDebug() << "Disabled DPMS.";
}
}
void
ResetScreensaver()
{
Display* display = QX11Info::display();
XResetScreenSaver(display);
}
void
AlwaysOnTop(WId wid, bool on)
{
qDebug() << "On Top:" << on;
Display* display = QX11Info::display();
XEvent event;
event.xclient.type = ClientMessage;
@ -114,5 +118,11 @@ SetDPMS(bool on)
qDebug() << "Can't set DPMS for platform: " << getPlatformName();
}
void
ResetScreensaver()
{
qDebug() << "Can't reset screensaver for: " << getPlatformName();
}
#endif
}

View file

@ -12,5 +12,7 @@ void
updateAppImage();
QString
createTimestamp(int seconds);
void
ResetScreensaver();
}
#endif