Procházet zdrojové kódy

Experiment with dbus screensaver inhibition

Since Gnome is ignoring my InHibit request

Change-Id: I122e5050078eacc1b181880cd0bbe112d1c4d15f
Donald Carr před 8 roky
rodič
revize
84c3fcbb3e
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  1. 2 0
      src/main.cpp

+ 2 - 0
src/main.cpp

@@ -95,9 +95,11 @@ int main(int argc, char *argv[])
     if (settings.value("suppressScreensaver", false).toBool()) {
         QDBusInterface screenSaver("org.freedesktop.ScreenSaver", "/org/freedesktop/ScreenSaver");
         uint id = screenSaver.call("Inhibit", app.applicationName(), "Media playback").arguments().at(0).toInt();
+        screenSaver.call("SetActive", true);
         QObject::connect(&app, &QCoreApplication::aboutToQuit, [id]() {
             QDBusInterface screenSaver("org.freedesktop.ScreenSaver", "/org/freedesktop/ScreenSaver");
             screenSaver.call("UnInhibit", id);
+            screenSaver.call("SetActive", false);
         });
     }