summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2007-10-18 09:06:30 +0000
committerCarsten Haitzler <raster@rasterman.com>2007-10-18 09:06:30 +0000
commitd2027e5fd3a8ea49b140eb6da2a49c8d22f62cfb (patch)
tree3b58050d024c1730ed772db904b303e23c66b1de /src/bin
parent7cca0c1c26d614b8117a22b3bf68f8c0182182ea (diff)
and fully handle dynamic screen add/del with xinerama (xrandr 1.2). seems to
work for me adding/removing screens. e moves windows from the old screen to existing one(s) and creates new zones and any shelves etc. for that zone if needed etc. etc. SVN revision: 32111
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/e_container.c66
-rw-r--r--src/bin/e_shelf.c89
-rw-r--r--src/bin/e_shelf.h1
-rw-r--r--src/bin/e_utils.c10
4 files changed, 110 insertions, 56 deletions
diff --git a/src/bin/e_container.c b/src/bin/e_container.c
index 749fed6..169cf77 100644
--- a/src/bin/e_container.c
+++ b/src/bin/e_container.c
@@ -1212,29 +1212,69 @@ _e_container_resize_handle(E_Container *con)
1212 } 1212 }
1213 else 1213 else
1214 { 1214 {
1215 Evas_List *ll;
1216
1215 zone = e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h); 1217 zone = e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h);
1216 // ... 1218 /* find any shelves configured for this zone and add them in */
1217 // ... 1219 for (ll = e_config->shelves; ll; ll = ll->next)
1218 /* FIXME: if there were shelves for this zone - create them */ 1220 {
1219 // .... 1221 E_Config_Shelf *cf_es;
1220 // ... 1222
1221 // ... 1223 cf_es = ll->data;
1224 if (e_util_container_zone_id_get(cf_es->container, cf_es->zone) == zone)
1225 e_shelf_config_new(zone, cf_es);
1226 }
1222 } 1227 }
1223 } 1228 }
1224 if (zones) 1229 if (zones)
1225 { 1230 {
1231 E_Zone *spare_zone = NULL;
1232 Evas_List *ll;
1233
1234 for (ll = con->zones; ll; ll = ll->next)
1235 {
1236 spare_zone = ll->data;
1237 if (evas_list_find(zones, spare_zone))
1238 spare_zone = NULL;
1239 else break;
1240 }
1226 while (zones) 1241 while (zones)
1227 { 1242 {
1228 E_Zone *zone; 1243 E_Zone *zone;
1244 Evas_List *shelves, *ll, *del_shelves;
1245 E_Border_List *bl;
1246 E_Border *bd;
1229 1247
1230 zone = zones->data; 1248 zone = zones->data;
1231 /* FIXME: any shelves for this zone - kill them */ 1249 /* delete any shelves on this zone */
1232 /* FIXME: take all borders in the zone and move elsewhere */ 1250 shelves = e_shelf_list();
1233 // ... 1251 del_shelves = NULL;
1234 // ... 1252 for (ll = shelves; ll; ll = ll->next)
1235 //e_border_zone_set(bd, new_zone); 1253 {
1236 // ... 1254 E_Shelf *es;
1237 // ... 1255
1256 es = ll->data;
1257 if (es->zone == zone)
1258 del_shelves = evas_list_append(del_shelves, es);
1259 }
1260 while (del_shelves)
1261 {
1262 e_object_del(E_OBJECT(del_shelves->data));
1263 del_shelves = evas_list_remove_list(del_shelves, del_shelves);
1264 }
1265 bl = e_container_border_list_first(zone->container);
1266 while ((bd = e_container_border_list_next(bl)))
1267 {
1268 if (bd->zone == zone)
1269 {
1270 if (spare_zone) e_border_zone_set(bd, spare_zone);
1271 else
1272 printf("EEEK! should not be here - but no\n"
1273 "spare zones exist to move this\n"
1274 "window to!!! help!\n");
1275 }
1276 }
1277 e_container_border_list_free(bl);
1238 e_object_del(E_OBJECT(zone)); 1278 e_object_del(E_OBJECT(zone));
1239 zones = evas_list_remove_list(zones, zones); 1279 zones = evas_list_remove_list(zones, zones);
1240 } 1280 }
diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c
index de5b087..fa9ce5a 100644
--- a/src/bin/e_shelf.c
+++ b/src/bin/e_shelf.c
@@ -71,50 +71,9 @@ e_shelf_config_init(void)
71 71
72 cf_es = l->data; 72 cf_es = l->data;
73 if (cf_es->id <= 0) cf_es->id = id + 1; 73 if (cf_es->id <= 0) cf_es->id = id + 1;
74 zone = e_util_container_zone_number_get(cf_es->container, cf_es->zone); 74 zone = e_util_container_zone_id_get(cf_es->container, cf_es->zone);
75 id = cf_es->id; 75 id = cf_es->id;
76 if (zone) 76 if (zone) e_shelf_config_new(zone, cf_es);
77 {
78 E_Shelf *es;
79
80 es = e_shelf_zone_new(zone, cf_es->name, cf_es->style,
81 cf_es->popup, cf_es->layer, cf_es->id);
82 if (es)
83 {
84 if (!cf_es->hide_timeout) cf_es->hide_timeout = 1.0;
85 if (!cf_es->hide_duration) cf_es->hide_duration = 1.0;
86 es->cfg = cf_es;
87 es->fit_along = cf_es->fit_along;
88 es->fit_size = cf_es->fit_size;
89
90 e_shelf_orient(es, cf_es->orient);
91 e_shelf_position_calc(es);
92 e_shelf_populate(es);
93
94 if (cf_es->desk_show_mode)
95 {
96 E_Desk *desk;
97 Evas_List *ll;
98
99 desk = e_desk_current_get(zone);
100 for (ll = cf_es->desk_list; ll; ll = ll->next)
101 {
102 E_Config_Shelf_Desk *sd;
103
104 sd = ll->data;
105 if ((desk->x == sd->x) && (desk->y == sd->y))
106 {
107 e_shelf_show(es);
108 break;
109 }
110 }
111 }
112 else
113 e_shelf_show(es);
114
115 e_shelf_toggle(es, 0);
116 }
117 }
118 } 77 }
119} 78}
120 79
@@ -657,6 +616,50 @@ e_shelf_popup_set(E_Shelf *es, int popup)
657 } 616 }
658} 617}
659 618
619EAPI E_Shelf *
620e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es)
621{
622 E_Shelf *es;
623
624 es = e_shelf_zone_new(zone, cf_es->name, cf_es->style,
625 cf_es->popup, cf_es->layer, cf_es->id);
626 if (!es) return NULL;
627
628 if (!cf_es->hide_timeout) cf_es->hide_timeout = 1.0;
629 if (!cf_es->hide_duration) cf_es->hide_duration = 1.0;
630 es->cfg = cf_es;
631 es->fit_along = cf_es->fit_along;
632 es->fit_size = cf_es->fit_size;
633
634 e_shelf_orient(es, cf_es->orient);
635 e_shelf_position_calc(es);
636 e_shelf_populate(es);
637
638 if (cf_es->desk_show_mode)
639 {
640 E_Desk *desk;
641 Evas_List *ll;
642
643 desk = e_desk_current_get(zone);
644 for (ll = cf_es->desk_list; ll; ll = ll->next)
645 {
646 E_Config_Shelf_Desk *sd;
647
648 sd = ll->data;
649 if ((desk->x == sd->x) && (desk->y == sd->y))
650 {
651 e_shelf_show(es);
652 break;
653 }
654 }
655 }
656 else
657 e_shelf_show(es);
658
659 e_shelf_toggle(es, 0);
660 return es;
661}
662
660/* local subsystem functions */ 663/* local subsystem functions */
661static void 664static void
662_e_shelf_free(E_Shelf *es) 665_e_shelf_free(E_Shelf *es)
diff --git a/src/bin/e_shelf.h b/src/bin/e_shelf.h
index 962f37f..8da8707 100644
--- a/src/bin/e_shelf.h
+++ b/src/bin/e_shelf.h
@@ -64,6 +64,7 @@ EAPI void e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient);
64EAPI void e_shelf_position_calc(E_Shelf *es); 64EAPI void e_shelf_position_calc(E_Shelf *es);
65EAPI void e_shelf_style_set(E_Shelf *es, const char *style); 65EAPI void e_shelf_style_set(E_Shelf *es, const char *style);
66EAPI void e_shelf_popup_set(E_Shelf *es, int popup); 66EAPI void e_shelf_popup_set(E_Shelf *es, int popup);
67EAPI E_Shelf *e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es);
67 68
68#endif 69#endif
69#endif 70#endif
diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c
index 13b045d..b697b01 100644
--- a/src/bin/e_utils.c
+++ b/src/bin/e_utils.c
@@ -185,6 +185,16 @@ e_util_container_zone_number_get(int con_num, int zone_num)
185 return e_container_zone_number_get(con, zone_num); 185 return e_container_zone_number_get(con, zone_num);
186} 186}
187 187
188EAPI E_Zone *
189e_util_container_zone_id_get(int con_num, int id)
190{
191 E_Container *con;
192
193 con = e_util_container_number_get(con_num);
194 if (!con) return NULL;
195 return e_container_zone_id_get(con, id);
196}
197
188EAPI int 198EAPI int
189e_util_head_exec(int head, const char *cmd) 199e_util_head_exec(int head, const char *cmd)
190{ 200{