--- gdm-2.16.0/configure.org	2006-09-20 11:55:52.000000000 +0100
+++ gdm-2.16.0/configure	2006-09-19 15:02:52.000000000 +0100
@@ -985,6 +985,7 @@
 XEVIE_OPTION
 HALT_COMMAND
 REBOOT_COMMAND
+WINDOWS_COMMAND
 SUSPEND_COMMAND
 XSESSION_SHELL
 GDM_USER_PATH
@@ -33828,6 +33829,7 @@
         GDM_USER_PATH="/usr/bin"
         HALT_COMMAND="/sbin/init 5"
         REBOOT_COMMAND="/sbin/init 6"
+	WINDOWS_COMMAND="/sbin/init 6"
         SUSPEND_COMMAND="/usr/openwin/bin/sys-suspend -n"
         XSESSION_SHELL=/bin/ksh
         SOUND_PROGRAM=/usr/bin/audioplay
@@ -33836,6 +33838,7 @@
 	GDM_USER_PATH="/bin:/usr/bin"
 	HALT_COMMAND="/sbin/shutdown -p now;/usr/sbin/shutdown -p now"
 	REBOOT_COMMAND="/sbin/shutdown -r now;/usr/sbin/shutdown -r now"
+	WINDOWS_COMMAND="/usr/local/sbin/rebootwin;/usr/bin/rebootwin;/sbin/rebootwin;/usr/local/bin/rebootwin"
 	SUSPEND_COMMAND="/usr/sbin/zzz"
 	XSESSION_SHELL=/bin/sh
 	SOUND_PROGRAM=
@@ -33844,6 +33847,7 @@
         GDM_USER_PATH="/bin:/usr/bin"
         HALT_COMMAND="/usr/bin/poweroff;/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shutdown -h now"
         REBOOT_COMMAND="/usr/bin/reboot;/sbin/reboot;/sbin/shutdown -r now;/usr/sbin/shutdown -r now"
+	WINDOWS_COMMAND="/usr/local/sbin/rebootwin;/usr/bin/rebootwin;/sbin/rebootwin;/usr/local/bin/rebootwin"
         SUSPEND_COMMAND=""
         XSESSION_SHELL=/bin/sh
         SOUND_PROGRAM=/usr/bin/play
@@ -33950,6 +33954,9 @@
 #define REBOOT_COMMAND "$REBOOT_COMMAND"
 _ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define WINDOWS_COMMAND "$WINDOWS_COMMAND"
+_ACEOF
 
 cat >>confdefs.h <<_ACEOF
 #define SUSPEND_COMMAND "$SUSPEND_COMMAND"
--- gdm-2.16.0/daemon/gdm.c.org	2006-09-20 11:57:54.000000000 +0100
+++ gdm-2.16.0/daemon/gdm.c	2006-09-20 16:36:55.000000000 +0100
@@ -714,6 +714,28 @@
 		   "gdm_child_action", strerror (errno));
 }
 
+/*Added by Lukas for windows thingy*/
+static void
+restart_machine_windows (void)
+{
+	char **argv;
+
+	gdm_info (_("Restarting computer into windows..."));
+
+	gdm_final_cleanup ();
+	VE_IGNORE_EINTR (g_chdir ("/"));
+
+#ifdef __linux__
+	change_to_first_and_clear (TRUE);
+#endif /* __linux */
+
+	argv = ve_split (gdm_get_value_string (GDM_KEY_WINDOWS));
+	if (argv != NULL && argv[0] != NULL)
+		VE_IGNORE_EINTR (execv (argv[0], argv));
+
+	gdm_error (_("%s: Restart into Windows failed: %s"), 
+		   "gdm_child_action", strerror (errno));
+}
 
 static gboolean 
 gdm_cleanup_children (void)
@@ -815,6 +837,7 @@
     if ( ! sysmenu &&
 	(status == DISPLAY_RESTARTGDM ||
 	 status == DISPLAY_REBOOT ||
+	 status == DISPLAY_WINDOWS || //Added by Lukas
 	 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);
@@ -824,6 +847,7 @@
     if ( ! d->attached &&
 	(status == DISPLAY_RESTARTGDM ||
 	 status == DISPLAY_REBOOT ||
+	 status == DISPLAY_WINDOWS || //Added by Lukas
 	 status == DISPLAY_SUSPEND ||
 	 status == DISPLAY_HALT)) {
 	    gdm_info (_("Restart GDM, Restart machine, Suspend or Halt request from a non-static display %s"), d->name);
@@ -868,6 +892,10 @@
 	    if (gdm_get_value_string (GDM_KEY_REBOOT) == NULL)
 		    status = DISPLAY_REMANAGE;
 	    break;
+    case DISPLAY_WINDOWS://Added by Lukas
+	    if (gdm_get_value_string (GDM_KEY_WINDOWS) == NULL)
+		    status = DISPLAY_REMANAGE;
+	    break;
     case DISPLAY_HALT:
 	    if (gdm_get_value_string (GDM_KEY_HALT) == NULL)
 		    status = DISPLAY_REMANAGE;
@@ -911,6 +939,13 @@
 	goto start_autopsy;
 	break;
 	
+    case DISPLAY_WINDOWS:       /* Restart machine to windows - added by Lukas*/	
+	restart_machine_windows ();
+
+	status = DISPLAY_REMANAGE;
+	goto start_autopsy;
+	break;
+
     case DISPLAY_HALT:		/* Halt machine */
 	halt_machine ();
 
@@ -1081,6 +1116,10 @@
 		restart_machine ();
 		break;
 
+	case GDM_LOGOUT_ACTION_WINDOWS://added by Lukas
+	       restart_machine_windows ();
+		break;
+
 	case GDM_LOGOUT_ACTION_SUSPEND:
 		suspend_machine ();
 		break;
@@ -3275,6 +3314,13 @@
 			sep = ";";
 		}
 		if (sysmenu && disp->attached &&
+		    ! ve_string_empty (gdm_get_value_string (GDM_KEY_WINDOWS))) {//Added by Lukas
+			g_string_append_printf (msg, "%s%s", sep, GDM_SUP_LOGOUT_ACTION_WINDOWS);
+			if (logout_action == GDM_LOGOUT_ACTION_WINDOWS)
+				g_string_append (msg, "!");
+			sep = ";";
+		}
+		if (sysmenu && disp->attached &&
 		    ! ve_string_empty (gdm_get_value_string (GDM_KEY_SUSPEND))) {
 			g_string_append_printf (msg, "%s%s", sep, GDM_SUP_LOGOUT_ACTION_SUSPEND);
 			if (logout_action == GDM_LOGOUT_ACTION_SUSPEND)
@@ -3323,6 +3369,13 @@
 					GDM_LOGOUT_ACTION_REBOOT;
 				was_ok = TRUE;
 			}
+		} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_WINDOWS) == 0) {//added by Lukas
+			if (sysmenu && disp->attached &&
+			    ! ve_string_empty (gdm_get_value_string (GDM_KEY_WINDOWS))) {
+				disp->logout_action =
+					GDM_LOGOUT_ACTION_WINDOWS;
+				was_ok = TRUE;
+			}
 		} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_SUSPEND) == 0) {
 			if (sysmenu && disp->attached &&
 			    ! ve_string_empty (gdm_get_value_string (GDM_KEY_SUSPEND))) {
@@ -3376,6 +3429,13 @@
 					GDM_LOGOUT_ACTION_REBOOT;
 				was_ok = TRUE;
 			}
+		} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_WINDOWS) == 0) {//added by Lukas
+		       if (sysmenu && disp->attached &&
+			    ! ve_string_empty (gdm_get_value_string (GDM_KEY_WINDOWS))) {
+				safe_logout_action =
+					GDM_LOGOUT_ACTION_WINDOWS;
+				was_ok = TRUE;
+			}
 		} else if (strcmp (action, GDM_SUP_LOGOUT_ACTION_SUSPEND) == 0) {
 			if (sysmenu && disp->attached &&
 			    ! ve_string_empty (gdm_get_value_string (GDM_KEY_SUSPEND))) {
--- gdm-2.16.0/daemon/gdmconfig.c.org	2006-09-20 16:42:36.000000000 +0100
+++ gdm-2.16.0/daemon/gdmconfig.c	2006-09-20 16:43:42.000000000 +0100
@@ -115,6 +115,7 @@
 static gchar *GdmXKeepsCrashing = NULL;
 static gchar *GdmHalt = NULL;
 static gchar *GdmReboot = NULL;
+static gchar *GdmWindows = NULL;//Added Lukas
 static gchar *GdmSuspend = NULL;
 static gchar *GdmServAuthDir = NULL;
 static gchar *GdmMulticastAddr;
@@ -438,6 +439,7 @@
    gdm_config_add_hash (GDM_KEY_AUTOMATIC_LOGIN, &GdmAutomaticLogin, &string_type);
    gdm_config_add_hash (GDM_KEY_GTK_MODULES_LIST, &GdmGtkModulesList, &string_type);
    gdm_config_add_hash (GDM_KEY_REBOOT, &GdmReboot, &string_type);
+   gdm_config_add_hash (GDM_KEY_WINDOWS, &GdmWindows, &string_type);//Added Lukas
    gdm_config_add_hash (GDM_KEY_HALT, &GdmHalt, &string_type);
    gdm_config_add_hash (GDM_KEY_SUSPEND, &GdmSuspend, &string_type);
    gdm_config_add_hash (GDM_KEY_LOG_DIR, &GdmLogDir, &string_type);
@@ -1079,6 +1081,7 @@
    /* Halt, Reboot, and Suspend commands */
    } else if (is_key (key, GDM_KEY_HALT) ||
               is_key (key, GDM_KEY_REBOOT) ||
+	      is_key (key, GDM_KEY_WINDOWS) ||//Added Lukas
               is_key (key, GDM_KEY_SUSPEND)) {
        if (value != NULL)
           *setting = ve_get_first_working_command (value, FALSE);
--- gdm-2.16.0/daemon/gdm.h.org	2006-09-20 11:58:04.000000000 +0100
+++ gdm-2.16.0/daemon/gdm.h	2006-09-19 14:02:31.000000000 +0100
@@ -71,6 +71,7 @@
 #define DISPLAY_SUSPEND 17	/* Suspend (don't use, use the interrupt) */
 #define DISPLAY_CHOSEN 20	/* successful chooser session,
 				   restart display */
+#define DISPLAY_WINDOWS 21        /* added by Lukas Windoze */
 #define DISPLAY_RUN_CHOOSER 30	/* Run chooser */
 #define DISPLAY_XFAILED 64	/* X failed */
 #define DISPLAY_GREETERFAILED 65 /* greeter failed (crashed) */
@@ -234,6 +235,7 @@
 #define GDM_KEY_FAILSAFE_XSERVER "daemon/FailsafeXServer="
 #define GDM_KEY_X_KEEPS_CRASHING "daemon/XKeepsCrashing=" GDMCONFDIR "/XKeepsCrashing"
 #define GDM_KEY_REBOOT  "daemon/RebootCommand=" REBOOT_COMMAND
+#define GDM_KEY_WINDOWS  "daemon/WindowsCommand=" WINDOWS_COMMAND //Added by Lukas
 #define GDM_KEY_ROOT_PATH "daemon/RootPath=/sbin:/usr/sbin:" GDM_USER_PATH
 #define GDM_KEY_SERV_AUTHDIR "daemon/ServAuthDir=" AUTHDIR
 #define GDM_KEY_SESSION_DESKTOP_DIR "daemon/SessionDesktopDir=/etc/X11/sessions/:" DMCONFDIR "/Sessions/:" DATADIR "/gdm/BuiltInSessions/:" DATADIR "/xsessions/"
@@ -437,6 +439,7 @@
 	GDM_LOGOUT_ACTION_NONE = 0,
 	GDM_LOGOUT_ACTION_HALT,
 	GDM_LOGOUT_ACTION_REBOOT,
+	GDM_LOGOUT_ACTION_WINDOWS,//Added by Lukas
 	GDM_LOGOUT_ACTION_SUSPEND,
 	GDM_LOGOUT_ACTION_LAST
 } GdmLogoutAction;
@@ -1199,6 +1202,7 @@
 #define GDM_SUP_LOGOUT_ACTION_NONE	"NONE"
 #define GDM_SUP_LOGOUT_ACTION_HALT	"HALT"
 #define GDM_SUP_LOGOUT_ACTION_REBOOT	"REBOOT"
+#define GDM_SUP_LOGOUT_ACTION_WINDOWS	"WINDOWS"//Added by Lukas
 #define GDM_SUP_LOGOUT_ACTION_SUSPEND	"SUSPEND"
 /*
  */
--- gdm-2.16.0/daemon/slave.c.org	2006-09-20 11:58:40.000000000 +0100
+++ gdm-2.16.0/daemon/slave.c	2006-09-19 14:05:31.000000000 +0100
@@ -4715,6 +4715,7 @@
 		if (WIFEXITED (status) &&
 		    (WEXITSTATUS (status) == DISPLAY_ABORT ||
 		     WEXITSTATUS (status) == DISPLAY_REBOOT ||
+		     WEXITSTATUS (status) == DISPLAY_WINDOWS || //added by Lukas
 		     WEXITSTATUS (status) == DISPLAY_HALT ||
 		     WEXITSTATUS (status) == DISPLAY_SUSPEND ||
 		     WEXITSTATUS (status) == DISPLAY_RUN_CHOOSER ||
--- gdm-2.16.0/gui/gdmlogin.c.org	2006-09-20 11:59:49.000000000 +0100
+++ gdm-2.16.0/gui/gdmlogin.c	2006-09-20 15:54:37.000000000 +0100
@@ -670,6 +670,20 @@
 	}
 }
 
+/*Lukas modified for windows thingy*/
+static void
+gdm_login_restart_windows_handler (void)
+{
+	if (gdm_wm_warn_dialog (
+	    _("Are you sure you want to restart the computer into Windows?"), "",
+	    _("_Restart"), NULL, TRUE) == GTK_RESPONSE_YES) {
+
+		closelog ();
+
+		gdm_kill_thingies ();
+		_exit (DISPLAY_WINDOWS);
+	}
+}
 
 static void
 gdm_login_halt_handler (void)
@@ -2390,6 +2404,16 @@
 		got_anything = TRUE;
 	}
 	
+	if (gdm_working_command_exists (gdm_config_get_string (GDM_KEY_WINDOWS))) {//added by Lukas for windows thingy
+		item = gtk_menu_item_new_with_mnemonic (_("Restart into _Windows"));
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+		g_signal_connect (G_OBJECT (item), "activate",
+				  G_CALLBACK (gdm_login_restart_windows_handler), 
+				  NULL);
+		gtk_widget_show (GTK_WIDGET (item));
+		got_anything = TRUE;
+	}
+
 	if (gdm_working_command_exists (gdm_config_get_string (GDM_KEY_HALT))) {
 		item = gtk_menu_item_new_with_mnemonic (_("Shut _Down"));
 		gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
@@ -2978,6 +3002,7 @@
         gdm_config_get_string (GDM_KEY_LOCALE_FILE);
 	gdm_config_get_string (GDM_KEY_LOGO);
         gdm_config_get_string (GDM_KEY_REBOOT);
+	gdm_config_get_string (GDM_KEY_WINDOWS);//Added by Lukas
         gdm_config_get_string (GDM_KEY_REMOTE_WELCOME);
 	gdm_config_get_string (GDM_KEY_SESSION_DESKTOP_DIR);
 	gdm_config_get_string (GDM_KEY_SOUND_PROGRAM);
@@ -3071,6 +3096,7 @@
 	    gdm_config_reload_string (GDM_KEY_INFO_MSG_FONT) ||
 	    gdm_config_reload_string (GDM_KEY_LOCALE_FILE) ||
 	    gdm_config_reload_string (GDM_KEY_REBOOT) ||
+	    gdm_config_reload_string (GDM_KEY_WINDOWS) || //Added by Lukas
 	    gdm_config_reload_string (GDM_KEY_SESSION_DESKTOP_DIR) ||
 	    gdm_config_reload_string (GDM_KEY_SUSPEND) ||
 	    gdm_config_reload_string (GDM_KEY_TIMED_LOGIN) ||
--- gdm-2.16.0/gui/greeter/greeter.c.org	2006-09-20 12:00:12.000000000 +0100
+++ gdm-2.16.0/gui/greeter/greeter.c	2006-09-19 14:32:18.000000000 +0100
@@ -70,6 +70,7 @@
 static gboolean ignore_buttons = FALSE;
 gboolean GdmHaltFound          = FALSE;
 gboolean GdmRebootFound        = FALSE;
+gboolean GdmWindowsFound       = FALSE;//added by Lukas
 gboolean GdmSuspendFound       = FALSE;
 gboolean GdmConfiguratorFound  = FALSE;
 
@@ -729,6 +730,7 @@
 	gdm_config_get_string (GDM_KEY_LOCALE_FILE);
 	gdm_config_get_string (GDM_KEY_HALT);
 	gdm_config_get_string (GDM_KEY_REBOOT);
+	gdm_config_get_string (GDM_KEY_WINDOWS);//added by Lukas
 	gdm_config_get_string (GDM_KEY_SUSPEND);
 	gdm_config_get_string (GDM_KEY_CONFIGURATOR);
 	gdm_config_get_string (GDM_KEY_INFO_MSG_FILE);
@@ -797,6 +799,7 @@
 	    gdm_config_reload_string (GDM_KEY_LOCALE_FILE) ||
 	    gdm_config_reload_string (GDM_KEY_HALT) ||
 	    gdm_config_reload_string (GDM_KEY_REBOOT) ||
+	    gdm_config_reload_string (GDM_KEY_WINDOWS) || //added by Lukas
 	    gdm_config_reload_string (GDM_KEY_SUSPEND) ||
 	    gdm_config_reload_string (GDM_KEY_CONFIGURATOR) ||
 	    gdm_config_reload_string (GDM_KEY_INFO_MSG_FILE) ||
@@ -1141,6 +1144,7 @@
   gdm_timed_delay      = gdm_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY);
   GdmHaltFound         = gdm_working_command_exists (gdm_config_get_string (GDM_KEY_HALT));
   GdmRebootFound       = gdm_working_command_exists (gdm_config_get_string (GDM_KEY_REBOOT));
+  GdmWindowsFound      = gdm_working_command_exists (gdm_config_get_string (GDM_KEY_WINDOWS));//Added by Lukas
   GdmSuspendFound      = gdm_working_command_exists (gdm_config_get_string (GDM_KEY_SUSPEND));
   GdmConfiguratorFound = gdm_working_command_exists (gdm_config_get_string (GDM_KEY_CONFIGURATOR));
 
--- gdm-2.16.0/gui/greeter/greeter_parser.c.org	2006-09-20 12:00:41.000000000 +0100
+++ gdm-2.16.0/gui/greeter/greeter_parser.c	2006-09-19 14:45:51.000000000 +0100
@@ -355,6 +355,11 @@
 	  g_free (*translated_text);
 	  *translated_text = g_strdup (_("_Restart"));
 	}
+      else if (g_ascii_strcasecmp ((char *) prop, "windows") == 0)//This else if has been added by Lukas 23.08.05
+        {
+	  g_free (*translated_text);
+	  *translated_text = g_strdup (_("_Windows"));
+	}
       else if (g_ascii_strcasecmp ((char *) prop, "chooser") == 0)
         {
 	  g_free (*translated_text);
--- gdm-2.16.0/gui/greeter/greeter_item.c.org	2006-09-20 14:14:32.000000000 +0100
+++ gdm-2.16.0/gui/greeter/greeter_item.c	2006-09-20 14:15:23.000000000 +0100
@@ -35,6 +35,7 @@
 
 extern gboolean GdmHaltFound;
 extern gboolean GdmRebootFound;
+extern gboolean GdmWindowsFound;//Added by Lukas
 extern gboolean GdmSuspendFound;
 extern gboolean GdmConfiguratorFound;
 
@@ -204,6 +205,10 @@
       (info->show_type != NULL &&
        strcmp (info->show_type, "reboot") == 0))
 	  return FALSE;
+  if (( ! sysmenu || ! GdmWindowsFound) &&
+      (info->show_type != NULL &&
+       strcmp (info->show_type, "windows") == 0))
+	  return FALSE;
   if (( ! sysmenu || ! GdmSuspendFound) &&
       (info->show_type != NULL &&
        strcmp (info->show_type, "suspend") == 0))
--- gdm-2.16.0/gui/greeter/greeter.dtd.org	2006-09-20 14:57:32.000000000 +0100
+++ gdm-2.16.0/gui/greeter/greeter.dtd	2006-09-20 14:58:06.000000000 +0100
@@ -19,7 +19,7 @@
 <!-- additional elements-->
 <!ELEMENT border EMPTY>
 
-<!-- internal id's are one of (user-pw-entry | caps-lock-warning | clock | pam-error | pam-message | pam-prompt | pam-warning | timed-label | language_button | disconnect_button | reboot_button | halt_button | session_button | suspend_button | system_button | config_button | chooser_button | userlist)
+<!-- internal id's are one of (user-pw-entry | caps-lock-warning | clock | pam-error | pam-message | pam-prompt | pam-warning | timed-label | language_button | disconnect_button | reboot_button | windows_button | halt_button | session_button | suspend_button | system_button | config_button | chooser_button | userlist)
      but there can be other id's -->
 <!ATTLIST item
 	type (rect | entry | pixmap | label | svg | rect | list) #REQUIRED
--- gdm-2.16.0/gui/greeter/greeter_system.c.org	2006-09-20 12:00:52.000000000 +0100
+++ gdm-2.16.0/gui/greeter/greeter_system.c	2006-09-20 15:59:34.000000000 +0100
@@ -39,6 +39,7 @@
 GtkWidget *dialog;
 extern gboolean GdmHaltFound;
 extern gboolean GdmRebootFound;
+extern gboolean GdmWindowsFound;//Added by Lukas
 extern gboolean GdmSuspendFound;
 extern gboolean GdmConfiguratorFound;
 
@@ -78,6 +79,18 @@
 	}
 }
 
+/*This has been modified by Lukas*/
+static void
+query_greeter_restart_windows_handler (void)
+{
+	if (gdm_wm_warn_dialog (_("Are you sure you want to restart the computer into Windows?"), "",
+			     _("_Restart"), NULL, TRUE) == GTK_RESPONSE_YES) {
+		closelog ();
+		
+		_exit (DISPLAY_WINDOWS);
+	}
+}
+
 static void
 query_greeter_halt_handler (void)
 {
@@ -107,6 +120,13 @@
 	_exit (DISPLAY_REBOOT);
 }
 
+/*Added by Lukas for win thingy*/
+static void
+greeter_restart_windows_handler (void)
+{
+	closelog ();
+	_exit (DISPLAY_WINDOWS);
+}
 
 static void
 greeter_halt_handler (void)
@@ -174,7 +194,7 @@
 				  NULL);
 	}
 
-	if (GdmRebootFound || GdmHaltFound || GdmSuspendFound) {
+	if (GdmRebootFound || GdmHaltFound || GdmSuspendFound || GdmWindowsFound) {//Added by Lukas
 		sep = gtk_separator_menu_item_new ();
 		gtk_menu_shell_append (GTK_MENU_SHELL (menu), sep);
 		gtk_widget_show (sep);
@@ -189,6 +209,15 @@
 				  NULL);
 	}
 
+	if (GdmWindowsFound) {//added by Lukas
+		w = gtk_menu_item_new_with_mnemonic (_("_Windows"));
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
+		gtk_widget_show (GTK_WIDGET (w));
+		g_signal_connect (G_OBJECT (w), "activate",
+				  G_CALLBACK (query_greeter_restart_windows_handler),
+				  NULL);
+	}
+
 	if (GdmHaltFound) {
 		w = gtk_menu_item_new_with_mnemonic (_("Shut _Down"));
 		gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
@@ -232,6 +261,7 @@
   GtkWidget *halt_radio = NULL;
   GtkWidget *suspend_radio = NULL;
   GtkWidget *restart_radio = NULL;
+  GtkWidget *windows_radio = NULL;//added by Lukas
   GtkWidget *config_radio = NULL;
   GtkWidget *chooser_radio = NULL;
   gchar *s;
@@ -316,6 +346,23 @@
 	  gtk_widget_show (restart_radio);
   }
 
+  if (GdmWindowsFound) {//added by Lukas
+	  if (group_radio != NULL)
+		  radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
+	  restart_radio = gtk_radio_button_new_with_mnemonic (radio_group,
+							     _("_Restart the computer into Windows"));
+	  group_radio = restart_radio;
+	  gtk_tooltips_set_tip (tooltips, GTK_WIDGET (restart_radio),
+				_("Restarts your computer into Windows"),
+				NULL);
+	  g_signal_connect (G_OBJECT(restart_radio), "button_press_event",
+			    G_CALLBACK(radio_button_press_event), NULL);
+	  gtk_box_pack_start (GTK_BOX (vbox),
+			      restart_radio,
+			      FALSE, FALSE, 4);
+	  gtk_widget_show (restart_radio);
+  }
+
   if (GdmSuspendFound) {
 	  if (group_radio != NULL)
 		  radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
@@ -399,6 +446,8 @@
     greeter_halt_handler ();
   else if (restart_radio != NULL && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (restart_radio)))
     greeter_restart_handler ();
+  else if (windows_radio != NULL && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (windows_radio)))//added by Lukas
+    greeter_restart_windows_handler ();
   else if (suspend_radio != NULL && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (suspend_radio)))
     greeter_suspend_handler ();
   else if (config_radio != NULL && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (config_radio)))
@@ -416,6 +465,9 @@
   greeter_item_register_action_callback ("reboot_button",
 					 (ActionFunc)query_greeter_restart_handler,
 					 NULL);
+  greeter_item_register_action_callback ("windows_button",//added by Lukas
+					 (ActionFunc)query_greeter_restart_windows_handler,
+					 NULL);
   greeter_item_register_action_callback ("halt_button",
 					 (ActionFunc)query_greeter_halt_handler,
 					 NULL);
--- gdm-2.16.0/gui/greeter/greeter_configuration.h.org	2006-09-20 12:00:25.000000000 +0100
+++ gdm-2.16.0/gui/greeter/greeter_configuration.h	2006-09-19 14:43:30.000000000 +0100
@@ -29,10 +29,12 @@
 extern gboolean GdmChooserButton;
 extern gchar *GdmHalt;
 extern gchar *GdmReboot;
+extern gchar *GdmWindows;//added by Lukas
 extern gchar *GdmSuspend;
 extern gchar *GdmConfigurator;
 extern gboolean GdmHaltFound;
 extern gboolean GdmRebootFound;
+extern gboolean GdmWindowsFound;//added by Lukas
 extern gboolean GdmSuspendFound;
 extern gboolean GdmConfiguratorFound;
 extern gchar *GdmSessionDir;
--- gdm-2.16.0/acconfig.h.org	2006-09-20 11:55:30.000000000 +0100
+++ gdm-2.16.0/acconfig.h	2006-09-19 14:58:30.000000000 +0100
@@ -3,6 +3,7 @@
 #undef GETTEXT_PACKAGE
 #undef HALT_COMMAND
 #undef REBOOT_COMMAND
+#undef WINDOWS_COMMAND
 #undef SOUND_PROGRAM
 #undef SUSPEND_COMMAND
 #undef ENABLE_IPV6
--- gdm-2.16.0/config/gdm.conf.in.org	2006-09-20 15:36:36.000000000 +0100
+++ gdm-2.16.0/config/gdm.conf.in	2006-09-20 15:37:43.000000000 +0100
@@ -124,6 +124,7 @@
 # by a semicolon.  GDM will use the first one it can find.
 RebootCommand=/sbin/reboot;/sbin/shutdown -r now;/usr/sbin/shutdown -r now;/usr/bin/reboot
 HaltCommand=/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shutdown -h now;/usr/bin/poweroff
+WindowsCommand=/usr/local/sbin/rebootwin;/usr/bin/rebootwin;/sbin/rebootwin;/usr/local/bin/rebootwin
 # Probably should not touch the below this is the standard setup.
 ServAuthDir=@authdir@
 # This is our standard startup script.  A bit different from a normal X
--- gdm-2.16.0/configure.ac.org	2006-09-20 12:59:52.000000000 +0100
+++ gdm-2.16.0/configure.ac	2006-09-20 13:01:05.000000000 +0100
@@ -966,6 +966,7 @@
         GDM_USER_PATH="/usr/bin"
         HALT_COMMAND="/sbin/init 5"
         REBOOT_COMMAND="/sbin/init 6"
+	WINDOWS_COMMAND="/sbin/init 6"
         SUSPEND_COMMAND="/usr/openwin/bin/sys-suspend -n"
         XSESSION_SHELL=/bin/ksh
         SOUND_PROGRAM=/usr/bin/audioplay
@@ -974,6 +975,7 @@
 	GDM_USER_PATH="/bin:/usr/bin"
 	HALT_COMMAND="/sbin/shutdown -p now;/usr/sbin/shutdown -p now"
 	REBOOT_COMMAND="/sbin/shutdown -r now;/usr/sbin/shutdown -r now"
+	WINDOWS_COMMAND="/usr/local/sbin/rebootwin;/usr/bin/rebootwin;/sbin/rebootwin;/usr/local/bin/rebootwin"
 	SUSPEND_COMMAND="/usr/sbin/zzz"
 	XSESSION_SHELL=/bin/sh
 	SOUND_PROGRAM=
@@ -982,6 +984,7 @@
         GDM_USER_PATH="/bin:/usr/bin"
         HALT_COMMAND="/usr/bin/poweroff;/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shutdown -h now"
         REBOOT_COMMAND="/usr/bin/reboot;/sbin/reboot;/sbin/shutdown -r now;/usr/sbin/shutdown -r now"
+	WINDOWS_COMMAND="/usr/local/sbin/rebootwin;/usr/bin/rebootwin;/sbin/rebootwin;/usr/local/bin/rebootwin"
         SUSPEND_COMMAND=""
         XSESSION_SHELL=/bin/sh
         SOUND_PROGRAM=/usr/bin/play
@@ -1082,6 +1085,8 @@
 AC_DEFINE_UNQUOTED(HALT_COMMAND,"$HALT_COMMAND")
 AC_SUBST(REBOOT_COMMAND)
 AC_DEFINE_UNQUOTED(REBOOT_COMMAND,"$REBOOT_COMMAND")
+AC_SUBST(WINDOWS_COMMAND)
+AC_DEFINE_UNQUOTED(WINDOWS_COMMAND,"$WINDOWS_COMMAND")
 AC_SUBST(SUSPEND_COMMAND)
 AC_DEFINE_UNQUOTED(SUSPEND_COMMAND,"$SUSPEND_COMMAND")
 AC_SUBST(XSESSION_SHELL)
