From 4195abe57a64309935d88515aff3cabda52d8559 Mon Sep 17 00:00:00 2001 From: Jiwoong Im Date: Wed, 6 May 2015 13:36:08 +0900 Subject: [PATCH] add ecore wayland event handler to support waylad. add ecore event handler to apply app lifecycle in wayland profile Jira ticket : TC-2503 Change-Id: I5f79d8928585603a31ccb55d02f40aff32b1bb51 Signed-off-by: Jiwoong Im --- src/appcore-efl.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/appcore-efl.c b/src/appcore-efl.c index f3527d4..0f9605f 100644 --- a/src/appcore-efl.c +++ b/src/appcore-efl.c @@ -214,6 +214,17 @@ static void __appcore_efl_memory_flush_cb(void) _DBG("[APP %d] __appcore_efl_memory_flush_cb()", _pid); elm_cache_all_flush(); } +#ifdef WAYLAND +static unsigned int win_id; + +static void wl_raise_win() +{ + _DBG("Raise window : %d", win_id); + Ecore_Wl_Window *win; + win = ecore_wl_window_find(win_id); + ecore_wl_window_activate(win); +} +#endif static void __do_app(enum app_event event, void *data, bundle * b) { @@ -264,6 +275,8 @@ static void __do_app(enum app_event event, void *data, bundle * b) _INFO("[APP %d] App already running, raise the window", _pid); #ifdef X11 x_raise_win(getpid()); +#else + wl_raise_win(); #endif if (ui->state == AS_PAUSED) { _INFO("[APP %d] Call the resume_cb", _pid); @@ -488,7 +501,7 @@ static void __set_wm_rotation_support(unsigned int win, unsigned int set) static Eina_Bool __show_cb(void *data, int type, void *event) { #ifdef WAYLAND - Ecore_Wl_Event_Window_Activate *ev; + Ecore_Wl_Event_Window_Show *ev; ev = event; @@ -505,7 +518,7 @@ static Eina_Bool __show_cb(void *data, int type, void *event) else __update_win((unsigned int)ev->win, FALSE); - __visibility_cb(data, type, event); + win_id = ev->win; #else Ecore_X_Event_Window_Show *ev; int ret; @@ -532,7 +545,7 @@ static Eina_Bool __show_cb(void *data, int type, void *event) static Eina_Bool __hide_cb(void *data, int type, void *event) { #ifdef WAYLAND - Ecore_Wl_Event_Window_Deactivate *ev; + Ecore_Wl_Event_Window_Hide *ev; int bvisibility = 0; ev = event; @@ -574,12 +587,10 @@ static Eina_Bool __hide_cb(void *data, int type, void *event) static Eina_Bool __visibility_cb(void *data, int type, void *event) { #ifdef WAYLAND - Ecore_Wl_Event_Window_Activate *ev; + Ecore_Wl_Event_Window_Visibility_Change *ev; int bvisibility = 0; - ev = event; - - __update_win((unsigned int)ev->win, ev->fobscured); + __update_win((unsigned int)ev->win, ev->fully_obscured); #else Ecore_X_Event_Window_Visibility_Change *ev; int bvisibility = 0; @@ -650,9 +661,12 @@ static void __add_climsg_cb(struct ui_priv *ui) _ret_if(ui == NULL); #ifdef WAYLAND ui->hshow = - ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_ACTIVATE, __show_cb, ui); + ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_SHOW, __show_cb, ui); ui->hhide = - ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_DEACTIVATE, __hide_cb, ui); + ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_HIDE, __hide_cb, ui); + ui->hvchange = + ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE, + __visibility_cb, ui); #else ui->hshow = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, __show_cb, ui); -- 2.7.4