diff --git a/src/sj-extracting.c b/src/sj-extracting.c index e44a589..b7118b1 100644 --- a/src/sj-extracting.c +++ b/src/sj-extracting.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -821,7 +822,8 @@ on_extract_activate (GtkWidget *button, gpointer user_data) } cookie = sj_inhibit (g_get_application_name (), - _("Extracting audio from CD")); + _("Extracting audio from CD"), + GDK_WINDOW_XID(main_window->window)); /* Save the genre */ save_genre (genre_entry); diff --git a/src/sj-inhibit.c b/src/sj-inhibit.c index 7fc60e0..fc804d2 100644 --- a/src/sj-inhibit.c +++ b/src/sj-inhibit.c @@ -26,13 +26,13 @@ #include "sj-inhibit.h" /* PowerManagent defines */ -#define PM_DBUS_SERVICE "org.freedesktop.PowerManagement" -#define PM_DBUS_INHIBIT_PATH "/org/freedesktop/PowerManagement/Inhibit" -#define PM_DBUS_INHIBIT_INTERFACE "org.freedesktop.PowerManagement.Inhibit" +#define PM_DBUS_SERVICE "org.gnome.SessionManager" +#define PM_DBUS_INHIBIT_PATH "/org/gnome/SessionManager" +#define PM_DBUS_INHIBIT_INTERFACE "org.gnome.SessionManager" /** cookie is returned as an unsigned integer */ guint -sj_inhibit (const gchar * appname, const gchar * reason) +sj_inhibit (const gchar * appname, const gchar * reason, guint xid) { gboolean res; guint cookie; @@ -60,8 +60,10 @@ sj_inhibit (const gchar * appname, const gchar * reason) res = dbus_g_proxy_call (proxy, "Inhibit", &error, - G_TYPE_STRING, appname, + G_TYPE_STRING, appname, /* app-id */ + G_TYPE_UINT, xid, G_TYPE_STRING, reason, + G_TYPE_UINT, 4+8, /* flags, inhibit being marked idle and allowing suspend */ G_TYPE_INVALID, G_TYPE_UINT, &cookie, G_TYPE_INVALID); @@ -116,7 +118,7 @@ sj_uninhibit (guint cookie) } res = dbus_g_proxy_call (proxy, - "UnInhibit", + "Uninhibit", &error, G_TYPE_UINT, cookie, G_TYPE_INVALID, @@ -124,7 +126,7 @@ sj_uninhibit (guint cookie) /* check the return value */ if (!res) { - g_warning ("UnInhibit method failed"); + g_warning ("Uninhibit method failed"); } /* check the error value */ diff --git a/src/sj-inhibit.h b/src/sj-inhibit.h index b93fbf9..3498cfe 100644 --- a/src/sj-inhibit.h +++ b/src/sj-inhibit.h @@ -25,7 +25,7 @@ #include -guint sj_inhibit (const gchar * appname, const gchar * reason); +guint sj_inhibit (const gchar * appname, const gchar * reason, guint xid); void sj_uninhibit (guint cookie); #endif /* SJ_INHIBIT_H */