--- lxsession-logout.c~ 2011-08-30 01:05:54.000000000 +0400 +++ lxsession-logout.c 2012-01-16 16:08:45.391131299 +0400 @@ -75,7 +75,7 @@ typedef struct { } HandlerContext; static gboolean lock_screen(void); -static gboolean verify_running(const char * display_manager, const char * executable); +static gboolean verify_running(const char * display_manager, const char * executable, const char * proc_dm = NULL); static void logout_clicked(GtkButton * button, HandlerContext * handler_context); static void change_root_property(GtkWidget* w, const char* prop_name, const char* value); static void shutdown_clicked(GtkButton * button, HandlerContext * handler_context); @@ -101,7 +101,7 @@ static gboolean lock_screen(void) } /* Verify that a program is running and that an executable is available. */ -static gboolean verify_running(const char * display_manager, const char * executable) +static gboolean verify_running(const char * display_manager, const char * executable, const char * proc_dm) { /* See if the executable we need to run is in the path. */ gchar * full_path = g_find_program_in_path(executable); @@ -144,8 +144,14 @@ static gboolean verify_running(const cha /* Null terminate the buffer and look for the display manager name in the command. * If found, return success. */ buffer[length] = '\0'; - if (strstr(buffer, display_manager) != NULL) - return TRUE; + if( proc_dm != NULL ) + { + if (strstr(buffer, proc_dm) != NULL) + return TRUE; + } else { + if (strstr(buffer, display_manager) != NULL) + return TRUE; + } } } } @@ -450,7 +456,7 @@ int main(int argc, char * argv[]) } /* If we are under KDM, its "Switch User" is available. */ - if (verify_running("kdm", "kdmctl")) + if (verify_running("xdm", "kdmctl", "kdm")) { handler_context.switch_user_available = TRUE; handler_context.switch_user_KDM = TRUE;