Commit 260c2ffd authored by Bryce Harrington's avatar Bryce Harrington Committed by Pekka Paalanen

input: Rename weston_surface_activate to weston_seat_set_keyboard_focus

The name suggests that it activates surfaces, but the code says it
rather just assigns keyboard focus.  Rename it for clarity, and so the
original function name could be used for something more appropriate
later.  Switch order of parameters since keyboard focus is a property of
the seat.  Update all callers as appropriate.

Change was asked for by pq, May 26, 2016:

 "This should be called weston_seat_set_keyboard_focus(seat, surface).
 Keyboard focus is a property of the seat."
Signed-off-by: default avatarBryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
parent a5bb91dc
......@@ -5168,7 +5168,7 @@ activate(struct desktop_shell *shell, struct weston_surface *es,
* Leave fullscreen surfaces on unrelated outputs alone. */
lower_fullscreen_layer(shell, shsurf->output);
weston_surface_activate(es, seat);
weston_seat_set_keyboard_focus(seat, es);
state = ensure_focus_state(shell, seat);
if (state == NULL)
......
......@@ -89,7 +89,7 @@ pointer_focus_changed(struct wl_listener *listener, void *data)
struct weston_pointer *pointer = data;
if (pointer->focus && pointer->focus->surface->resource)
weston_surface_activate(pointer->focus->surface, pointer->seat);
weston_seat_set_keyboard_focus(pointer->seat, pointer->focus->surface);
}
static void
......@@ -118,7 +118,7 @@ seat_caps_changed(struct wl_listener *l, void *data)
if (keyboard && keyboard->focus != NULL) {
wl_list_for_each(fsout, &listener->shell->output_list, link) {
if (fsout->surface) {
weston_surface_activate(fsout->surface, seat);
weston_seat_set_keyboard_focus(seat, fsout->surface);
return;
}
}
......@@ -704,7 +704,7 @@ fullscreen_shell_present_surface(struct wl_client *client,
weston_seat_get_keyboard(seat);
if (keyboard && !keyboard->focus)
weston_surface_activate(surface, seat);
weston_seat_set_keyboard_focus(seat, surface);
}
}
}
......@@ -755,7 +755,7 @@ fullscreen_shell_present_surface_for_mode(struct wl_client *client,
weston_seat_get_keyboard(seat);
if (keyboard && !keyboard->focus)
weston_surface_activate(surface, seat);
weston_seat_set_keyboard_focus(seat, surface);
}
}
......
......@@ -445,7 +445,7 @@ activate_binding(struct weston_seat *seat,
if (get_ivi_shell_surface(main_surface) == NULL)
return;
weston_surface_activate(focus, seat);
weston_seat_set_keyboard_focus(seat, focus);
}
static void
......
......@@ -1167,8 +1167,8 @@ int
weston_spring_done(struct weston_spring *spring);
void
weston_surface_activate(struct weston_surface *surface,
struct weston_seat *seat);
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);
......
......@@ -1297,8 +1297,8 @@ notify_motion_absolute(struct weston_seat *seat,
}
WL_EXPORT void
weston_surface_activate(struct weston_surface *surface,
struct weston_seat *seat)
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);
......
......@@ -182,13 +182,13 @@ activate_surface(struct wl_client *client, struct wl_resource *resource,
seat = get_seat(test);
keyboard = weston_seat_get_keyboard(seat);
if (surface) {
weston_surface_activate(surface, seat);
weston_seat_set_keyboard_focus(seat, surface);
notify_keyboard_focus_in(seat, &keyboard->keys,
STATE_UPDATE_AUTOMATIC);
}
else {
notify_keyboard_focus_out(seat);
weston_surface_activate(surface, seat);
weston_seat_set_keyboard_focus(seat, surface);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment