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
This commit is contained in:
Carsten Haitzler 2007-10-18 09:06:30 +00:00
parent 7cca0c1c26
commit d2027e5fd3
4 changed files with 110 additions and 56 deletions

View File

@ -1212,29 +1212,69 @@ _e_container_resize_handle(E_Container *con)
}
else
{
Evas_List *ll;
zone = e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h);
// ...
// ...
/* FIXME: if there were shelves for this zone - create them */
// ....
// ...
// ...
/* find any shelves configured for this zone and add them in */
for (ll = e_config->shelves; ll; ll = ll->next)
{
E_Config_Shelf *cf_es;
cf_es = ll->data;
if (e_util_container_zone_id_get(cf_es->container, cf_es->zone) == zone)
e_shelf_config_new(zone, cf_es);
}
}
}
if (zones)
{
E_Zone *spare_zone = NULL;
Evas_List *ll;
for (ll = con->zones; ll; ll = ll->next)
{
spare_zone = ll->data;
if (evas_list_find(zones, spare_zone))
spare_zone = NULL;
else break;
}
while (zones)
{
E_Zone *zone;
Evas_List *shelves, *ll, *del_shelves;
E_Border_List *bl;
E_Border *bd;
zone = zones->data;
/* FIXME: any shelves for this zone - kill them */
/* FIXME: take all borders in the zone and move elsewhere */
// ...
// ...
//e_border_zone_set(bd, new_zone);
// ...
// ...
/* delete any shelves on this zone */
shelves = e_shelf_list();
del_shelves = NULL;
for (ll = shelves; ll; ll = ll->next)
{
E_Shelf *es;
es = ll->data;
if (es->zone == zone)
del_shelves = evas_list_append(del_shelves, es);
}
while (del_shelves)
{
e_object_del(E_OBJECT(del_shelves->data));
del_shelves = evas_list_remove_list(del_shelves, del_shelves);
}
bl = e_container_border_list_first(zone->container);
while ((bd = e_container_border_list_next(bl)))
{
if (bd->zone == zone)
{
if (spare_zone) e_border_zone_set(bd, spare_zone);
else
printf("EEEK! should not be here - but no\n"
"spare zones exist to move this\n"
"window to!!! help!\n");
}
}
e_container_border_list_free(bl);
e_object_del(E_OBJECT(zone));
zones = evas_list_remove_list(zones, zones);
}

View File

@ -71,50 +71,9 @@ e_shelf_config_init(void)
cf_es = l->data;
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);
id = cf_es->id;
if (zone)
{
E_Shelf *es;
es = e_shelf_zone_new(zone, cf_es->name, cf_es->style,
cf_es->popup, cf_es->layer, cf_es->id);
if (es)
{
if (!cf_es->hide_timeout) cf_es->hide_timeout = 1.0;
if (!cf_es->hide_duration) cf_es->hide_duration = 1.0;
es->cfg = cf_es;
es->fit_along = cf_es->fit_along;
es->fit_size = cf_es->fit_size;
e_shelf_orient(es, cf_es->orient);
e_shelf_position_calc(es);
e_shelf_populate(es);
if (cf_es->desk_show_mode)
{
E_Desk *desk;
Evas_List *ll;
desk = e_desk_current_get(zone);
for (ll = cf_es->desk_list; ll; ll = ll->next)
{
E_Config_Shelf_Desk *sd;
sd = ll->data;
if ((desk->x == sd->x) && (desk->y == sd->y))
{
e_shelf_show(es);
break;
}
}
}
else
e_shelf_show(es);
e_shelf_toggle(es, 0);
}
}
if (zone) e_shelf_config_new(zone, cf_es);
}
}
@ -657,6 +616,50 @@ e_shelf_popup_set(E_Shelf *es, int popup)
}
}
EAPI E_Shelf *
e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es)
{
E_Shelf *es;
es = e_shelf_zone_new(zone, cf_es->name, cf_es->style,
cf_es->popup, cf_es->layer, cf_es->id);
if (!es) return NULL;
if (!cf_es->hide_timeout) cf_es->hide_timeout = 1.0;
if (!cf_es->hide_duration) cf_es->hide_duration = 1.0;
es->cfg = cf_es;
es->fit_along = cf_es->fit_along;
es->fit_size = cf_es->fit_size;
e_shelf_orient(es, cf_es->orient);
e_shelf_position_calc(es);
e_shelf_populate(es);
if (cf_es->desk_show_mode)
{
E_Desk *desk;
Evas_List *ll;
desk = e_desk_current_get(zone);
for (ll = cf_es->desk_list; ll; ll = ll->next)
{
E_Config_Shelf_Desk *sd;
sd = ll->data;
if ((desk->x == sd->x) && (desk->y == sd->y))
{
e_shelf_show(es);
break;
}
}
}
else
e_shelf_show(es);
e_shelf_toggle(es, 0);
return es;
}
/* local subsystem functions */
static void
_e_shelf_free(E_Shelf *es)

View File

@ -64,6 +64,7 @@ EAPI void e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient);
EAPI void e_shelf_position_calc(E_Shelf *es);
EAPI void e_shelf_style_set(E_Shelf *es, const char *style);
EAPI void e_shelf_popup_set(E_Shelf *es, int popup);
EAPI E_Shelf *e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es);
#endif
#endif

View File

@ -185,6 +185,16 @@ e_util_container_zone_number_get(int con_num, int zone_num)
return e_container_zone_number_get(con, zone_num);
}
EAPI E_Zone *
e_util_container_zone_id_get(int con_num, int id)
{
E_Container *con;
con = e_util_container_number_get(con_num);
if (!con) return NULL;
return e_container_zone_id_get(con, id);
}
EAPI int
e_util_head_exec(int head, const char *cmd)
{