[SDL_Tizen] Get a wayland window resource id 22/137022/2
authorhuiyu.eun <huiyu.eun@samsung.com>
Tue, 4 Jul 2017 06:32:28 +0000 (15:32 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Wed, 5 Jul 2017 05:51:33 +0000 (14:51 +0900)
Get a window resouce id using ECORE_WL_EVENT_WINDOW_SHOW event callback.
after that send id to indicator.

Change-Id: Idd2473ff53951095ec660cd2e50dbfa919a25e03
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/video/tizen/SDL_tizenwindow.c
src/video/tizen/SDL_tizenwindow.h

index 7811e2f..fccf554 100755 (executable)
@@ -118,7 +118,7 @@ static Eina_Bool _cb_client_add(void *data EINA_UNUSED, int type EINA_UNUSED, vo
     int window_w, window_h;
     ecore_wl_screen_size_get(&window_w, &window_h);
 
-    _tizen_ecore_ipc_client_send(OP_INDICATOR_SHOW, wind->rotation, 0, videoData->indicator_mode);
+    _tizen_ecore_ipc_client_send(OP_INDICATOR_SHOW, wind->rotation, wind->g_res_id, videoData->indicator_mode);
 
     return ECORE_CALLBACK_DONE;
 }
@@ -856,6 +856,27 @@ _tizen_cb_event_window_rotate(void *data, int type EINA_UNUSED, void *event)
     return ECORE_CALLBACK_PASS_ON;
 }
 
+static Eina_Bool _tizen_cb_event_window_show(void *data, int type, void *event)
+{
+    Ecore_Wl_Event_Window_Show *e;
+    uint32_t g_res_id = 0;
+
+    e = event;
+    if (e->data[0] > 0)
+        g_res_id = e->data[0];
+
+    if(g_res_id!=0)
+    {
+        SDL_VideoData *this = SDL_GetVideoDevice()->driverdata;
+        SDL_Window * window = (SDL_Window*)eina_hash_find(this->windows, &e->win);
+        SDL_WindowData *wind = window->driverdata;
+        wind->g_res_id = g_res_id;
+        SDL_Log("[SDL] SDL Window Resource ID %d", g_res_id);
+    }
+
+    return ECORE_CALLBACK_PASS_ON;
+}
+
 int
 Tizen_InitWindow(_THIS)
 {
@@ -869,6 +890,8 @@ Tizen_InitWindow(_THIS)
                         _tizen_cb_event_window_rotate,_this);
     ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE,
                         _tizen_cb_window_configure,_this);
+    ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_SHOW,
+                        _tizen_cb_event_window_show, _this);
 
     ecore_event_handler_add(ECORE_EVENT_KEY_UP,
                         _tizen_cb_event_keyup_change,_this);
index cb0da77..e780a3c 100755 (executable)
@@ -33,6 +33,7 @@
 #include <wayland-egl.h>
 
 typedef struct {
+    uint32_t g_res_id;         /* Wayland window resource id */
     uint32_t id;               /* Ecore wayland window id */
 
     Ecore_Wl_Window *window;