From 7f5601e4b2779cb4b61b59bf98163f69eba08f63 Mon Sep 17 00:00:00 2001 From: sebastid Date: Thu, 28 Apr 2005 09:55:41 +0000 Subject: [PATCH] Window layers, incomplete. SVN revision: 14446 --- src/bin/e_border.c | 66 ++++++++++++------------------------------ src/bin/e_border.h | 2 ++ src/bin/e_container.c | 66 ++++++++++++++++++++++++++++++++++++++++++ src/bin/e_container.h | 7 +++++ src/bin/e_moveresize.c | 6 ---- src/bin/e_moveresize.h | 2 -- 6 files changed, 93 insertions(+), 56 deletions(-) diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 887eda648..9cb33dc01 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -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; } diff --git a/src/bin/e_border.h b/src/bin/e_border.h index b8823aa9f..bf032e917 100644 --- a/src/bin/e_border.h +++ b/src/bin/e_border.h @@ -216,6 +216,8 @@ struct _E_Border unsigned char start : 1; int x, y; } drag; + + unsigned int layer; }; struct _E_Border_Pending_Move_Resize diff --git a/src/bin/e_container.c b/src/bin/e_container.c index 3fc43ce7e..e8bab887c 100644 --- a/src/bin/e_container.c +++ b/src/bin/e_container.c @@ -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) diff --git a/src/bin/e_container.h b/src/bin/e_container.h index 037c8b453..25493f8e4 100644 --- a/src/bin/e_container.h +++ b/src/bin/e_container.h @@ -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 diff --git a/src/bin/e_moveresize.c b/src/bin/e_moveresize.c index 337a37776..110655271 100644 --- a/src/bin/e_moveresize.c +++ b/src/bin/e_moveresize.c @@ -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); -} diff --git a/src/bin/e_moveresize.h b/src/bin/e_moveresize.h index 867475df3..4551a1d27 100644 --- a/src/bin/e_moveresize.h +++ b/src/bin/e_moveresize.h @@ -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);