GithubHelp home page GithubHelp logo

Comments (4)

pevers avatar pevers commented on May 19, 2024

Hi @StT191 , thanks for your report!

Is the library working for you on KDE? It is hard for me to test this on Linux KDE as I'm using a M1 MacBook to compile and run everything. I used the Chromium source code as inspiration. But it seems there are some issues with Chromium screen locks and KDE as well.

Can you check if the D-Bus interface is actually there for your desktop?

I found some issues that might be related:

from nosleep.

StT191 avatar StT191 commented on May 19, 2024

Hi @pevers,
the D-Bus interface is definitively there. The reported error actually occurs at nosleep.stop(). I was also able to use your crate successfully for its intended purpose. I just ignore the errors on stop.

All the tests from the nosleep-nix sub-crate pass, except tests::test_start which fails with the same error.

I also recorded the dbus-monitor log during the test-run. It might help with debugging:

method call time=1668875736.161333 sender=:1.90 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1668875736.161344 sender=org.freedesktop.DBus -> destination=:1.90 serial=1 reply_serial=1
   string ":1.90"
signal time=1668875736.161364 sender=org.freedesktop.DBus -> destination=(null destination) serial=129 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.90"
   string ""
   string ":1.90"
signal time=1668875736.161393 sender=org.freedesktop.DBus -> destination=:1.90 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.90"
method call time=1668875736.161768 sender=:1.90 -> destination=org.gnome.SessionManager serial=2 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=Inhibit
   string "org.powersaveblocker.app"
   uint32 0
   string "Power Save Blocker"
   uint32 12
error time=1668875736.161786 sender=org.freedesktop.DBus -> destination=:1.90 error_name=org.freedesktop.DBus.Error.ServiceUnknown reply_serial=2
   string "The name org.gnome.SessionManager was not provided by any .service files"
method call time=1668875736.161816 sender=:1.90 -> destination=org.freedesktop.ScreenSaver serial=3 path=/org/freedesktop/ScreenSaver; interface=org.freedesktop.ScreenSaver; member=Inhibit
   string "org.powersaveblocker.app"
   string "Power Save Blocker"
method call time=1668875736.162109 sender=:1.10 -> destination=org.kde.Solid.PowerManagement.PolicyAgent serial=149 path=/org/kde/Solid/PowerManagement/PolicyAgent; interface=org.kde.Solid.PowerManagement.PolicyAgent; member=AddInhibition
   uint32 4
   string "org.powersaveblocker.app"
   string "Power Save Blocker"
method call time=1668875736.162319 sender=:1.21 -> destination=org.freedesktop.DBus serial=228 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.10',arg2=''"
method return time=1668875736.162359 sender=:1.21 -> destination=:1.10 serial=229 reply_serial=149
   uint32 21
method call time=1668875736.162478 sender=:1.10 -> destination=org.freedesktop.DBus serial=150 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.90',arg2=''"
method return time=1668875736.162513 sender=:1.10 -> destination=:1.90 serial=151 reply_serial=3
   uint32 3558
method call time=1668875736.162625 sender=:1.90 -> destination=org.freedesktop.PowerManagement serial=4 path=/org/freedesktop/PowerManagement/Inhibit; interface=org.freedesktop.PowerManagement.Inhibit; member=Inhibit
   string "org.powersaveblocker.app"
   string "Power Save Blocker"
method call time=1668875736.162773 sender=:1.21 -> destination=org.freedesktop.DBus serial=230 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.90',arg2=''"
method return time=1668875736.162792 sender=:1.21 -> destination=:1.90 serial=231 reply_serial=4
   uint32 22
method call time=1668875736.463340 sender=:1.90 -> destination=org.freedesktop.ScreenSaver serial=5 path=/org/freedesktop/ScreenSaver; interface=org.freedesktop.ScreenSaver; member=UnInhibit
   uint32 3558
method call time=1668875736.464292 sender=:1.10 -> destination=org.kde.Solid.PowerManagement.PolicyAgent serial=152 path=/org/kde/Solid/PowerManagement/PolicyAgent; interface=org.kde.Solid.PowerManagement.PolicyAgent; member=ReleaseInhibition
   uint32 21
method return time=1668875736.464405 sender=:1.10 -> destination=:1.90 serial=153 reply_serial=5
method call time=1668875736.464823 sender=:1.90 -> destination=org.freedesktop.PowerManagement serial=6 path=/org/freedesktop/PowerManagement/Inhibit; interface=org.freedesktop.PowerManagment.Inhibit; member=UnInhibit
   uint32 22
method call time=1668875736.465008 sender=:1.21 -> destination=org.freedesktop.DBus serial=232 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.10',arg2=''"
method return time=1668875736.465110 sender=:1.21 -> destination=:1.10 serial=233 reply_serial=152
error time=1668875736.465270 sender=:1.21 -> destination=:1.90 error_name=org.freedesktop.DBus.Error.UnknownInterface reply_serial=6
   string "No such interface 'org.freedesktop.PowerManagment.Inhibit' at object path '/org/freedesktop/PowerManagement/Inhibit'"
signal time=1668875736.466872 sender=org.freedesktop.DBus -> destination=:1.90 serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.90"
signal time=1668875736.466994 sender=org.freedesktop.DBus -> destination=(null destination) serial=45 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.90"
   string ":1.90"
   string ""
method call time=1668875736.467137 sender=:1.21 -> destination=org.freedesktop.DBus serial=235 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.90',arg2=''"
method call time=1668875736.467179 sender=:1.10 -> destination=org.freedesktop.DBus serial=154 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.90',arg2=''"

from nosleep.

pevers avatar pevers commented on May 19, 2024

org.freedesktop.ScreenSaver

Hi @StT191 , that's very helpful!

I think I've spotted the mistake:

DBusAPI::FreeDesktopPowerApi => dbus::Message::call_with_args(
    "org.freedesktop.PowerManagement",
    "/org/freedesktop/PowerManagement/Inhibit",
    "org.freedesktop.PowerManagment.Inhibit",
    "UnInhibit",
    (handle,),
),

PowerManagment , doh . Took me a while to find the mistake haha. Thank you so much for your report and I'll file a PR to fix it.

from nosleep.

pevers avatar pevers commented on May 19, 2024

Hi @StT191 , I published a new version of the crate that should fix this. Thanks again for reporting this.

from nosleep.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.