#include #include #include #include static XfceSMClient *sm_client = NULL; static gboolean session_die(gpointer user_data) { sleep (2000); // gtk_main_quit(); return FALSE; } int main(int argc, char **argv) { GError *error = NULL; g_type_init(); sm_client = xfce_sm_client_get(); xfce_sm_client_set_restart_style(sm_client, XFCE_SM_CLIENT_RESTART_IMMEDIATELY); xfce_sm_client_set_priority(sm_client, XFCE_SM_CLIENT_PRIORITY_DESKTOP); g_set_prgname("xfce4-lliurexin"); g_signal_connect(sm_client, "quit-requested", G_CALLBACK(session_die), NULL); if(!xfce_sm_client_connect(sm_client, &error) && error) { g_printerr("Failed to connect to session manager: %s\n", error->message); g_clear_error(&error); } gtk_main(); return 0; }