summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Lynch <rusty.lynch@intel.com>2013-08-08 21:28:22 -0700
committerKristian Høgsberg <krh@bitplanet.net>2013-08-20 16:11:08 -0700
commitdf67fd060f492748a217f11dfa75b8a9e6fbbaf2 (patch)
treeeed6ca5d82c4da9812dc9582dd411987180fe315
parent1604b742a14b9862b1ce4e61a5caceda3a75482f (diff)
downloadweston-df67fd060f492748a217f11dfa75b8a9e6fbbaf2.tar.gz
weston-df67fd060f492748a217f11dfa75b8a9e6fbbaf2.tar.bz2
weston-df67fd060f492748a217f11dfa75b8a9e6fbbaf2.zip
desktop-shell: Add touch support to panel launcher icons
-rw-r--r--clients/desktop-shell.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 6c29e7cb..b2082f3d 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -318,6 +318,31 @@ panel_launcher_button_handler(struct widget *widget,
widget_schedule_redraw(widget);
if (state == WL_POINTER_BUTTON_STATE_RELEASED)
panel_launcher_activate(launcher);
+
+}
+
+static void
+panel_launcher_touch_down_handler(struct widget *widget, uint32_t serial,
+ uint32_t time, int32_t id,
+ float x, float y, void *data)
+{
+ struct panel_launcher *launcher;
+
+ launcher = widget_get_user_data(widget);
+ launcher->focused = 1;
+ widget_schedule_redraw(widget);
+}
+
+static void
+panel_launcher_touch_up_handler(struct widget *widget, uint32_t serial,
+ uint32_t time, int32_t id, void *data)
+{
+ struct panel_launcher *launcher;
+
+ launcher = widget_get_user_data(widget);
+ launcher->focused = 0;
+ widget_schedule_redraw(widget);
+ panel_launcher_activate(launcher);
}
static void
@@ -640,6 +665,10 @@ panel_add_launcher(struct panel *panel, const char *icon, const char *path)
panel_launcher_leave_handler);
widget_set_button_handler(launcher->widget,
panel_launcher_button_handler);
+ widget_set_touch_down_handler(launcher->widget,
+ panel_launcher_touch_down_handler);
+ widget_set_touch_up_handler(launcher->widget,
+ panel_launcher_touch_up_handler);
widget_set_redraw_handler(launcher->widget,
panel_launcher_redraw_handler);
widget_set_motion_handler(launcher->widget,