xinerama support work-infra in for xrandr1.2 and comments as to what is needed.

SVN revision: 32100
This commit is contained in:
Carsten Haitzler 2007-10-17 11:06:59 +00:00
parent d5942ea076
commit 2dc7874df7
6 changed files with 58 additions and 13 deletions

View File

@ -166,12 +166,12 @@ e_container_new(E_Manager *man)
E_Screen *scr;
scr = l->data;
zone = e_zone_new(con, scr->screen, scr->x, scr->y, scr->w, scr->h);
zone = e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h);
}
}
else
{
zone = e_zone_new(con, 0, 0, 0, con->w, con->h);
zone = e_zone_new(con, 0, 0, 0, 0, con->w, con->h);
}
return con;
}
@ -340,6 +340,24 @@ e_container_zone_number_get(E_Container *con, int num)
return NULL;
}
EAPI E_Zone *
e_container_zone_id_get(E_Container *con, int id)
{
Evas_List *l;
E_OBJECT_CHECK_RETURN(con, NULL);
E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL);
for (l = con->zones; l; l = l->next)
{
E_Zone *zone;
zone = l->data;
if (zone->id == id)
return zone;
}
return NULL;
}
EAPI E_Container_Shape *
e_container_shape_add(E_Container *con)
{
@ -1165,7 +1183,7 @@ static void
_e_container_resize_handle(E_Container *con)
{
E_Event_Container_Resize *ev;
Evas_List *l, *screens;
Evas_List *l, *screens, *zones = NULL;
int i;
ev = calloc(1, sizeof(E_Event_Container_Resize));
@ -1174,28 +1192,52 @@ _e_container_resize_handle(E_Container *con)
e_xinerama_update();
screens = (Evas_List *)e_xinerama_screens_get();
if (screens)
{
for (l = con->zones; l; l = l->next)
zones = evas_list_append(zones, l->data);
for (l = screens; l; l = l->next)
{
E_Screen *scr;
E_Zone *zone;
scr = l->data;
zone = e_container_zone_number_get(con, scr->screen);
zone = e_container_zone_id_get(con, scr->escreen);
if (zone)
{
e_zone_move_resize(zone, scr->x, scr->y, scr->w, scr->h);
e_shelf_zone_move_resize_handle(zone);
zones = evas_list_remove(zones, zone);
}
else
zone = e_zone_new(con, scr->screen, scr->x, scr->y, scr->w, scr->h);
{
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 */
// ....
// ...
// ...
}
}
if (evas_list_count(con->zones) != evas_list_count(screens))
if (zones)
{
/* xinerama screens where deleted! eek! */
/* FIXME: handle deletion of a zone! */
printf("FIXME: handle deletion of xinerama screens\n");
while (zones)
{
E_Zone *zone;
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);
// ...
// ...
e_object_del(E_OBJECT(zone));
zones = evas_list_remove_list(zones, zones);
}
}
}
else

View File

@ -109,6 +109,7 @@ EAPI void e_container_border_list_free(E_Border_List *list);
EAPI E_Zone *e_container_zone_at_point_get(E_Container *con, int x, int y);
EAPI E_Zone *e_container_zone_number_get(E_Container *con, int num);
EAPI E_Zone *e_container_zone_id_get(E_Container *con, int id);
EAPI E_Container_Shape *e_container_shape_add(E_Container *con);
EAPI void e_container_shape_show(E_Container_Shape *es);

View File

@ -199,7 +199,7 @@ _e_xinerama_update(void)
scr = l->data;
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;
}
}

View File

@ -11,7 +11,7 @@ typedef struct _E_Screen E_Screen;
struct _E_Screen
{
int screen;
int screen, escreen;
int x, y, w, h;
};

View File

@ -44,7 +44,7 @@ e_zone_shutdown(void)
}
EAPI E_Zone *
e_zone_new(E_Container *con, int num, int x, int y, int w, int h)
e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h)
{
E_Zone *zone;
char name[40];
@ -60,6 +60,7 @@ e_zone_new(E_Container *con, int num, int x, int y, int w, int h)
zone->w = w;
zone->h = h;
zone->num = num;
zone->id = id;
zone->flip.left = ecore_x_window_input_new(con->win, zone->x, zone->y, 1, zone->h);
zone->flip.right = ecore_x_window_input_new(con->win, zone->x + zone->w - 1, zone->y, 1, zone->h);

View File

@ -52,6 +52,7 @@ struct _E_Zone
Ecore_Evas *black_ecore_evas;
Evas *black_evas;
Ecore_X_Window black_win;
int id;
};
struct _E_Event_Zone_Desk_Count_Set
@ -76,7 +77,7 @@ struct _E_Event_Pointer_Warp
EAPI int e_zone_init(void);
EAPI int e_zone_shutdown(void);
EAPI E_Zone *e_zone_new(E_Container *con, int num, int x, int y, int w, int h);
EAPI E_Zone *e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h);
EAPI void e_zone_name_set(E_Zone *zone, const char *name);
EAPI void e_zone_move(E_Zone *zone, int x, int y);
EAPI void e_zone_resize(E_Zone *zone, int w, int h);