downstream: Add the processing which has notice of click event from compositor
[profile/ivi/weston-ivi-shell.git] / 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 */