[PATCH weston 3/3] ivi-shell: add exit binding

Pekka Paalanen ppaalanen at gmail.com
Mon Mar 2 00:33:29 PST 2015


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Let's me easily exit ivi-shell when testing with the DRM-backend.
Only available in ivi-shell developer mode.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Acked-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA at xddp.denso.co.jp>
---
 ivi-shell/ivi-shell.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
index 5e437fa..362a3c3 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -36,6 +36,7 @@
 #include <dlfcn.h>
 #include <limits.h>
 #include <assert.h>
+#include <linux/input.h>
 
 #include "ivi-shell.h"
 #include "ivi-application-server-protocol.h"
@@ -355,6 +356,15 @@ shell_destroy(struct wl_listener *listener, void *data)
 }
 
 static void
+terminate_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
+		  void *data)
+{
+	struct weston_compositor *compositor = data;
+
+	wl_display_terminate(compositor->wl_display);
+}
+
+static void
 init_ivi_shell(struct weston_compositor *compositor, struct ivi_shell *shell,
 	       const struct ivi_shell_setting *setting)
 {
@@ -364,8 +374,14 @@ init_ivi_shell(struct weston_compositor *compositor, struct ivi_shell *shell,
 
 	weston_layer_init(&shell->input_panel_layer, NULL);
 
-	if (setting->developermode)
+	if (setting->developermode) {
 		weston_install_debug_key_binding(compositor, MODIFIER_SUPER);
+
+		weston_compositor_add_key_binding(compositor, KEY_BACKSPACE,
+						  MODIFIER_CTRL | MODIFIER_ALT,
+						  terminate_binding,
+						  compositor);
+	}
 }
 
 static int
-- 
2.0.5



More information about the wayland-devel mailing list