summaryrefslogtreecommitdiff
path: root/libweston
diff options
context:
space:
mode:
authorBryce Harrington <bryce@osg.samsung.com>2016-06-29 19:04:07 -0700
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-06-30 13:15:33 +0300
commit24f917e723c2d00091ce772f89399da13f4d8ad6 (patch)
treeb45643ce31da1fe77af9d1004111759210aac22f /libweston
parent260c2ffd97f2862b7b8de16bc61abcc49d9a1c35 (diff)
downloadweston-24f917e723c2d00091ce772f89399da13f4d8ad6.tar.gz
weston-24f917e723c2d00091ce772f89399da13f4d8ad6.tar.bz2
weston-24f917e723c2d00091ce772f89399da13f4d8ad6.zip
input: Move weston_seat_set_keyboard_focus and document
Place it with the other weston_seat functions. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'libweston')
-rw-r--r--libweston/compositor.h7
-rw-r--r--libweston/input.c34
2 files changed, 23 insertions, 18 deletions
diff --git a/libweston/compositor.h b/libweston/compositor.h
index 5701a054..49ef0631 100644
--- a/libweston/compositor.h
+++ b/libweston/compositor.h
@@ -1167,9 +1167,6 @@ int
weston_spring_done(struct weston_spring *spring);
void
-weston_seat_set_keyboard_focus(struct weston_seat *seat,
- struct weston_surface *surface);
-void
notify_motion(struct weston_seat *seat, uint32_t time,
struct weston_pointer_motion_event *event);
void
@@ -1717,6 +1714,10 @@ weston_seat_get_pointer(struct weston_seat *seat);
struct weston_touch *
weston_seat_get_touch(struct weston_seat *seat);
+void
+weston_seat_set_keyboard_focus(struct weston_seat *seat,
+ struct weston_surface *surface);
+
#ifdef __cplusplus
}
#endif
diff --git a/libweston/input.c b/libweston/input.c
index e8c060eb..8f46698e 100644
--- a/libweston/input.c
+++ b/libweston/input.c
@@ -1297,21 +1297,6 @@ notify_motion_absolute(struct weston_seat *seat,
}
WL_EXPORT void
-weston_seat_set_keyboard_focus(struct weston_seat *seat,
- struct weston_surface *surface)
-{
- struct weston_compositor *compositor = seat->compositor;
- struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat);
-
- if (keyboard) {
- weston_keyboard_set_focus(keyboard, surface);
- wl_data_device_set_keyboard_focus(seat);
- }
-
- wl_signal_emit(&compositor->activate_signal, surface);
-}
-
-WL_EXPORT void
notify_button(struct weston_seat *seat, uint32_t time, int32_t button,
enum wl_pointer_button_state state)
{
@@ -2763,3 +2748,22 @@ weston_seat_get_touch(struct weston_seat *seat)
return NULL;
}
+
+/** Sets the keyboard focus to the given surface
+ *
+ * \param seat The seat to query
+ */
+WL_EXPORT void
+weston_seat_set_keyboard_focus(struct weston_seat *seat,
+ struct weston_surface *surface)
+{
+ struct weston_compositor *compositor = seat->compositor;
+ struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat);
+
+ if (keyboard) {
+ weston_keyboard_set_focus(keyboard, surface);
+ wl_data_device_set_keyboard_focus(seat);
+ }
+
+ wl_signal_emit(&compositor->activate_signal, surface);
+}