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>
dev
Bryce Harrington 8 years ago committed by Pekka Paalanen
parent 260c2ffd97
commit 24f917e723
  1. 7
      libweston/compositor.h
  2. 34
      libweston/input.c

@ -1166,9 +1166,6 @@ weston_spring_update(struct weston_spring *spring, uint32_t msec);
int int
weston_spring_done(struct weston_spring *spring); weston_spring_done(struct weston_spring *spring);
void
weston_seat_set_keyboard_focus(struct weston_seat *seat,
struct weston_surface *surface);
void void
notify_motion(struct weston_seat *seat, uint32_t time, notify_motion(struct weston_seat *seat, uint32_t time,
struct weston_pointer_motion_event *event); struct weston_pointer_motion_event *event);
@ -1717,6 +1714,10 @@ weston_seat_get_pointer(struct weston_seat *seat);
struct weston_touch * struct weston_touch *
weston_seat_get_touch(struct weston_seat *seat); weston_seat_get_touch(struct weston_seat *seat);
void
weston_seat_set_keyboard_focus(struct weston_seat *seat,
struct weston_surface *surface);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

@ -1296,21 +1296,6 @@ notify_motion_absolute(struct weston_seat *seat,
pointer->grab->interface->motion(pointer->grab, time, &event); pointer->grab->interface->motion(pointer->grab, time, &event);
} }
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 WL_EXPORT void
notify_button(struct weston_seat *seat, uint32_t time, int32_t button, notify_button(struct weston_seat *seat, uint32_t time, int32_t button,
enum wl_pointer_button_state state) enum wl_pointer_button_state state)
@ -2763,3 +2748,22 @@ weston_seat_get_touch(struct weston_seat *seat)
return NULL; 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);
}

Loading…
Cancel
Save