Window layers, incomplete.

SVN revision: 14446
This commit is contained in:
sebastid 2005-04-28 09:55:41 +00:00 committed by sebastid
parent 14147c865c
commit 7f5601e4b2
6 changed files with 93 additions and 56 deletions

View File

@ -199,7 +199,6 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map)
Ecore_X_Window_Attributes *att;
Evas_List *list;
E_Config_Binding *eb;
Ecore_X_Window mwin;
unsigned int managed, desk[2];
int deskx, desky;
@ -213,14 +212,6 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map)
bd->h = 1;
bd->win = ecore_x_window_override_new(bd->container->win, 0, 0, bd->w, bd->h);
ecore_x_window_shape_events_select(bd->win, 1);
mwin = e_menu_grab_window_get();
if (!mwin) mwin = e_init_window_get();
if (mwin)
ecore_x_window_configure(bd->win,
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
mwin, ECORE_X_WINDOW_STACK_BELOW);
/* Bindings */
for (list = e_config->bindings; list; list = list->next)
{
@ -299,6 +290,8 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map)
bd->w = bd->client.w;
bd->h = bd->client.h;
bd->layer = 100;
bd->changes.size = 1;
bd->changes.shape = 1;
@ -321,8 +314,8 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map)
ecore_x_window_save_set_add(win);
ecore_x_window_reparent(win, bd->client.shell_win, 0, 0);
ecore_x_window_border_width_set(win, 0);
ecore_x_window_show(bd->event_win);
ecore_x_window_show(bd->client.shell_win);
e_container_window_show(con, bd->event_win, bd->layer);
e_container_window_show(con, bd->client.shell_win, bd->layer);
bd->shape = e_container_shape_add(con);
bd->new_client = 1;
@ -410,7 +403,7 @@ e_border_show(E_Border *bd)
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
if (bd->visible) return;
e_container_shape_show(bd->shape);
ecore_x_window_show(bd->client.win);
e_container_window_show(bd->zone->container, bd->client.win, bd->layer);
e_hints_window_visible_set(bd->client.win);
bd->visible = 1;
bd->changes.visible = 1;
@ -436,7 +429,7 @@ e_border_hide(E_Border *bd, int manage)
if (!bd->visible) return;
if (bd->moving) return;
ecore_x_window_hide(bd->client.win);
e_container_window_hide(bd->zone->container, bd->client.win, bd->layer);
e_container_shape_hide(bd->shape);
if (!bd->iconic)
e_hints_window_hidden_set(bd->client.win);
@ -581,22 +574,10 @@ e_border_move_resize(E_Border *bd, int x, int y, int w, int h)
void
e_border_raise(E_Border *bd)
{
Ecore_X_Window mwin;
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
_e_border_reorder_after(bd, NULL);
mwin = e_menu_grab_window_get();
if (!mwin) mwin = e_init_window_get();
if (!mwin)
ecore_x_window_raise(bd->win);
else
ecore_x_window_configure(bd->win,
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
mwin, ECORE_X_WINDOW_STACK_BELOW);
e_container_window_raise(bd->zone->container, bd->win, bd->layer);
{
E_Event_Border_Raise *ev;
@ -606,8 +587,6 @@ e_border_raise(E_Border *bd)
ev->above = NULL;
ecore_event_add(E_EVENT_BORDER_RAISE, ev, _e_border_event_border_raise_free, NULL);
}
/* FIXME, ugly hack! */
e_moveresize_raise();
}
void
@ -1123,7 +1102,7 @@ e_border_idler_before(void)
if ((bd->changes.visible) && (bd->visible))
{
ecore_evas_show(bd->bg_ecore_evas);
ecore_x_window_show(bd->win);
e_container_window_show(bd->zone->container, bd->win, bd->layer);
bd->changes.visible = 0;
}
}
@ -1135,7 +1114,7 @@ e_border_idler_before(void)
bd = l->data;
if ((bd->changes.visible) && (!bd->visible))
{
ecore_x_window_hide(bd->win);
e_container_window_hide(bd->zone->container, bd->win, bd->layer);
ecore_evas_hide(bd->bg_ecore_evas);
bd->changes.visible = 0;
}
@ -2942,49 +2921,40 @@ _e_border_eval(E_Border *bd)
{
/* show at start of unshade (but don't hide until end of shade) */
if (bd->shaded)
// ecore_x_window_show(bd->client.shell_win);
ecore_x_window_raise(bd->client.shell_win);
e_container_window_raise(bd->zone->container, bd->client.shell_win, bd->layer);
bd->changes.shading = 0;
}
if ((bd->changes.shaded) && (bd->changes.pos) && (bd->changes.size))
{
if (bd->shaded)
// ecore_x_window_hide(bd->client.shell_win);
ecore_x_window_lower(bd->client.shell_win);
e_container_window_lower(bd->zone->container, bd->client.shell_win, bd->layer);
else
// ecore_x_window_show(bd->client.shell_win);
ecore_x_window_raise(bd->client.shell_win);
e_container_window_raise(bd->zone->container, bd->client.shell_win, bd->layer);
bd->changes.shaded = 0;
}
else if ((bd->changes.shaded) && (bd->changes.pos))
{
if (bd->shaded)
// ecore_x_window_hide(bd->client.shell_win);
ecore_x_window_lower(bd->client.shell_win);
e_container_window_lower(bd->zone->container, bd->client.shell_win, bd->layer);
else
// ecore_x_window_show(bd->client.shell_win);
ecore_x_window_raise(bd->client.shell_win);
e_container_window_raise(bd->zone->container, bd->client.shell_win, bd->layer);
bd->changes.size = 1;
bd->changes.shaded = 0;
}
else if ((bd->changes.shaded) && (bd->changes.size))
{
if (bd->shaded)
// ecore_x_window_hide(bd->client.shell_win);
ecore_x_window_lower(bd->client.shell_win);
e_container_window_lower(bd->zone->container, bd->client.shell_win, bd->layer);
else
// ecore_x_window_show(bd->client.shell_win);
ecore_x_window_raise(bd->client.shell_win);
e_container_window_raise(bd->zone->container, bd->client.shell_win, bd->layer);
bd->changes.shaded = 0;
}
else if (bd->changes.shaded)
{
if (bd->shaded)
// ecore_x_window_hide(bd->client.shell_win);
ecore_x_window_lower(bd->client.shell_win);
e_container_window_lower(bd->zone->container, bd->client.shell_win, bd->layer);
else
// ecore_x_window_show(bd->client.shell_win);
ecore_x_window_raise(bd->client.shell_win);
e_container_window_raise(bd->zone->container, bd->client.shell_win, bd->layer);
bd->changes.size = 1;
bd->changes.shaded = 0;
}

View File

@ -216,6 +216,8 @@ struct _E_Border
unsigned char start : 1;
int x, y;
} drag;
unsigned int layer;
};
struct _E_Border_Pending_Move_Resize

View File

@ -43,6 +43,7 @@ e_container_new(E_Manager *man)
Evas_Object *o;
char name[40];
Evas_List *l, *screens;
int i;
con = E_OBJECT_ALLOC(E_Container, E_CONTAINER_TYPE, _e_container_free);
if (!con) return NULL;
@ -98,6 +99,25 @@ e_container_new(E_Manager *man)
snprintf(name, sizeof(name), "Container %d", con->num);
con->name = strdup(name);
/* init layers */
for (i = 0; i < 7; i++)
{
con->layers[i] = ecore_x_window_input_new(con->win, 0, 0, 1, 1);
if (i > 0)
ecore_x_window_configure(con->layers[i],
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
con->layers[i - 1], ECORE_X_WINDOW_STACK_ABOVE);
}
ecore_x_window_configure(con->bg_win,
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
con->layers[0], ECORE_X_WINDOW_STACK_BELOW);
screens = (Evas_List *)e_xinerama_screens_get();
if (screens)
{
@ -455,6 +475,52 @@ e_container_shape_solid_rect_get(E_Container_Shape *es, int *x, int *y, int *w,
if (h) *h = es->solid_rect.h;
}
/* layers
* 0 = desktop
* 50 = below
* 100 = normal
* 150 = above
* 200 = fullscreen
* 999 = internal on top windows for E
*/
void
e_container_window_show(E_Container *con, Ecore_X_Window win, int layer)
{
ecore_x_window_show(win);
e_container_window_raise(con, win, layer);
}
void
e_container_window_hide(E_Container *con, Ecore_X_Window win, int layer)
{
ecore_x_window_hide(win);
}
void
e_container_window_raise(E_Container *con, Ecore_X_Window win, int layer)
{
int pos;
if (layer == 0) pos = 0;
else if ((layer > 0) && (layer <= 50)) pos = 1;
else if ((layer > 50) && (layer <= 100)) pos = 2;
else if ((layer > 100) && (layer <= 150)) pos = 3;
else if ((layer > 150) && (layer <= 200)) pos = 4;
else pos = 5;
ecore_x_window_configure(win,
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
con->layers[pos], ECORE_X_WINDOW_STACK_BELOW);
}
void
e_container_window_lower(E_Container *con, Ecore_X_Window win, int layer)
{
ecore_x_window_lower(win);
}
/* local subsystem functions */
static void
_e_container_free(E_Container *con)

View File

@ -48,6 +48,8 @@ struct _E_Container
Evas_List *shape_change_cb;
Evas_List *zones;
Evas_List *clients;
Ecore_X_Window layers[7];
};
struct _E_Container_Shape
@ -105,6 +107,11 @@ EAPI void e_container_shape_rects_set(E_Container_Shape *es, Ecore
EAPI void e_container_shape_solid_rect_set(E_Container_Shape *es, int x, int y, int w, int h);
EAPI void e_container_shape_solid_rect_get(E_Container_Shape *es, int *x, int *y, int *w, int *h);
EAPI void e_container_window_show(E_Container *con, Ecore_X_Window, int layer);
EAPI void e_container_window_hide(E_Container *con, Ecore_X_Window, int layer);
EAPI void e_container_window_raise(E_Container *con, Ecore_X_Window, int layer);
EAPI void e_container_window_lower(E_Container *con, Ecore_X_Window, int layer);
extern EAPI int E_EVENT_CONTAINER_RESIZE;
#endif

View File

@ -141,9 +141,3 @@ void e_move_update(int x, int y)
snprintf(buf, sizeof(buf) - 1, "%i %i", x, y);
edje_object_part_text_set(_obj, "text", buf);
}
void
e_moveresize_raise(void)
{
if (_ee) ecore_evas_raise(_ee);
}

View File

@ -9,5 +9,3 @@ EAPI void e_resize_update(int w, int h);
EAPI void e_move_begin(E_Zone *zone, int x, int y);
EAPI void e_move_end(void);
EAPI void e_move_update(int x, int y);
EAPI void e_moveresize_raise(void);