From e30a6285c1a56383debfb31ec58034ba833172f9 Mon Sep 17 00:00:00 2001 From: Sungbae Park Date: Mon, 16 May 2016 10:52:17 +0900 Subject: [PATCH] first map policy add[post_raise, post_lower] Signed-off-by: Sungbae Park Change-Id: I493302190b6daa8ad28b3842a15dcf8de2cae583 --- src/bin/e_client.c | 23 ++++++++++++++++++ src/bin/e_client.h | 5 ++++ src/modules/wl_desktop_shell/e_mod_main.c | 39 +++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 82cc492..7c4bfbf 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -3046,6 +3046,26 @@ e_client_visibility_calculate(void) _e_calc_visibility = EINA_TRUE; } +E_API void +e_client_post_raise_lower_set(E_Client *ec, Eina_Bool raise_set, Eina_Bool lower_set) +{ + if (!ec) return; + + if (!ec->first_mapped) + { + ec->post_raise = raise_set; + ec->post_lower = lower_set; + } +} + +E_API Eina_Bool +e_client_first_mapped_get(E_Client *ec) +{ + if (!ec) return EINA_FALSE; + + return ec->first_mapped; +} + //////////////////////////////////////////////// EINTERN void e_client_idler_before(void) @@ -3264,6 +3284,9 @@ e_client_new(E_Pixmap *cp, int first_map, int internal) e_pixmap_client_set(cp, ec); ec->resize_mode = E_POINTER_RESIZE_NONE; ec->layer = E_LAYER_CLIENT_NORMAL; + ec->first_mapped = EINA_FALSE; + ec->post_raise = EINA_TRUE; + ec->post_lower = EINA_FALSE; /* FIXME: if first_map is 1 then we should ignore the first hide event * or ensure the window is already hidden and events flushed before we diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 3306205..26fc521 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -810,6 +810,9 @@ struct E_Client Eina_Bool keyboard_resizing : 1; Eina_Bool gesture_disable : 1; Eina_Bool floating : 1; //client is set as floating mode + Eina_Bool first_mapped : 1; + Eina_Bool post_raise : 1; + Eina_Bool post_lower : 1; Eina_Bool on_post_updates : 1; // client is on the post update list #ifdef HAVE_WAYLAND @@ -1001,6 +1004,8 @@ E_API Eina_Bool e_client_desk_window_profile_available_check(E_Client *ec, const E_API void e_client_desk_window_profile_wait_desk_set(E_Client *ec, E_Desk *desk); E_API void e_client_layout_cb_set(E_Client_Layout_Cb cb); E_API void e_client_visibility_calculate(void); +E_API void e_client_post_raise_lower_set(E_Client *ec, Eina_Bool raise_set, Eina_Bool lower_set); +E_API Eina_Bool e_client_first_mapped_get(E_Client *ec); E_API void e_client_transform_update(E_Client *ec); E_API void e_client_transform_apply(E_Client *ec, double degree, double zoom, int cx, int cy); diff --git a/src/modules/wl_desktop_shell/e_mod_main.c b/src/modules/wl_desktop_shell/e_mod_main.c index 044ac98..a9390f0 100644 --- a/src/modules/wl_desktop_shell/e_mod_main.c +++ b/src/modules/wl_desktop_shell/e_mod_main.c @@ -501,6 +501,19 @@ _e_shell_surface_map(struct wl_resource *resource) evas_object_geometry_set(ec->frame, ec->x, ec->y, ec->w, ec->h); evas_object_show(ec->frame); ec->comp_data->mapped = EINA_TRUE; + + if ((!ec->first_mapped) && (!ec->iconic) && (!e_client_util_ignored_get(ec))) + { + if (!ec->comp_data->sub.data) + { + if (ec->post_lower) + evas_object_lower(ec->frame); + else if (ec->post_raise) + evas_object_raise(ec->frame); + } + } + + ec->first_mapped = 1; } } @@ -1069,6 +1082,19 @@ _e_xdg_shell_surface_map_cb_timer(void *data) * respective parents... */ /* if (ec->netwm.type == E_WINDOW_TYPE_POPUP_MENU) */ /* e_client_raise_latest_set(ec); */ + + if ((!ec->first_mapped) && (!ec->iconic) && (!e_client_util_ignored_get(ec))) + { + if (!ec->comp_data->sub.data) + { + if (ec->post_lower) + evas_object_lower(ec->frame); + else if (ec->post_raise) + evas_object_raise(ec->frame); + } + } + + ec->first_mapped = 1; } ec->map_timer = NULL; return ECORE_CALLBACK_CANCEL; @@ -1139,6 +1165,19 @@ _e_xdg_shell_surface_map(struct wl_resource *resource) * respective parents... */ /* if (ec->netwm.type == E_WINDOW_TYPE_POPUP_MENU) */ /* e_client_raise_latest_set(ec); */ + + if ((!ec->first_mapped) && (!ec->iconic) && (!e_client_util_ignored_get(ec))) + { + if (!ec->comp_data->sub.data) + { + if (ec->post_lower) + evas_object_lower(ec->frame); + else if (ec->post_raise) + evas_object_raise(ec->frame); + } + } + + ec->first_mapped = 1; } TRACE_DS_END(); -- 2.7.4