downstream: Add the processing which has notice of click event from compositor 72/32872/1 accepted/tizen/ivi/20141231.002412 submit/tizen_ivi/20141229.143715
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Mon, 29 Dec 2014 09:12:50 +0000 (11:12 +0200)
committerJan Ekström <jan.ekstrom@intel.com>
Mon, 29 Dec 2014 12:56:12 +0000 (14:56 +0200)
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Change-Id: I1a2b6776a18b1e201f33ebaa9df382148a7adbe0

ivi-shell/ivi-shell.c

index 3c0800d..b0f79a8 100644 (file)
@@ -622,6 +622,20 @@ get_wl_shell_info(struct ivi_layout_surface *layout_surface, uint32_t id_surface
        }
 }
 
+static void
+click_to_activate_binding(struct weston_seat *seat, uint32_t time, uint32_t button,
+                          void *data)
+{
+       if (seat->pointer->grab != &seat->pointer->default_grab) {
+               return;
+       }
+       if (seat->pointer->focus == NULL) {
+               return;
+       }
+
+       weston_surface_activate(seat->pointer->focus->surface, seat);
+}
+
 /*
  * Initialization of ivi-shell.
  */
@@ -723,6 +737,8 @@ module_init(struct weston_compositor *compositor,
                return -1;
        }
 
+       weston_compositor_add_button_binding(compositor, BTN_LEFT, 0, click_to_activate_binding, shell);
+
        free(setting.ivi_module);
 
        /* Initialize ivi-shell-ext. wl_shell is supported here */