## Description: Fix gnome-panel creation under two or more separate x screens; fix gnome-panel background
## Author: Alberts Muktupāvels <alberts.muktupavels@gmail.com>
## Bugs: https://bugzilla.gnome.org/show_bug.cgi?id=704019; https://bugzilla.gnome.org/show_bug.cgi?id=704203
Index: gnome-panel/gnome-panel/panel-layout.c
===================================================================
--- gnome-panel.orig/gnome-panel/panel-layout.c	2013-07-18 19:20:19.239501000 +0300
+++ gnome-panel/gnome-panel/panel-layout.c	2013-07-18 19:25:44.445888456 +0300
@@ -210,13 +210,7 @@
         /* If a specific id is specified, try to use it; it might be
          * free */
         if (try_id) {
-                if (screen_for_toplevels != -1 &&
-                    g_strcmp0 (schema, PANEL_TOPLEVEL_SCHEMA) == 0)
-                        unique_id = g_strdup_printf ("%s-screen%d",
-                                                     try_id,
-                                                     screen_for_toplevels);
-                else
-                        unique_id = g_strdup (try_id);
+                unique_id = g_strdup_printf ("%s-%d", try_id, screen_for_toplevels==-1?0:screen_for_toplevels);
 
                 existing = FALSE;
 
@@ -247,14 +241,7 @@
         /* Append an index at the end of the id to find a unique
          * id, not used yet */
         while (existing) {
-                if (screen_for_toplevels != -1 &&
-                    g_strcmp0 (schema, PANEL_TOPLEVEL_SCHEMA) == 0)
-                        unique_id = g_strdup_printf ("%s-screen%d-%d",
-                                                     try_id,
-                                                     screen_for_toplevels,
-                                                     index);
-                else
-                        unique_id = g_strdup_printf ("%s-%d", try_id, index);
+                unique_id = g_strdup_printf ("%s-%d-%d", try_id, screen_for_toplevels==-1?0:screen_for_toplevels, index);
 
                 existing = FALSE;
 
@@ -462,6 +449,11 @@
                                                         keyfile,
                                                         group, keyfile_keys[i],
                                                         error);
+                                                        
+                                if (strcmp(keyfile_keys[i], "toplevel-id") == 0) {
+                                  value_str = g_strdup_printf ("%s-%d", value_str, set_screen_to==-1?0:set_screen_to);
+                                }
+                                
                                 if (!value_str)
                                         goto out;
 
@@ -556,7 +548,7 @@
                  g_str_has_prefix (group, "Object "))
                 return panel_layout_append_group_helper (
                                         keyfile, group,
-                                        -1,
+                                        screen_for_toplevels,
                                         "Object",
                                         PANEL_LAYOUT_OBJECT_ID_LIST_KEY,
                                         PANEL_OBJECT_SCHEMA,
Index: gnome-panel/gnome-panel/panel-widget.c
===================================================================
--- gnome-panel.orig/gnome-panel/panel-widget.c	2013-07-18 19:20:19.239501000 +0300
+++ gnome-panel/gnome-panel/panel-widget.c	2013-07-18 19:27:29.773888443 +0300
@@ -1573,7 +1573,7 @@
 panel_widget_style_updated (GtkWidget *widget)
 {
         panel_widget_set_background_default_style (widget);
-        GTK_WIDGET_CLASS (panel_widget_parent_class)->style_updated (widget);
+        //GTK_WIDGET_CLASS (panel_widget_parent_class)->style_updated (widget);
 }
 
 static void
