Changeset 9645


Ignore:
Timestamp:
Dec 1, 2009, 4:22:14 AM (12 years ago)
Author:
charles
Message:

(trunk gtk) #2324 "power management inhibition with gnome-session >= 2.26" -- fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-core.c

    r9635 r9645  
    11041104        return;
    11051105
    1106 g_message( "filename [%s]", filename );
    11071106    if( gtr_is_supported_url( filename ) || gtr_is_magnet_link( filename ) )
    11081107    {
     
    13191318get_hibernation_inhibit_proxy( void )
    13201319{
    1321     GError *          error = NULL;
    13221320    DBusGConnection * conn;
     1321    GError * error = NULL;
     1322    const char * name = "org.gnome.SessionManager";
     1323    const char * path = "/org/gnome/SessionManager";
     1324    const char * interface = "org.gnome.SessionManager";
    13231325
    13241326    conn = dbus_g_bus_get( DBUS_BUS_SESSION, &error );
     
    13301332    }
    13311333
    1332     return dbus_g_proxy_new_for_name (
    1333                conn,
    1334                "org.freedesktop.PowerManagement",
    1335                "/org/freedesktop/PowerManagement/Inhibit",
    1336                "org.freedesktop.PowerManagement.Inhibit" );
     1334    return dbus_g_proxy_new_for_name ( conn, name, path, interface );
    13371335}
    13381336
     
    13451343    if( proxy )
    13461344    {
    1347         GError *     error = NULL;
     1345        GError * error = NULL;
     1346        const int toplevel_xid = 0;
    13481347        const char * application = _( "Transmission Bittorrent Client" );
    13491348        const char * reason = _( "BitTorrent Activity" );
     1349        const int flags = 8; /* Inhibit the session being marked as idle */
     1350
    13501351        success = dbus_g_proxy_call( proxy, "Inhibit", &error,
    13511352                                     G_TYPE_STRING, application,
     1353                                     G_TYPE_UINT, toplevel_xid,
    13521354                                     G_TYPE_STRING, reason,
    1353                                      G_TYPE_INVALID,
     1355                                     G_TYPE_UINT, flags,
     1356                                     G_TYPE_INVALID, /* sentinel - end of input args */
    13541357                                     G_TYPE_UINT, cookie,
    1355                                      G_TYPE_INVALID );
     1358                                     G_TYPE_INVALID /* senitnel - end of output args */ );
    13561359        if( success )
    13571360            tr_inf( "%s", _( "Disallowing desktop hibernation" ) );
     
    13771380    {
    13781381        GError * error = NULL;
    1379         gboolean success = dbus_g_proxy_call( proxy, "UnInhibit", &error,
     1382        gboolean success = dbus_g_proxy_call( proxy, "Uninhibit", &error,
    13801383                                              G_TYPE_UINT, inhibit_cookie,
    13811384                                              G_TYPE_INVALID,
Note: See TracChangeset for help on using the changeset viewer.