Index: gnome-panel/panel-profile.c
===================================================================
--- gnome-panel/panel-profile.c	(revision 11472)
+++ gnome-panel/panel-profile.c	(working copy)
@@ -636,6 +636,7 @@
 	}                                                             \
         TOPLEVEL_IS_WRITABLE_FUNC(k, p, s)
 
+TOPLEVEL_GET_SET_FUNCS ("monitor",            toplevel,   int,  monitor,        int)
 TOPLEVEL_GET_SET_FUNCS ("size",               toplevel,   int,  size,           int)
 TOPLEVEL_GET_SET_FUNCS ("expand",             toplevel,   bool, expand,         gboolean)
 TOPLEVEL_GET_SET_FUNCS ("auto_hide",          toplevel,   bool, auto_hide,      gboolean)
Index: gnome-panel/panel-profile.h
===================================================================
--- gnome-panel/panel-profile.h	(revision 11472)
+++ gnome-panel/panel-profile.h	(working copy)
@@ -83,6 +83,11 @@
             panel_profile_get_toplevel_orientation    (PanelToplevel *toplevel);
 gboolean    panel_profile_is_writable_toplevel_orientation (PanelToplevel *toplevel);
 
+void        panel_profile_set_toplevel_monitor        (PanelToplevel *toplevel,
+						       int            monitor);
+int         panel_profile_get_toplevel_monitor        (PanelToplevel *toplevel);
+gboolean    panel_profile_is_writable_toplevel_monitor (PanelToplevel *toplevel);
+
 void        panel_profile_set_toplevel_size           (PanelToplevel *toplevel,
 						       int            size);
 int         panel_profile_get_toplevel_size           (PanelToplevel *toplevel);
Index: gnome-panel/ChangeLog
===================================================================
--- gnome-panel/ChangeLog	(revision 11472)
+++ gnome-panel/ChangeLog	(working copy)
@@ -1,3 +1,23 @@
+2009-01-25 Richard Eames <naddiseo@gmail.com>
+
+	Proposed fix for bug 562944, in the preferences, add the ability to
+	select which monitor and panel can appear on.
+
+	* panel-profile.[ch]
+	Add panel_profile_set_toplevel_monitor, 
+	panel_profile_get_toplevel_monitor,
+	panel_profile_is_writable_toplevel_monitor
+	* panel-properties-dialog.glade 
+	updated
+	* panel-properties-dialog.c
+	Add the two monitor widgets to PanelPropertiesDialog.
+	Add panel_properties_dialog_monitor_changed,
+	panel_properties_dialog_setup_monitor_spin, 
+	panel_properties_dialog_update_monitor.
+	(panel_properties_dialog_new),
+	(panel_properties_dialog_remove_orientation_combo),
+	(panel_properties_dialog_toplevel_notify): update for monitor	
+	
 2009-01-21  Frederic Crozat  <fcrozat@mandriva.com>
 
 	* panel-applet-frame.c:
Index: gnome-panel/panel-properties-dialog.glade
===================================================================
--- gnome-panel/panel-properties-dialog.glade	(revision 11472)
+++ gnome-panel/panel-properties-dialog.glade	(working copy)
@@ -48,7 +48,7 @@
                 <child>
                   <widget class="GtkTable" id="general_table">
                     <property name="visible">True</property>
-                    <property name="n_rows">3</property>
+                    <property name="n_rows">4</property>
                     <property name="n_columns">2</property>
                     <property name="column_spacing">12</property>
                     <property name="row_spacing">6</property>
@@ -67,8 +67,8 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="right_attach">2</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options">GTK_FILL</property>
                       </packing>
@@ -83,13 +83,43 @@
                         <property name="use_underline">True</property>
                       </widget>
                       <packing>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
                     </child>
                     <child>
+                      <widget class="GtkSpinButton" id="monitor_spin">
+                        <property name="visible">True</property>
+                        <property name="adjustment">1 1 100 1 1 0</property>
+                        <property name="climb_rate">1</property>
+                        <property name="numeric">True</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="monitor_label">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">_Monitor:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">monitor_spin</property>
+                      </widget>
+                      <packing>
+                         <property name="top_attach">1</property>
+                         <property name="bottom_attach">2</property>
+                         <property name="x_options">GTK_FILL</property>
+                       	 <property name="y_options"></property>
+                       </packing>
+                    </child> 
+                    <child>
                       <widget class="GtkHBox" id="size_widgets">
                         <property name="visible">True</property>
                         <property name="spacing">6</property>
@@ -117,8 +147,8 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="right_attach">2</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options">GTK_FILL</property>
                       </packing>
@@ -132,8 +162,8 @@
                         <property name="mnemonic_widget">size_spin</property>
                       </widget>
                       <packing>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
Index: gnome-panel/panel-properties-dialog.c
===================================================================
--- gnome-panel/panel-properties-dialog.c	(revision 11472)
+++ gnome-panel/panel-properties-dialog.c	(working copy)
@@ -50,6 +50,8 @@
 	GtkWidget     *general_vbox;
 	GtkWidget     *orientation_combo;
 	GtkWidget     *orientation_label;
+	GtkWidget     *monitor_label;
+	GtkWidget     *monitor_spin;
 	GtkWidget     *size_widgets;
 	GtkWidget     *size_spin;
 	GtkWidget     *size_label;
@@ -206,6 +208,54 @@
 }
 
 static void
+panel_properties_dialog_monitor_changed (PanelPropertiesDialog *dialog,
+					 GtkSpinButton         *spin_button)
+{
+	int value =  gtk_spin_button_get_value_as_int (spin_button);
+	/* is this needed? */
+	g_return_if_fail (value > 0);
+	panel_profile_set_toplevel_monitor (dialog->toplevel, value - 1);
+}
+
+static void
+panel_properties_dialog_setup_monitor_spin (PanelPropertiesDialog *dialog,
+					    GladeXML              *gui)
+{
+	dialog->monitor_spin = glade_xml_get_widget (gui, "monitor_spin");
+	g_return_if_fail (dialog->monitor_spin != NULL);
+	dialog->monitor_label = glade_xml_get_widget (gui, "monitor_label");
+	g_return_if_fail (dialog->monitor_label != NULL);
+	
+	int monitor;
+	int n_monitors;
+	GdkScreen *screen;
+	
+	monitor = panel_profile_get_toplevel_monitor (dialog->toplevel);
+
+	/* does this bit need to be broken out into functions? */
+	screen = gtk_window_get_screen (GTK_WINDOW (dialog->toplevel));
+	g_return_if_fail (screen != NULL);
+	n_monitors = gdk_screen_get_n_monitors (screen);
+	/* Not sure about this; is it safe to assume that a screen has to have a monitor? */
+	g_return_if_fail (n_monitors > 0 && n_monitors >= monitor + 1);
+	
+	
+	gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->monitor_spin), 1, n_monitors);
+	
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->monitor_spin), monitor + 1);
+	
+	g_signal_connect_swapped (dialog->monitor_spin, "value_changed",
+				  G_CALLBACK (panel_properties_dialog_monitor_changed),
+				  dialog);
+
+	if ( ! panel_profile_is_writable_toplevel_monitor (dialog->toplevel)) {
+		gtk_widget_set_sensitive (dialog->monitor_spin, FALSE);
+		gtk_widget_set_sensitive (dialog->monitor_label, FALSE);
+		gtk_widget_show (dialog->writability_warn_general);
+	}	   	
+}
+
+static void
 panel_properties_dialog_size_changed (PanelPropertiesDialog *dialog,
 				      GtkSpinButton         *spin_button)
 {
@@ -714,6 +764,16 @@
 }
 
 static void
+panel_properties_dialog_update_monitor (PanelPropertiesDialog *dialog,
+					GConfValue            *value)
+{	
+	if (!value || value->type != GCONF_VALUE_INT)
+		return	
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->monitor_spin),
+				   gconf_value_get_int (value));
+}
+
+static void
 panel_properties_dialog_update_size (PanelPropertiesDialog *dialog,
 				     GConfValue            *value)
 {
@@ -750,6 +810,8 @@
 
 	if (!strcmp (key, "orientation"))
 		panel_properties_dialog_update_orientation (dialog, value);
+	else if (!strcmp (key, "monitor"))
+		panel_properties_dialog_update_monitor (dialog, value);
 	else if (!strcmp (key, "size"))
 		panel_properties_dialog_update_size (dialog, value);
 	else UPDATE_TOGGLE ("expand",         expand_toggle)
@@ -884,6 +946,8 @@
 	GtkContainer *container = GTK_CONTAINER (dialog->general_table);
 	GtkTable     *table     = GTK_TABLE (dialog->general_table);
 
+	g_object_ref (dialog->monitor_label);
+	g_object_ref (dialog->monitor_spin);
 	g_object_ref (dialog->size_label);
 	g_object_ref (dialog->size_widgets);
 	g_object_ref (dialog->icon_label);
@@ -891,24 +955,31 @@
 
 	gtk_container_remove (container, dialog->orientation_label);
 	gtk_container_remove (container, dialog->orientation_combo);
+	gtk_container_remove (container, dialog->monitor_label);
+	gtk_container_remove (container, dialog->monitor_spin);
 	gtk_container_remove (container, dialog->size_label);
 	gtk_container_remove (container, dialog->size_widgets);
 	gtk_container_remove (container, dialog->icon_label);
 	gtk_container_remove (container, dialog->icon_align);
 
-	gtk_table_attach_defaults (table, dialog->size_label,   0, 1, 1, 2);
-	gtk_table_attach_defaults (table, dialog->size_widgets, 1, 2, 1, 2);
-	gtk_table_attach_defaults (table, dialog->icon_label,   0, 1, 2, 3);
-	gtk_table_attach_defaults (table, dialog->icon_align,   1, 2, 2, 3);
+	/* I think these values are right */
+	gtk_table_attach_defaults (table, dialog->monitor_label,0, 1, 1, 2);
+	gtk_table_attach_defaults (table, dialog->monitor_spin, 1, 2, 1, 2);
+	gtk_table_attach_defaults (table, dialog->size_label,   0, 1, 2, 3);
+	gtk_table_attach_defaults (table, dialog->size_widgets, 1, 2, 2, 3);
+	gtk_table_attach_defaults (table, dialog->icon_label,   0, 1, 3, 4);
+	gtk_table_attach_defaults (table, dialog->icon_align,   1, 2, 3, 4);
 
 	dialog->orientation_label = NULL;
 	dialog->orientation_combo = NULL;
+	g_object_unref (dialog->monitor_label);
+	g_object_unref (dialog->monitor_spin);
 	g_object_unref (dialog->size_label);
 	g_object_unref (dialog->size_widgets);
 	g_object_unref (dialog->icon_label);
 	g_object_unref (dialog->icon_align);
 
-	gtk_table_resize (table, 3, 2);
+	gtk_table_resize (table, 4, 2);
 }
 
 static void
@@ -983,6 +1054,7 @@
 	dialog->general_table = glade_xml_get_widget (gui, "general_table");
 
 	panel_properties_dialog_setup_orientation_combo  (dialog, gui);
+	panel_properties_dialog_setup_monitor_spin       (dialog, gui);
 	panel_properties_dialog_setup_size_spin          (dialog, gui);
 	panel_properties_dialog_setup_icon_entry         (dialog, gui);
 	panel_properties_dialog_setup_expand_toggle      (dialog, gui);
