make all zone matching agree on the same convention - use zone->num,

not zone->id. zone->id is for matching u to zinerama/xrandr
screens/outputs. e re-sorts based on highest res screens first, lower
res later.



SVN revision: 67951
This commit is contained in:
Carsten Haitzler 2012-02-15 04:35:18 +00:00
parent 697cadcc45
commit 515819cdb5
14 changed files with 61 additions and 41 deletions

View File

@ -1132,20 +1132,26 @@ _e_container_resize_handle(E_Container *con)
{
EINA_LIST_FOREACH(con->zones, l, zone)
zones = eina_list_append(zones, zone);
con->zones = NULL;
EINA_LIST_FOREACH(screens, l, scr)
{
printf("@@@ SCREENS: %i %i | %i %i %ix%i\n", scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h);
zone = e_container_zone_id_get(con, scr->escreen);
if (zone)
{
printf("@@@ FOUND ZONE %i %i\n", zone->num, zone->id);
e_zone_move_resize(zone, scr->x, scr->y, scr->w, scr->h);
e_shelf_zone_move_resize_handle(zone);
zones = eina_list_remove(zones, zone);
con->zones = eina_list_append(con->zones, zone);
zone->num = scr->screen;
}
else
{
Eina_List *ll;
E_Config_Shelf *cf_es;
printf("@@@ container resize handle\n");
zone = e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h);
/* find any shelves configured for this zone and add them in */
EINA_LIST_FOREACH(e_config->shelves, ll, cf_es)

View File

@ -337,7 +337,7 @@ e_gadcon_swallowed_new(const char *name, int id, Evas_Object *obj, const char *s
gc->cf = E_NEW(E_Config_Gadcon, 1);
gc->cf->name = eina_stringshare_add(gc->name);
gc->cf->id = gc->id;
if (gc->zone) gc->cf->zone = gc->zone->id;
if (gc->zone) gc->cf->zone = gc->zone->num;
e_config->gadcons = eina_list_append(e_config->gadcons, gc->cf);
e_config_save_queue();
}
@ -644,7 +644,7 @@ e_gadcon_zone_set(E_Gadcon *gc, E_Zone *zone)
E_OBJECT_CHECK(gc);
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
gc->zone = zone;
if (gc->cf) gc->cf->zone = zone->id;
if (gc->cf) gc->cf->zone = zone->num;
}
EAPI E_Zone *

View File

@ -101,6 +101,7 @@ _e_xinerama_update(void)
scr = E_NEW(E_Screen, 1);
scr->screen = 0;
scr->escreen = scr->screen;
scr->x = 0;
scr->y = 0;
scr->w = rw;
@ -123,6 +124,7 @@ _e_xinerama_update(void)
/* add it to our list */
scr = E_NEW(E_Screen, 1);
scr->screen = i;
scr->escreen = scr->screen;
scr->x = x;
scr->y = y;
scr->w = w;
@ -178,7 +180,7 @@ _e_xinerama_update(void)
{
printf("E17 INIT: XINERAMA CHOSEN: [%i], %ix%i+%i+%i\n",
scr->screen, scr->w, scr->h, scr->x, scr->y);
scr->escreen = n;
scr->screen = n;
n++;
}
}

View File

@ -186,6 +186,8 @@ e_zone_new(E_Container *con,
zone->num = num;
zone->id = id;
e_zone_useful_geometry_dirty(zone);
printf("@@@@@@@@@@ e_zone_new: %i %i | %i %i %ix%i = %p\n", num, id, x, y, w, h, zone);
zone->handlers =
eina_list_append(zone->handlers,
@ -1431,6 +1433,7 @@ _e_zone_free(E_Zone *zone)
E_Container *con;
int x, y;
printf("@@@@@@@@@@ e_zone_free: %i %i | %i %i %ix%i = %p\n", zone->num, zone->id, zone->x, zone->y, zone->w, zone->h, zone);
/* Delete the edge windows if they exist */
if (zone->edge.top) ecore_x_window_free(zone->edge.top);
if (zone->edge.bottom) ecore_x_window_free(zone->edge.bottom);

View File

@ -225,7 +225,7 @@ _cb_add(void *data, void *data2 __UNUSED__)
cfg = E_NEW(E_Config_Shelf, 1);
cfg->name = eina_stringshare_add("shelf");
cfg->container = con->num;
cfg->zone = zone->id;
cfg->zone = zone->num;
cfg->popup = 1;
cfg->layer = 200;
cfg->orient = E_GADCON_ORIENT_CORNER_BR;

View File

@ -379,7 +379,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
z = e_zone_current_get(c);
d = e_desk_current_get(z);
cfbg = e_bg_config_get(c->num, z->id, d->x, d->y);
cfbg = e_bg_config_get(c->num, z->num, d->x, d->y);
/* if we have a config for this bg, use it. */
if (cfbg)
{

View File

@ -1126,11 +1126,11 @@ wp_browser_new(E_Container *con)
zone = e_util_zone_current_get(con->manager);
desk = e_desk_current_get(zone);
info->con_num = con->num;
info->zone_num = zone->id;
info->zone_num = zone->num;
info->desk_x = desk->x;
info->desk_y = desk->y;
info->mode = 0;
cfbg = e_bg_config_get(con->num, zone->id, desk->x, desk->y);
cfbg = e_bg_config_get(con->num, zone->num, desk->x, desk->y);
if (cfbg)
{
if ((cfbg->container >= 0) && (cfbg->zone >= 0))

View File

@ -140,7 +140,7 @@ gadman_populate_class(void *data, E_Gadcon *gc, const E_Gadcon_Client_Class *cc)
EINA_LIST_FOREACH(gc->cf->clients, l, cf_gcc)
{
if (cf_gcc->name && cc->name && !strcmp(cf_gcc->name, cc->name) && (gc->cf->zone == gc->zone->id))
if (cf_gcc->name && cc->name && !strcmp(cf_gcc->name, cc->name) && (gc->cf->zone == gc->zone->num))
{
EINA_LIST_FOREACH(Man->gadgets[layer], ll, gcc)
{
@ -560,7 +560,7 @@ _gadman_gadcon_new(const char* name, Gadman_Layer_Type layer, E_Zone *zone, E_Ga
gc->cf = NULL;
EINA_LIST_FOREACH(e_config->gadcons, l, cg)
{
if ((!strcmp(cg->name, name)) && (cg->zone == zone->id))
if ((!strcmp(cg->name, name)) && (cg->zone == zone->num))
{
gc->cf = cg;
break;
@ -573,7 +573,7 @@ _gadman_gadcon_new(const char* name, Gadman_Layer_Type layer, E_Zone *zone, E_Ga
gc->cf = E_NEW(E_Config_Gadcon, 1);
gc->cf->name = eina_stringshare_add(name);
gc->cf->id = gc->id;
gc->cf->zone = zone->id;
gc->cf->zone = zone->num;
gc->cf->clients = NULL;
e_config->gadcons = eina_list_append(e_config->gadcons, gc->cf);
e_config_save_queue();

View File

@ -28,7 +28,7 @@ e_mod_ind_win_new(E_Zone *zone)
{
Ind_Win *iwin;
Ecore_X_Window_State states[2];
Evas_Coord h = 0;
Evas_Coord h = 0, mw = 0, mh = 0;
/* create our new indicator window object */
iwin = E_OBJECT_ALLOC(Ind_Win, IND_WIN_TYPE, _e_mod_ind_win_cb_free);
@ -86,9 +86,9 @@ e_mod_ind_win_new(E_Zone *zone)
evas_object_show(iwin->o_base);
/* create our gadget container */
iwin->gadcon = e_gadcon_swallowed_new("illume-indicator", zone->id,
iwin->gadcon = e_gadcon_swallowed_new("illume-indicator", zone->num,
iwin->o_base, "e.swallow.content");
edje_extern_object_min_size_set(iwin->gadcon->o_container, zone->w, h);
edje_extern_object_min_size_set(iwin->gadcon->o_container, h, h);
e_gadcon_min_size_request_callback_set(iwin->gadcon,
_e_mod_ind_win_cb_min_size_request,
iwin);
@ -131,11 +131,14 @@ e_mod_ind_win_new(E_Zone *zone)
_e_mod_ind_win_cb_border_show,
iwin));
/* set minimum size of this window & popup */
e_win_size_min_set(iwin->win, zone->w, h);
edje_object_size_min_calc(iwin->o_base, &mw, &mh);
printf("@@@@@@@@@@@@@@@@@@@@@@@ %i: %ix%i\n", h, mw, mh);
/* set minimum size of this window */
e_win_size_min_set(iwin->win, zone->w, mh);
/* position and resize this window */
e_win_move_resize(iwin->win, zone->x, zone->y, zone->w, h);
e_win_move_resize(iwin->win, zone->x, zone->y, zone->w, mh);
/* show the window */
e_win_show(iwin->win);
@ -152,7 +155,7 @@ e_mod_ind_win_new(E_Zone *zone)
/* tell conformant apps our position and size */
ecore_x_e_illume_indicator_geometry_set(zone->black_win, zone->x, zone->y,
zone->w, h);
zone->w, mh);
return iwin;
}
@ -201,7 +204,7 @@ _e_mod_ind_win_cb_win_prop(void *data, int type __UNUSED__, void *event)
{
Ind_Win *iwin;
Ecore_X_Event_Window_Property *ev;
Evas_Coord h = 0;
Evas_Coord h = 0, mw = 0, mh = 0;
ev = event;
@ -212,8 +215,10 @@ _e_mod_ind_win_cb_win_prop(void *data, int type __UNUSED__, void *event)
h = (il_ind_cfg->height * e_scale);
edje_object_size_min_calc(iwin->o_base, &mw, &mh);
printf("@@@@@@@@@@@@@@@@@@@@@@@ %i: %ix%i\n", h, mw, mh);
/* set minimum size of this window */
e_win_size_min_set(iwin->win, iwin->zone->w, h);
e_win_size_min_set(iwin->win, iwin->zone->w, mh);
/* NB: Not sure why, but we need to tell this border to fetch icccm
* size position hints now :( (NOTE: This was not needed a few days ago)
@ -221,12 +226,12 @@ _e_mod_ind_win_cb_win_prop(void *data, int type __UNUSED__, void *event)
iwin->win->border->client.icccm.fetch.size_pos_hints = 1;
/* resize this window */
e_win_resize(iwin->win, iwin->zone->w, h);
e_win_resize(iwin->win, iwin->zone->w, mh);
/* tell conformant apps our position and size */
ecore_x_e_illume_indicator_geometry_set(iwin->zone->black_win,
iwin->win->x, iwin->win->y,
iwin->win->w, h);
iwin->win->w, mh);
return ECORE_CALLBACK_PASS_ON;
}
@ -236,16 +241,18 @@ _e_mod_ind_win_cb_zone_resize(void *data, int type __UNUSED__, void *event)
{
Ind_Win *iwin;
E_Event_Zone_Move_Resize *ev;
Evas_Coord h = 0;
Evas_Coord h = 0, mw = 0, mh = 0;
ev = event;
if (!(iwin = data)) return ECORE_CALLBACK_PASS_ON;
if (ev->zone != iwin->zone) return ECORE_CALLBACK_PASS_ON;
h = (il_ind_cfg->height * e_scale);
edje_object_size_min_calc(iwin->o_base, &mw, &mh);
printf("@@@@@@@@@@@@@@@@@@@@@@@ %i: %ix%i\n", h, mw, mh);
/* set minimum size of this window to match zone size */
e_win_size_min_set(iwin->win, ev->zone->w, h);
e_win_size_min_set(iwin->win, ev->zone->w, mh);
return ECORE_CALLBACK_PASS_ON;
}
@ -259,8 +266,10 @@ _e_mod_ind_win_cb_resize(E_Win *win)
if (iwin->o_event) evas_object_resize(iwin->o_event, win->w, win->h);
if (iwin->o_base) evas_object_resize(iwin->o_base, win->w, win->h);
if (iwin->gadcon->o_container)
edje_extern_object_min_size_set(iwin->gadcon->o_container,
win->w, win->h);
{
// edje_extern_object_min_size_set(iwin->gadcon->o_container,
// win->w, win->h);
}
}
static void
@ -440,7 +449,7 @@ _e_mod_ind_win_cb_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_
if (!(iwin = data)) return;
if (gc != iwin->gadcon) return;
if (h < iwin->win->h) h = iwin->win->h;
edje_extern_object_min_size_set(iwin->gadcon->o_container, w, h);
// edje_extern_object_min_size_set(iwin->gadcon->o_container, w, h);
}
static void

View File

@ -256,7 +256,7 @@ _e_mod_notify_new(E_Notification *n)
ecore_x_e_illume_quickpanel_set(nwin->win->evas_win, EINA_TRUE);
ecore_x_e_illume_quickpanel_priority_major_set(nwin->win->evas_win,
e_notification_hint_urgency_get(n));
ecore_x_e_illume_quickpanel_zone_set(nwin->win->evas_win, zone->id);
ecore_x_e_illume_quickpanel_zone_set(nwin->win->evas_win, zone->num);
states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;

View File

@ -78,7 +78,7 @@ e_mod_policy_init(void)
Ecore_X_Illume_Mode mode = ECORE_X_ILLUME_MODE_SINGLE;
/* check for zone config */
if (!(cz = e_illume_zone_config_get(zone->id)))
if (!(cz = e_illume_zone_config_get(zone->num)))
continue;
/* set mode on this zone */

View File

@ -118,7 +118,7 @@ e_mod_quickpanel_show(E_Illume_Quickpanel *qp)
duration = _e_illume_cfg->animation.quickpanel.duration;
/* grab the height of the indicator */
cz = e_illume_zone_config_get(qp->zone->id);
cz = e_illume_zone_config_get(qp->zone->num);
qp->vert.isize = cz->indicator.size;
/* check animation duration */

View File

@ -307,7 +307,7 @@ _policy_zone_layout_indicator(E_Border *bd, E_Illume_Config_Zone *cz)
return;
}
// printf("\tLayout Indicator: %d\n", bd->zone->id);
// printf("\tLayout Indicator: %d\n", bd->zone->num);
/* lock indicator window from dragging if we need to */
if ((cz->mode.dual == 1) && (cz->mode.side == 0))
@ -1127,7 +1127,7 @@ _policy_border_del(E_Border *bd)
E_Illume_Config_Zone *cz;
/* get the config for this zone */
cz = e_illume_zone_config_get(bd->zone->id);
cz = e_illume_zone_config_get(bd->zone->num);
cz->softkey.size = 0;
_policy_zone_layout_update(bd->zone);
}
@ -1136,7 +1136,7 @@ _policy_border_del(E_Border *bd)
E_Illume_Config_Zone *cz;
/* get the config for this zone */
cz = e_illume_zone_config_get(bd->zone->id);
cz = e_illume_zone_config_get(bd->zone->num);
cz->indicator.size = 0;
_policy_zone_layout_update(bd->zone);
}
@ -1338,10 +1338,10 @@ _policy_zone_layout(E_Zone *zone)
if (!zone) return;
// printf("Zone Layout: %d\n", zone->id);
// printf("Zone Layout: %d\n", zone->num);
/* get the config for this zone */
cz = e_illume_zone_config_get(zone->id);
cz = e_illume_zone_config_get(zone->num);
/* loop through border list and update layout */
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
@ -1492,12 +1492,12 @@ _policy_zone_mode_change(E_Zone *zone, Ecore_X_Atom mode)
E_Border *bd;
int count;
// printf("Zone mode change: %d\n", zone->id);
// printf("Zone mode change: %d\n", zone->num);
if (!zone) return;
/* get the config for this zone */
cz = e_illume_zone_config_get(zone->id);
cz = e_illume_zone_config_get(zone->num);
/* update config with new mode */
if (mode == ECORE_X_ATOM_E_ILLUME_MODE_SINGLE)

View File

@ -293,7 +293,7 @@ _policy_zone_layout_indicator(E_Border *bd, E_Illume_Config_Zone *cz)
return;
}
// printf("\tLayout Indicator: %d\n", bd->zone->id);
// printf("\tLayout Indicator: %d\n", bd->zone->num);
/* lock indicator window from dragging if we need to */
if ((cz->mode.dual == 1) && (cz->mode.side == 0))
@ -829,7 +829,7 @@ _policy_border_del(E_Border *bd)
{
E_Illume_Config_Zone *cz;
cz = e_illume_zone_config_get(bd->zone->id);
cz = e_illume_zone_config_get(bd->zone->num);
cz->softkey.size = 0;
_policy_zone_layout_update(bd->zone);
}
@ -837,7 +837,7 @@ _policy_border_del(E_Border *bd)
{
E_Illume_Config_Zone *cz;
cz = e_illume_zone_config_get(bd->zone->id);
cz = e_illume_zone_config_get(bd->zone->num);
cz->indicator.size = 0;
_policy_zone_layout_update(bd->zone);
}
@ -1072,7 +1072,7 @@ _policy_zone_layout(E_Zone *zone)
if (!zone) return;
cz = e_illume_zone_config_get(zone->id);
cz = e_illume_zone_config_get(zone->num);
EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
@ -1178,7 +1178,7 @@ _policy_zone_mode_change(E_Zone *zone, Ecore_X_Atom mode)
if (!zone) return;
cz = e_illume_zone_config_get(zone->id);
cz = e_illume_zone_config_get(zone->num);
if (mode == ECORE_X_ATOM_E_ILLUME_MODE_SINGLE)
cz->mode.dual = 0;