diff options
| author | SND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-07-26 09:59:05 +0000 |
|---|---|---|
| committer | SND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-07-26 09:59:05 +0000 |
| commit | 13e08db872f4775ca23df12fcc03f1916ed9691e (patch) | |
| tree | c66601f85caab2ad0f7b78f3d4973d1fa9b1ae81 /gui | |
| parent | 6131285e0c96333cf10b7257441e54caae661cdf (diff) | |
| download | pcsxr-13e08db872f4775ca23df12fcc03f1916ed9691e.tar.gz | |
GTK/dfinput: added "prevent screensaver" feature. Makes ugly call to xdg-screensaver script which seems to be only sopisticated way of handling multiple screensaver backends.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86254 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'gui')
| -rwxr-xr-x | gui/GtkGui.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gui/GtkGui.c b/gui/GtkGui.c index 1bb66c7c..f0a2125b 100755 --- a/gui/GtkGui.c +++ b/gui/GtkGui.c @@ -457,6 +457,29 @@ void OnDestroy() { } void destroy_main_window () { +#ifdef DISABLE_GNOME_SCREENSAVER + // Disable GNOME screensaver + int response_token = 0; + GError *error; + GDBusProxy *proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, NULL, + "org.gnome.ScreenSaver", + "org/gnome/ScreenSaver", + "org.gnome.ScreenSaver", + NULL, &error); + + GVariant *retval = g_dbus_proxy_call_sync (proxy, + "Inhibit", + g_variant_new ("(ssu)", "PCSXR", + "Emulating", + response_token), + G_DBUS_CALL_FLAGS_NONE, + 2, /* timeout */ + NULL, /* cancellable */ + &error); + printf("Response %i\n", response_token); +#endif + destroy = 1; gtk_widget_destroy(Window); Window = NULL; |
