add ecore wayland event handler to support waylad. 81/38981/4 accepted/tizen/common/20150507.063704 accepted/tizen/common/20150511.125815 accepted/tizen/mobile/20150507.143427 accepted/tizen/mobile/20150511.133224 accepted/tizen/tv/20150512.050531 accepted/tizen/wearable/20150511.132806 submit/tizen/20150506.100617 submit/tizen/20150511.055337 submit/tizen_mobile/20150508.065320
authorJiwoong Im <jiwoong.im@samsung.com>
Wed, 6 May 2015 04:36:08 +0000 (13:36 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Wed, 6 May 2015 09:05:35 +0000 (18:05 +0900)
add ecore event handler to apply app lifecycle in wayland profile

Jira ticket : TC-2503

Change-Id: I5f79d8928585603a31ccb55d02f40aff32b1bb51
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
src/appcore-efl.c

index f3527d4..0f9605f 100644 (file)
@@ -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);