[Backend/Utils] Added screensaver resetting whilst playing.
This commit is contained in:
parent
bd41d19d24
commit
d5f4ab408f
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
}
|
|
@ -12,5 +12,7 @@ void
|
|||
updateAppImage();
|
||||
QString
|
||||
createTimestamp(int seconds);
|
||||
void
|
||||
ResetScreensaver();
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue