win: add Cocoa support for elm_win_window_id_get() API
authorJean Guyomarc'h <jean.guyomarch@openwide.fr>
Tue, 13 Oct 2015 14:40:49 +0000 (16:40 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Thu, 3 Dec 2015 19:05:58 +0000 (11:05 -0800)
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
legacy/elementary/src/lib/elm_win.c

index 695991b..2bf97e2 100644 (file)
@@ -5553,6 +5553,20 @@ _elm_win_window_id_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
         if (sd->parent) return (Ecore_Window)elm_win_xwindow_get(sd->parent);
 #endif
      }
+   else if (engine_name &&
+            ((!strcmp(engine_name, ELM_OPENGL_COCOA)) ||
+             (!strcmp(engine_name, "gl_cocoa"))))
+     {
+#ifdef HAVE_ELEMENTARY_COCOA
+        if (sd->cocoa.win) return (Ecore_Window)(sd->cocoa.win);
+        if (sd->parent)
+          {
+             Ecore_Cocoa_Window *pwin;
+             eo_do(sd->parent, pwin = elm_obj_win_cocoa_window_get());
+             return (Ecore_Window)pwin;
+          }
+#endif
+     }
 
    return 0;
 }