summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2014-04-14 14:45:30 +0200
committerManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2014-04-14 14:45:30 +0200
commit9f318cd63b126cb45fe8891885ce64f522986079 (patch)
treea1c320eacdd7a1e5a3d96ebdd76c828dcd977e6f
parent2a3379c59cd6f1714c34b8560d6cee096eee38b5 (diff)
downloadweston-common-9f318cd63b126cb45fe8891885ce64f522986079.tar.gz
weston-common-9f318cd63b126cb45fe8891885ce64f522986079.tar.bz2
weston-common-9f318cd63b126cb45fe8891885ce64f522986079.zip
tz-launcher: implement touchscreen actions
Change-Id: I022ea614e23e385481fcd7e7a3fd9558a052b3ff Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
-rw-r--r--tz-launcher/tz-launcher-wl.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/tz-launcher/tz-launcher-wl.c b/tz-launcher/tz-launcher-wl.c
index 70b83f5..1213717 100644
--- a/tz-launcher/tz-launcher-wl.c
+++ b/tz-launcher/tz-launcher-wl.c
@@ -189,6 +189,34 @@ launcher_button_handler(struct widget *widget,
}
}
+static void
+launcher_touch_up_handler(struct widget *widget, struct input *input,
+ uint32_t serial, uint32_t time, int32_t id,
+ float x, float y, void *data)
+{
+ struct launcher *launcher = data;
+
+ launcher->focused = 0;
+ widget_schedule_redraw(widget);
+
+ gchar *command = g_strconcat (launcher->exec, " &", NULL);
+ system (command);
+ g_free (command);
+}
+
+static void
+launcher_touch_down_handler(struct widget *widget, struct input *input,
+ uint32_t serial, uint32_t time, int32_t id,
+ float x, float y, void *data)
+{
+ struct launcher *launcher = data;
+
+ launcher->focused = 1;
+ widget_schedule_redraw(widget);
+
+ main_window->selected_launcher = launcher;
+}
+
static int
launcher_enter_handler(struct widget *widget, struct input *input,
float x, float y, void *data)
@@ -278,6 +306,8 @@ main_window_add_launcher (gchar **desktopentry)
widget_set_leave_handler(launcher->widget, launcher_leave_handler);
widget_set_motion_handler(launcher->widget, launcher_motion_handler);
widget_set_button_handler(launcher->widget, launcher_button_handler);
+ widget_set_touch_down_handler(launcher->widget, launcher_touch_down_handler);
+ widget_set_touch_up_handler(launcher->widget, launcher_touch_up_handler);
widget_set_redraw_handler(launcher->widget, launcher_redraw_handler);
}