From: Doyoun Kang Date: Thu, 9 Nov 2017 05:30:02 +0000 (+0900) Subject: ecore_wl2: modified code to handle iconic state X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~1055 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36c3e23d2e291ca125fc8b22149cd23c6ed00b68;p=platform%2Fupstream%2Fefl.git ecore_wl2: modified code to handle iconic state @tizen_feature Change-Id: I6d99a35e318cc5ac0cb5f0fed40125f376ec2915 --- diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 3253000..51fb42d 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -1220,6 +1220,10 @@ EAPI Eina_Bool ecore_wl2_window_iconified_get(Ecore_Wl2_Window *window); */ EAPI void ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified); +// TIZEN_ONLY(20151231) : handling iconic state on tizen +EAPI void ecore_wl2_window_iconify_state_update(Ecore_Wl2_Window *window, Eina_Bool iconified, Eina_Bool send_event); +// + /** * Set the type of a given window * diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c index 1030490..f4c5d9f 100644 --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -1055,9 +1055,69 @@ ecore_wl2_window_iconified_get(Ecore_Wl2_Window *window) return window->set_config.minimized; } +// TIZEN_ONLY(20151231) : handling iconic state on tizen +static void +_ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified, Eina_Bool send_event) +{ + EINA_SAFETY_ON_NULL_RETURN(window); + + iconified = !!iconified; + window->minimized = iconified; + + if (iconified) + { + if ((window->surface) && (window->display->wl.tz_policy)) + { + if (send_event) + tizen_policy_iconify(window->display->wl.tz_policy, window->surface); + window->iconified = EINA_TRUE; + } + + else if (window->zxdg_toplevel) + zxdg_toplevel_v6_set_minimized(window->zxdg_toplevel); + } + else + { + if ((window->surface) && (window->display->wl.tz_policy)) + { + if (send_event) + tizen_policy_uniconify(window->display->wl.tz_policy, window->surface); + window->iconified = EINA_FALSE; + } + + else if (window->zxdg_toplevel) + { + struct wl_array states; + uint32_t *s; + + wl_array_init(&states); + s = wl_array_add(&states, sizeof(*s)); + *s = ZXDG_TOPLEVEL_V6_STATE_ACTIVATED; + _zxdg_toplevel_cb_configure(window, window->zxdg_toplevel, + window->geometry.w, + window->geometry.h, &states); + wl_array_release(&states); + } + } + + if (send_event) + { + Ecore_Wl2_Event_Window_Iconify_State_Change *ev; + + if (!(ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Iconify_State_Change)))) return; + ev->win = window->id; + ev->iconified = iconified; + ev->force = 0; + ecore_event_add(ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE, ev, NULL, NULL); + } +} +// + EAPI void ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified) { + // TIZEN_ONLY(20151231) : handling iconic state on tizen + /* Eina_Bool prev; EINA_SAFETY_ON_NULL_RETURN(window); @@ -1089,8 +1149,19 @@ ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified) wl_array_release(&states); } } + */ + _ecore_wl2_window_iconified_set(window, iconified, EINA_TRUE); + // } +// TIZEN_ONLY(20151231) : handling iconic state on tizen +EAPI void +ecore_wl2_window_iconify_state_update(Ecore_Wl2_Window *window, Eina_Bool iconified, Eina_Bool send_event) +{ + _ecore_wl2_window_iconified_set(window, iconified, send_event); +} +// + EAPI void ecore_wl2_window_type_set(Ecore_Wl2_Window *window, Ecore_Wl2_Window_Type type) { diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index 81dbd91..2172268 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -32,6 +32,7 @@ static Eina_Array *_ecore_evas_wl_event_hdls; static void _ecore_evas_wayland_resize(Ecore_Evas *ee, int location); static void _ecore_evas_wl_common_rotation_set(Ecore_Evas *ee, int rotation, int resize); +static void _ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, Eina_Bool on); /* local functions */ static void @@ -1171,17 +1172,31 @@ _ecore_evas_wl_common_cb_iconify_state_change(void *data EINA_UNUSED, int type E { Ecore_Evas *ee; Ecore_Wl2_Event_Window_Iconify_State_Change *ev; + // TIZEN_ONLY(20151231) : handling iconic state on tizen + Ecore_Evas_Engine_Wl_Data *wdata; + // ev = event; ee = ecore_event_window_match(ev->win); if (!ee) return ECORE_CALLBACK_PASS_ON; + // TIZEN_ONLY(20151231) : handling iconic state on tizen + /* if (!ev->force) return ECORE_CALLBACK_PASS_ON; + */ + // if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; if (ee->prop.iconified == ev->iconified) return ECORE_CALLBACK_PASS_ON; ee->prop.iconified = ev->iconified; + + // TIZEN_ONLY(20151231) : handling iconic state on tizen + wdata = ee->engine.data; + if (wdata && ev->force) + ecore_wl2_window_iconify_state_update(wdata->win, ev->iconified, EINA_FALSE); + // + _ecore_evas_wl_common_state_update(ee); return ECORE_CALLBACK_PASS_ON; } @@ -1509,6 +1524,9 @@ _ecore_evas_wl_common_activate(Ecore_Evas *ee) wdata = ee->engine.data; ecore_evas_show(ee); + if (ee->prop.iconified) + _ecore_evas_wl_common_iconified_set(ee, EINA_FALSE); + ecore_wl2_window_activate(wdata->win); } //