input: Activate view no matter the keyboard focus
Activate a view even though it effectively may already be active. Without this, in later patches, it won't be possibe to track what view was activated by clicking last, as a view which surface already had keyboard focus, won't be activated. To keep avoiding sending xdg_surface.configure events, only change the keyboard focus if the focus actually changed. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This commit is contained in:
@@ -5223,7 +5223,6 @@ activate_binding(struct weston_seat *seat,
|
|||||||
struct desktop_shell *shell,
|
struct desktop_shell *shell,
|
||||||
struct weston_view *focus_view)
|
struct weston_view *focus_view)
|
||||||
{
|
{
|
||||||
struct focus_state *state;
|
|
||||||
struct weston_surface *focus;
|
struct weston_surface *focus;
|
||||||
struct weston_surface *main_surface;
|
struct weston_surface *main_surface;
|
||||||
|
|
||||||
@@ -5236,13 +5235,6 @@ activate_binding(struct weston_seat *seat,
|
|||||||
if (get_shell_surface_type(main_surface) == SHELL_SURFACE_NONE)
|
if (get_shell_surface_type(main_surface) == SHELL_SURFACE_NONE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
state = ensure_focus_state(shell, seat);
|
|
||||||
if (state == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (state->keyboard_focus == focus)
|
|
||||||
return;
|
|
||||||
|
|
||||||
activate(shell, focus, seat, true);
|
activate(shell, focus, seat, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2762,7 +2762,7 @@ weston_seat_set_keyboard_focus(struct weston_seat *seat,
|
|||||||
struct weston_compositor *compositor = seat->compositor;
|
struct weston_compositor *compositor = seat->compositor;
|
||||||
struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat);
|
struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat);
|
||||||
|
|
||||||
if (keyboard) {
|
if (keyboard && keyboard->focus != surface) {
|
||||||
weston_keyboard_set_focus(keyboard, surface);
|
weston_keyboard_set_focus(keyboard, surface);
|
||||||
wl_data_device_set_keyboard_focus(seat);
|
wl_data_device_set_keyboard_focus(seat);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user