| Summary: | linux: Don't simulate activity when not needed | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Bastien Nocera <bugzilla> |
| Component: | main | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus |
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | 0001-linux-Don-t-simulate-activity-when-not-needed.patch | ||
Something like this patch is now https://hg.libsdl.org/SDL/rev/5959fcbe6dfe, thanks! --ryan. This function doesn't exist, why try to call it?
1.13 + SDL_DBus_CallVoidMethod("org.freedesktop.ScreenSaver", "/org/freedesktop/ScreenSaver", "org.freedesktop.ScreenSaver", "SimulateUserActivity", DBUS_TYPE_INVALID);
(In reply to Bastien Nocera from comment #2) > This function doesn't exist, why try to call it? > > 1.13 + SDL_DBus_CallVoidMethod("org.freedesktop.ScreenSaver", > "/org/freedesktop/ScreenSaver", "org.freedesktop.ScreenSaver", > "SimulateUserActivity", DBUS_TYPE_INVALID); It exists here, with Gnome in Ubuntu 16.04: [icculus@taise ~]$ qdbus org.freedesktop.ScreenSaver /org/freedesktop/ScreenSaver |grep Simulate method void org.freedesktop.ScreenSaver.SimulateUserActivity() But specifically, this is the interface KDE prefers, apparently. --ryan. (In reply to Ryan C. Gordon from comment #3) > (In reply to Bastien Nocera from comment #2) > > This function doesn't exist, why try to call it? > > > > 1.13 + SDL_DBus_CallVoidMethod("org.freedesktop.ScreenSaver", > > "/org/freedesktop/ScreenSaver", "org.freedesktop.ScreenSaver", > > "SimulateUserActivity", DBUS_TYPE_INVALID); > > It exists here, with Gnome in Ubuntu 16.04: > > [icculus@taise ~]$ qdbus org.freedesktop.ScreenSaver > /org/freedesktop/ScreenSaver |grep Simulate > method void org.freedesktop.ScreenSaver.SimulateUserActivity() > > But specifically, this is the interface KDE prefers, apparently. This is a bug/regression in KDE. The interface below was based on an implementation that was already done in KDE, and for which I wrote the GNOME implementation: https://specifications.freedesktop.org/idle-inhibit-spec/latest/re01.html (In reply to Bastien Nocera from comment #4) > (In reply to Ryan C. Gordon from comment #3) > > (In reply to Bastien Nocera from comment #2) > > > This function doesn't exist, why try to call it? > > > > > > 1.13 + SDL_DBus_CallVoidMethod("org.freedesktop.ScreenSaver", > > > "/org/freedesktop/ScreenSaver", "org.freedesktop.ScreenSaver", > > > "SimulateUserActivity", DBUS_TYPE_INVALID); > > > > It exists here, with Gnome in Ubuntu 16.04: > > > > [icculus@taise ~]$ qdbus org.freedesktop.ScreenSaver > > /org/freedesktop/ScreenSaver |grep Simulate > > method void org.freedesktop.ScreenSaver.SimulateUserActivity() > > > > But specifically, this is the interface KDE prefers, apparently. That doesn't seem to be the case. kscreenlocker is the "locker" used in Plasma, and it's supported the Inhibit interface for a number of years. The Inhibit interface is better than making "poke" D-Bus calls in the mainloop. This is the kscreenlocker D-Bus interface: https://github.com/KDE/kscreenlocker/blob/5824f086faa68a4b38930b180b33a8f95d0b6739/dbus/org.freedesktop.ScreenSaver.xml#L24 which looks like it's implemented here: https://github.com/KDE/kscreenlocker/blob/master/interface.cpp#L122 It relies on powerdevil being installed, but that's a core component of the desktop. |
Created attachment 3853 [details] 0001-linux-Don-t-simulate-activity-when-not-needed.patch There's no need to simulate activity when we already hold a cookie for an ongoing inhibition, best thing it can do is wake up the screensaver proxy for it to return a missing method error on anything newer than a GNOME 2 clone.