libweston/input: Move activation signal logic out of keyboard focus function
Currently, and for legacy reasons, weston_seat_set_keyboard_focus() contains logic related to surface activation. Since this function is always called from weston_view_activate_input(), move that code there where it seems more appropriate. This will help us in subsequent commits by avoiding to have to change the signature of weston_seat_set_keyboard_focus(), which would make that function even more awkward than it currently is. Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
This commit is contained in:
parent
8cf4d79be7
commit
d11732c0fd
@ -2342,6 +2342,7 @@ weston_view_activate_input(struct weston_view *view,
|
||||
uint32_t flags)
|
||||
{
|
||||
struct weston_compositor *compositor = seat->compositor;
|
||||
struct weston_surface_activation_data activation_data;
|
||||
|
||||
if (flags & WESTON_ACTIVATE_FLAG_CLICKED) {
|
||||
view->click_to_activate_serial =
|
||||
@ -2349,6 +2350,14 @@ weston_view_activate_input(struct weston_view *view,
|
||||
}
|
||||
|
||||
weston_seat_set_keyboard_focus(seat, view->surface);
|
||||
|
||||
inc_activate_serial(compositor);
|
||||
|
||||
activation_data = (struct weston_surface_activation_data) {
|
||||
.surface = view->surface,
|
||||
.seat = seat,
|
||||
};
|
||||
wl_signal_emit(&compositor->activate_signal, &activation_data);
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
@ -4609,22 +4618,12 @@ 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);
|
||||
struct weston_surface_activation_data activation_data;
|
||||
|
||||
if (keyboard && keyboard->focus != surface) {
|
||||
weston_keyboard_set_focus(keyboard, surface);
|
||||
wl_data_device_set_keyboard_focus(seat);
|
||||
}
|
||||
|
||||
inc_activate_serial(compositor);
|
||||
|
||||
activation_data = (struct weston_surface_activation_data) {
|
||||
.surface = surface,
|
||||
.seat = seat,
|
||||
};
|
||||
wl_signal_emit(&compositor->activate_signal, &activation_data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user