[PATCH weston v2 07/10] ivi-shell: Support tracking active surfaces
Bryce Harrington
bryce at osg.samsung.com
Thu Mar 24 18:27:51 UTC 2016
Activity for ivi-shell follows either click or touch. Only a single
surface can be active in the shell at a time.
Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
---
ivi-shell/ivi-shell.c | 10 ++++++++++
ivi-shell/ivi-shell.h | 2 ++
2 files changed, 12 insertions(+)
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
index a767ccf..c5ef623 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -432,11 +432,16 @@ static void
click_to_activate_binding(struct weston_pointer *pointer, uint32_t time,
uint32_t button, void *data)
{
+ struct ivi_shell *shell = data;
+
if (pointer->grab != &pointer->default_grab)
return;
if (pointer->focus == NULL)
return;
+ if (shell->active_surface != NULL)
+ weston_surface_deactivate(shell->active_surface, pointer->seat);
+
activate_binding(pointer->seat, pointer->focus);
}
@@ -444,11 +449,16 @@ static void
touch_to_activate_binding(struct weston_touch *touch, uint32_t time,
void *data)
{
+ struct ivi_shell *shell = data;
+
if (touch->grab != &touch->default_grab)
return;
if (touch->focus == NULL)
return;
+ if (shell->active_surface != NULL)
+ weston_surface_deactivate(shell->active_surface, touch->seat);
+
activate_binding(touch->seat, touch->focus);
}
diff --git a/ivi-shell/ivi-shell.h b/ivi-shell/ivi-shell.h
index 9a05eb2..87bce3a 100644
--- a/ivi-shell/ivi-shell.h
+++ b/ivi-shell/ivi-shell.h
@@ -55,6 +55,8 @@ struct ivi_shell
struct wl_resource *binding;
struct wl_list surfaces;
} input_panel;
+
+ struct weston_surface *active_surface;
};
struct weston_view *
--
1.9.1
More information about the wayland-devel
mailing list