include Makefile_Ector.am
include Makefile_Evas.am
include Makefile_Ecore.am
-include Makefile_Ecore_Con.am
-include Makefile_Ecore_Ipc.am
-include Makefile_Ecore_File.am
+### TIZEN ONLY (151223): request e19 compositor to create sockets
+#include Makefile_Ecore_Con.am
+#include Makefile_Ecore_Ipc.am
+#include Makefile_Ecore_File.am
+### TIZEN ONLY: END
include Makefile_Ecore_Input.am
include Makefile_Ecore_Input_Evas.am
include Makefile_Ecore_Cocoa.am
include Makefile_Ecore_Psl1ght.am
include Makefile_Ecore_SDL.am
include Makefile_Ecore_Wayland.am
+### TIZEN ONLY (151223): request e19 compositor to create sockets
+include Makefile_Ecore_Con.am
+include Makefile_Ecore_Ipc.am
+include Makefile_Ecore_File.am
+###
include Makefile_Ecore_Win32.am
include Makefile_Ecore_X.am
include Makefile_Ecore_IMF.am
#include "Ecore_Con.h"
#include "ecore_con_private.h"
+// TIZEN ONLY (151223): request e19 compositor to create socket
+#include "Ecore_Wayland.h"
+#include <wayland-server.h>
+#include <tizen-extension-client-protocol.h>
+// TIZEN ONLY: END
#define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + \
(size_t)(((struct sockaddr_un *)NULL)-> \
static const char *_ecore_con_local_path_get()
{
- const char *homedir = getenv("XDG_RUNTIME_DIR");
+ // TIZEN ONLY (151223): change socket folder to avoid SMACK issue in Tizen 3.0
+ /*const char *homedir = getenv("XDG_RUNTIME_DIR");
if (!homedir) homedir = eina_environment_home_get();
if (!homedir) homedir = eina_environment_tmp_get();
- return homedir;
+ return homedir;*/
+ return "/run/.efl";
+ // TIZEN ONLY (151223): END
}
int
return _ecore_con_local_init_count;
}
+// TIZEN ONLY (151223): request e19 compositor to create socket
+static void
+_ecore_con_compositor_socket(void *data, struct tizen_embedded_compositor *tec EINA_UNUSED, int fd)
+{
+ int *socket_fd = (int *)data;
+
+ *socket_fd = fd;
+ return;
+}
+
+static const struct tizen_embedded_compositor_listener tizen_embedded_compositor_listener =
+{
+ _ecore_con_compositor_socket
+};
+
+static int
+_ecore_con_local_get_socket_from_server()
+{
+ Eina_Inlist *l, *tmp;
+ Ecore_Wl_Global *global;
+ struct tizen_embedded_compositor *tec = NULL;
+ int fd = -1;
+
+ l = ecore_wl_globals_get();
+ if (!l)
+ {
+ DBG("Cannot get wl globals");
+ return -1;
+ }
+
+ EINA_INLIST_FOREACH_SAFE(l, tmp, global)
+ {
+ if (!strcmp(global->interface, "tizen_embedded_compositor"))
+ {
+ tec = wl_registry_bind(ecore_wl_registry_get(),
+ global->id,
+ &tizen_embedded_compositor_interface,
+ 1);
+ tizen_embedded_compositor_add_listener(tec,
+ &tizen_embedded_compositor_listener,
+ &fd);
+ break;
+ }
+ }
+
+ if (!tec)
+ {
+ DBG("Cannot find tizen embedded compositor");
+ return -1;
+ }
+
+ tizen_embedded_compositor_get_socket(tec);
+ ecore_wl_sync();
+
+ tizen_embedded_compositor_destroy(tec);
+ return fd;
+}
+// TIZEN ONLY: END
+
int
ecore_con_local_connect(Ecore_Con_Server *obj,
Eina_Bool (*cb_done)(void *data, Ecore_Fd_Handler *fd_handler),
buf[sizeof(buf) - 1] = 0;
}
- svr->fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ // TIZEN ONLY (151223): request e19 compositor to create socket
+ //svr->fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ svr->fd = _ecore_con_local_get_socket_from_server();
+ if (svr->fd < 0)
+ {
+ svr->fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ DBG("efd < 0: get socket by ourself: %d", svr->fd);
+ }
+ // TIZEN ONLY: END
if (svr->fd < 0)
return 0;
#else
(void)abstract_socket;
#endif
- svr->fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ // TIZEN ONLY (151223): request e19 compositor to create socket
+ //svr->fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ svr->fd = _ecore_con_local_get_socket_from_server();
+ if (svr->fd < 0)
+ {
+ svr->fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ DBG("listen: socket from e19 < 0, get it ourself: %d", svr->fd);
+ }
+ // TIZEN ONLY: END
if (svr->fd < 0)
goto error_umask;