discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=afa358fa9e200e7f4544aac6fec6de03187ceeef

commit afa358fa9e200e7f4544aac6fec6de03187ceeef
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu Oct 13 11:24:28 2016 -0400

    add zone number to bryce names
    
    fixes usage of bryces in identical setups on different zones
---
 src/bin/e_bryce.c        | 13 +++++++++++++
 src/bin/e_bryce_editor.c |  7 ++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/bin/e_bryce.c b/src/bin/e_bryce.c
index b4bcaa2..b49721d 100644
--- a/src/bin/e_bryce.c
+++ b/src/bin/e_bryce.c
@@ -3,6 +3,8 @@
 #define DEFAULT_LAYER E_LAYER_CLIENT_ABOVE
 #define E_BRYCE_TYPE 0xE31338
 
+static unsigned int bryce_version = 1;
+
 typedef struct Bryce
 {
    E_Object *e_obj_inherit;
@@ -37,6 +39,7 @@ typedef struct Bryce
    /* config: do not bitfield! */
    Eina_Bool autosize;
    Eina_Bool autohide;
+   unsigned int version;
 
    Eina_Bool hidden : 1;
    Eina_Bool animating : 1;
@@ -1152,6 +1155,7 @@ e_bryce_init(void)
    E_CONFIG_VAL(edd_bryce, Bryce, autohide, UCHAR);
    E_CONFIG_VAL(edd_bryce, Bryce, orient, UINT);
    E_CONFIG_VAL(edd_bryce, Bryce, anchor, UINT);
+   E_CONFIG_VAL(edd_bryce, Bryce, version, UINT);
 
    edd_bryces = E_CONFIG_DD_NEW("Bryces", Bryces);
    E_CONFIG_LIST(edd_bryces, Bryces, bryces, edd_bryce);
@@ -1164,6 +1168,15 @@ e_bryce_init(void)
 
         EINA_LIST_FOREACH(bryces->bryces, l, b)
           {
+             if (b->version < 1)
+               {
+                  char buf[4096];
+
+                  snprintf(buf, sizeof(buf), "%s_%u", b->name, b->zone);
+                  e_gadget_site_rename(b->name, buf);
+                  eina_stringshare_replace(&b->name, buf);
+               }
+             b->version = bryce_version;
              if (!e_comp_zone_number_get(b->zone)) continue;
              b->layer = E_CLAMP(b->layer, E_LAYER_DESKTOP, 
E_LAYER_CLIENT_ABOVE);
              _bryce_create(b, e_comp->elm);
diff --git a/src/bin/e_bryce_editor.c b/src/bin/e_bryce_editor.c
index 46450e8..1413346 100644
--- a/src/bin/e_bryce_editor.c
+++ b/src/bin/e_bryce_editor.c
@@ -63,7 +63,9 @@ _editor_bryce_add(Evas_Object *obj)
    else if (bi->anchor & E_GADGET_SITE_ANCHOR_BOTTOM)
      loc2 = "bottom";
 
-   snprintf(buf, sizeof(buf), "bryce_%s_%s", loc, loc2);
+   zone = e_comp_object_util_zone_get(obj);
+   if (!zone) zone = e_zone_current_get();
+   snprintf(buf, sizeof(buf), "bryce_%s_%s_%d", loc, loc2, zone->num);
    if (bi->orient == E_GADGET_SITE_ORIENT_HORIZONTAL)
      {
         if (bi->anchor & E_GADGET_SITE_ANCHOR_LEFT)
@@ -92,8 +94,7 @@ _editor_bryce_add(Evas_Object *obj)
         e_gadget_site_gadget_add(site, "Digital Clock", 0);
         e_gadget_site_gadget_add(site, "Wireless", 0);
      }
-   zone = e_comp_object_util_zone_get(obj);
-   if (!zone) zone = e_zone_current_get();
+
    evas_object_geometry_get(b, &x, &y, NULL, NULL);
    evas_object_move(b, x + zone->x, y + zone->y);
    e_gadget_site_gravity_set(site, gravity);

-- 


Reply via email to