Index: gdm.c
===================================================================
--- gdm.c	(revision 6226)
+++ gdm.c	(working copy)
@@ -919,9 +919,9 @@
 	}
 
 	/* null all these, they are not valid most definately */
-	d->servpid = 0;
-	d->sesspid = 0;
-	d->greetpid = 0;
+	d->servpid    = 0;
+	d->sesspid    = 0;
+	d->greetpid   = 0;
 	d->chooserpid = 0;
 
 	/* definately not logged in now */
@@ -933,31 +933,55 @@
 	d->slavepid = 0;
 	d->dispstat = DISPLAY_DEAD;
 
-	sysmenu = gdm_daemon_config_get_value_bool_per_display (GDM_KEY_SYSTEM_MENU, d->name);
+	if (status == DISPLAY_RESTARTGDM ||
+	    status == DISPLAY_REBOOT     ||
+	    status == DISPLAY_SUSPEND    ||
+	    status == DISPLAY_HALT) {
+		/*
+		 * Reset status to DISPLAY_REMANAGE if it is not valid to perform
+		 * the operation
+		 */
+		sysmenu = gdm_daemon_config_get_value_bool_per_display (GDM_KEY_SYSTEM_MENU, d->name);
 
-	if ( ! sysmenu &&
-	     (status == DISPLAY_RESTARTGDM ||
-	      status == DISPLAY_REBOOT ||
-	      status == DISPLAY_SUSPEND ||
-	      status == DISPLAY_HALT)) {
-		gdm_info (_("Restart GDM, Restart machine, Suspend, or Halt request when there is no system menu from display %s"), d->name);
-		status = DISPLAY_REMANAGE;
-	}
+		if (!sysmenu) {
+			gdm_info (_("Restart GDM, Restart machine, Suspend, or Halt request when there is no system menu from display %s"), d->name);
+			status = DISPLAY_REMANAGE;
+		}
 
-	if ( ! d->attached &&
-	     (status == DISPLAY_RESTARTGDM ||
-	      status == DISPLAY_REBOOT ||
-	      status == DISPLAY_SUSPEND ||
-	      status == DISPLAY_HALT)) {
-		gdm_info (_("Restart GDM, Restart machine, Suspend or Halt request from a non-static display %s"), d->name);
-		status = DISPLAY_REMANAGE;
+
+		if ( ! d->attached) {
+			gdm_info (_("Restart GDM, Restart machine, Suspend or Halt request from a non-static display %s"), d->name);
+			status = DISPLAY_REMANAGE;
+		}
+
+		/* checkout if we can actually do stuff */
+		switch (status) {
+		case DISPLAY_REBOOT:
+			if (gdm_daemon_config_get_value_string_array (GDM_KEY_REBOOT) == NULL)
+				status = DISPLAY_REMANAGE;
+			break;
+		case DISPLAY_HALT:
+			if (gdm_daemon_config_get_value_string_array (GDM_KEY_HALT) == NULL)
+				status = DISPLAY_REMANAGE;
+			break;
+		case DISPLAY_SUSPEND:
+			if (gdm_daemon_config_get_value_string_array (GDM_KEY_SUSPEND) == NULL)
+				status = DISPLAY_REMANAGE;
+			break;
+		default:
+			break;
+		}
 	}
 
 	if (status == DISPLAY_RUN_CHOOSER) {
-		/* use the chooser on the next run (but only if allowed) */
+		sysmenu = gdm_daemon_config_get_value_bool_per_display (GDM_KEY_SYSTEM_MENU, d->name);
+
+		/* Use the chooser on the next run (but only if allowed) */
 		if (sysmenu &&
-		    gdm_daemon_config_get_value_bool_per_display (GDM_KEY_CHOOSER_BUTTON, d->name))
+		    gdm_daemon_config_get_value_bool_per_display (GDM_KEY_CHOOSER_BUTTON, d->name)) {
 			d->use_chooser = TRUE;
+		}
+
 		status = DISPLAY_REMANAGE;
 		/* go around the display loop detection, these are short
 		 * sessions, so this decreases the chances of the loop
@@ -985,24 +1009,6 @@
 		d->try_different_greeter = FALSE;
 	}
 
-	/* checkout if we can actually do stuff */
-	switch (status) {
-	case DISPLAY_REBOOT:
-		if (gdm_daemon_config_get_value_string_array (GDM_KEY_REBOOT) == NULL)
-			status = DISPLAY_REMANAGE;
-		break;
-	case DISPLAY_HALT:
-		if (gdm_daemon_config_get_value_string_array (GDM_KEY_HALT) == NULL)
-			status = DISPLAY_REMANAGE;
-		break;
-	case DISPLAY_SUSPEND:
-		if (gdm_daemon_config_get_value_string_array (GDM_KEY_SUSPEND) == NULL)
-			status = DISPLAY_REMANAGE;
-		break;
-	default:
-		break;
-	}
-
 	/* if we crashed clear the theme */
 	if (crashed) {
 		g_free (d->theme_name);
