summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2014-04-11 19:01:17 +0200
committerManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2014-04-11 19:01:17 +0200
commit10430c175793f70dd195d684d1ac9bc3e3a21bfe (patch)
tree41976af9269599b4048378e71f6226571aef1aaf
parent515c38b0f5f84bba4b47ed2fc73b5e08ba56e68a (diff)
downloadweston-common-10430c175793f70dd195d684d1ac9bc3e3a21bfe.tar.gz
weston-common-10430c175793f70dd195d684d1ac9bc3e3a21bfe.tar.bz2
weston-common-10430c175793f70dd195d684d1ac9bc3e3a21bfe.zip
Add the wl-pre utility.
Change-Id: I3cfe6e729986296b9412896f79f53505fc9577d9 Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
-rw-r--r--packaging/weston-generic.spec1
-rw-r--r--tz-launcher/Makefile.am8
-rw-r--r--tz-launcher/wl-pre.c25
3 files changed, 33 insertions, 1 deletions
diff --git a/packaging/weston-generic.spec b/packaging/weston-generic.spec
index 42ae626..f17f393 100644
--- a/packaging/weston-generic.spec
+++ b/packaging/weston-generic.spec
@@ -151,3 +151,4 @@ ln -sf ../weston-user.service %{_unitdir_user}/default.target.wants/
%defattr(-,root,root)
%license tz-launcher/COPYING
%{_bindir}/tz-launcher
+%{_bindir}/wl-pre
diff --git a/tz-launcher/Makefile.am b/tz-launcher/Makefile.am
index d7e8eb8..c1ecd64 100644
--- a/tz-launcher/Makefile.am
+++ b/tz-launcher/Makefile.am
@@ -10,7 +10,7 @@ AM_CPPFLAGS = \
CLEANFILES =
-bin_PROGRAMS += tz-launcher
+bin_PROGRAMS += tz-launcher wl-pre
tz_launcher_LDFLAGS = -export-dynamic
tz_launcher_CPPFLAGS = $(AM_CPPFLAGS)
@@ -28,3 +28,9 @@ tz_launcher_SOURCES = \
toytoolkit/text-cursor-position-protocol.c \
toytoolkit/workspaces-protocol.c \
toytoolkit/window.c
+
+wl_pre_LDFLAGS = -export-dynamic
+wl_pre_CFLAGS = $(GCC_CFLAGS) $(CLIENT_CFLAGS)
+wl_pre_LDADD = $(DLOPEN_LIBS) $(CLIENT_LIBS)
+
+wl_pre_SOURCES = wl-pre.c
diff --git a/tz-launcher/wl-pre.c b/tz-launcher/wl-pre.c
new file mode 100644
index 0000000..275af41
--- /dev/null
+++ b/tz-launcher/wl-pre.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <wayland-client.h>
+
+
+int main (int argc, char *argv[])
+{
+ if (argc != 2) {
+ printf ("Usage : wl-pre \"<command line>\"\n");
+ return 0;
+ }
+
+ struct wl_display *display = NULL;
+
+ while (!display) {
+ display = wl_display_connect (NULL);
+ sleep (1);
+ }
+
+ char *command;
+ asprintf (&command, "%s &", argv[1]);
+ system (command);
+ free (command);
+
+ return 0;
+}