xwayland: Create the wl_client which represents the window manager
authorChris Michael <cp.michael@samsung.com>
Sun, 6 Jul 2014 14:51:01 +0000 (10:51 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 26 Jun 2015 00:04:30 +0000 (20:04 -0400)
process.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/modules/xwayland/e_mod_main.c

index fe8b64e..5ff6d55 100644 (file)
@@ -8,10 +8,12 @@ typedef struct _E_XWayland_Server E_XWayland_Server;
 struct _E_XWayland_Server
 {
    int disp;
-   int abs_fd, unx_fd;
+   int abs_fd, unx_fd, wm_fd;
    char lock[256];
 
+   struct wl_display *wl_disp;
    struct wl_event_loop *loop;
+   struct wl_client *client;
 
    Ecore_Fd_Handler *abs_hdlr, *unx_hdlr;
    Ecore_Event_Handler *sig_hdlr;
@@ -214,9 +216,11 @@ fail:
         break;
       default:
         close(socks[1]);
-        /* TODO: client_create */
+        exs->client = wl_client_create(exs->disp, socks[0]);
+
         close(wms[1]);
-        /* TODO */
+        exs->wm_fd = wms[0];
+
         /* TODO: remove event sources */
         break;
       case -1:
@@ -230,15 +234,16 @@ fail:
 static Eina_Bool 
 _cb_signal_event(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
 {
-   /* E_XWayland_Server *exs; */
-
    /* NB: SIGUSR1 comes from XWayland Server when it has finished 
     * initialized. */
 
-   /* if (!(exs = data)) return ECORE_CALLBACK_RENEW; */
-
    /* TODO: create "window manager" process */
 
+   /* TODO: NB: 
+    * 
+    * Weston creates a smaller window manager process here.
+    * We Maybe able to just do e_comp_x_init, but will have to test that */
+
    return ECORE_CALLBACK_RENEW;
 }
 
@@ -261,6 +266,9 @@ e_modapi_init(E_Module *m)
    if (!(exs = calloc(1, sizeof(E_XWayland_Server))))
      return NULL;
 
+   /* record wayland display */
+   exs->wl_disp = comp->wl_comp_data->wl.disp;
+
    /* default display to zero */
    exs->disp = 0;