~larsu/notify-osd/lp1319983

« back to all changes in this revision

Viewing changes to src/main.c

Watch "NameLost" signal on DBus and exit if received.

Approved by Lars Uebernickel, Michał Sawicz, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
                return 0;
71
71
        }
72
72
 
 
73
        DBusGProxy* proxy = dbus_g_proxy_new_for_name (connection,
 
74
                                                       "org.freedesktop.DBus",
 
75
                                                       "/org/freedesktop/DBus",
 
76
                                                       "org.freedesktop.DBus");
 
77
 
 
78
        dbus_g_proxy_add_signal (proxy, "NameLost", G_TYPE_STRING, G_TYPE_INVALID);
 
79
        dbus_g_proxy_connect_signal (proxy,
 
80
                                     "NameLost",
 
81
                                     gtk_main_quit,
 
82
                                     NULL,
 
83
                                     NULL);
 
84
 
73
85
        dbus_g_connection_register_g_object (connection,
74
86
                                             DBUS_PATH,
75
87
                                             G_OBJECT (stack));
77
89
        gtk_main ();
78
90
 
79
91
        stack_del (stack);
 
92
        g_object_unref (proxy);
80
93
 
81
94
        return 0;
82
95
}