[PATCH weston] desktop-shell: Add touch support for unlock

Brian Lovin brian.j.lovin at intel.com
Mon Aug 26 14:25:44 PDT 2013


Added support for touching the green unlock button.

Signed-off-by: Brian Lovin <brian.j.lovin at intel.com>
---
 clients/desktop-shell.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 319382d..3f49f7d 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -833,6 +833,19 @@ unlock_dialog_button_handler(struct widget *widget,
 }
 
 static void
+unlock_dialog_touch_handler(struct widget *widget, struct input *input,
+		   uint32_t serial, uint32_t time, int32_t id,
+		   float x, float y, void *data)
+{
+	struct unlock_dialog *dialog = data;
+	struct desktop *desktop = dialog->desktop;
+
+	display_defer(desktop->display, &desktop->unlock_task);
+	dialog->closing = 1;
+}
+
+
+static void
 unlock_dialog_keyboard_focus_handler(struct window *window,
 				     struct input *device, void *data)
 {
@@ -886,6 +899,8 @@ unlock_dialog_create(struct desktop *desktop)
 				 unlock_dialog_widget_leave_handler);
 	widget_set_button_handler(dialog->button,
 				  unlock_dialog_button_handler);
+	widget_set_touch_down_handler(dialog->button,
+				      unlock_dialog_touch_handler);
 
 	desktop_shell_set_lock_surface(desktop->shell,
 				       window_get_wl_surface(dialog->window));
-- 
1.8.1.2



More information about the wayland-devel mailing list