diff --git a/src/DirectMpvPlayerBackend.cpp b/src/DirectMpvPlayerBackend.cpp index 0ea1086..0102614 100644 --- a/src/DirectMpvPlayerBackend.cpp +++ b/src/DirectMpvPlayerBackend.cpp @@ -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) { diff --git a/src/MpvPlayerBackend.cpp b/src/MpvPlayerBackend.cpp index f903017..1093cd9 100644 --- a/src/MpvPlayerBackend.cpp +++ b/src/MpvPlayerBackend.cpp @@ -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) { diff --git a/src/utils.cpp b/src/utils.cpp index 41ae9d5..18b6e9e 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -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 } \ No newline at end of file diff --git a/src/utils.hpp b/src/utils.hpp index e820b00..29a42b7 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -12,5 +12,7 @@ void updateAppImage(); QString createTimestamp(int seconds); +void +ResetScreensaver(); } #endif