dont re-order screens magically on dynamic screen ad/del vs startup on
authorCarsten Haitzler <raster@rasterman.com>
Thu, 26 Apr 2012 08:31:03 +0000 (08:31 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Thu, 26 Apr 2012 08:31:03 +0000 (08:31 +0000)
the same screen setup.

SVN revision: 70498

src/bin/e_container.c
src/bin/e_shelf.c
src/bin/e_xinerama.c

index 507f876..3ea567c 100644 (file)
@@ -1112,6 +1112,14 @@ _e_container_shape_change_call(E_Container_Shape *es, E_Container_Shape_Change c
      }
 }
 
+static int
+_e_container_cb_zone_sort(const void *data1, const void *data2)
+{
+   E_Zone *z1 = data1, *z2 = data2;
+   
+   return z2->num - z1->num;
+}
+
 static void
 _e_container_resize_handle(E_Container *con)
 {
@@ -1169,6 +1177,8 @@ _e_container_resize_handle(E_Container *con)
                    }
               }
          }
+        con->zones = eina_list_sort(con->zones, eina_list_count(con->zones),
+                                    _e_container_cb_zone_sort);
        if (zones)
          {
             E_Zone *spare_zone = NULL;
index d3e3a17..2e77db9 100644 (file)
@@ -75,7 +75,7 @@ e_shelf_config_update(void)
        E_Zone *zone;
 
        if (cf_es->id <= 0) cf_es->id = id + 1;
-       zone = e_util_container_zone_number_get(cf_es->container, cf_es->zone);
+       zone = e_util_container_zone_id_get(cf_es->container, cf_es->zone);
        if (zone)
          e_shelf_config_new(zone, cf_es);
        id = cf_es->id;
index f83af47..0b47c56 100644 (file)
@@ -119,8 +119,8 @@ _e_xinerama_update(void)
                    {
                       E_Screen *screen;
 
-                      printf("E17 INIT: XINERAMA SCREEN: [%i], %ix%i+%i+%i\n",
-                             i, w, h, x, y);
+                      printf("E17 INIT: XINERAMA SCREEN: [%i][%i], %ix%i+%i+%i\n",
+                             i, i, w, h, x, y);
                       /* add it to our list */
                       screen = E_NEW(E_Screen, 1);
                       screen->screen = i;
@@ -175,12 +175,13 @@ _e_xinerama_update(void)
    chosen_screens = eina_list_sort(chosen_screens,
                                   eina_list_count(chosen_screens),
                                   _e_xinerama_cb_screen_sort);
+   printf("======================= screens:\n");
    n = 0;
    EINA_LIST_FOREACH(chosen_screens, l, scr)
      {
-       printf("E17 INIT: XINERAMA CHOSEN: [%i], %ix%i+%i+%i\n",
-              scr->screen, scr->w, scr->h, scr->x, scr->y);
-       scr->screen = n;
+       scr->escreen = n;
+       printf("E17 INIT: XINERAMA CHOSEN: [%i][%i], %ix%i+%i+%i\n",
+              scr->screen, scr->escreen, scr->w, scr->h, scr->x, scr->y);
        n++;
      }
 }