[PATCH weston] input: Do not override keyboard focus on restore

Quentin Glidic sardemff7+wayland at sardemff7.net
Wed Mar 22 16:06:50 UTC 2017


From: Quentin Glidic <sardemff7+git at sardemff7.net>

If we start a special (grabbing) client when Weston is unfocused, it
would lose focus when coming back to Weston.

Signed-off-by: Quentin Glidic <sardemff7+git at sardemff7.net>
---
 libweston/input.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libweston/input.c b/libweston/input.c
index 4fedc558..6ebb4f97 100644
--- a/libweston/input.c
+++ b/libweston/input.c
@@ -2070,7 +2070,8 @@ notify_keyboard_focus_in(struct weston_seat *seat, struct wl_array *keys,
 
 	if (surface) {
 		wl_list_remove(&seat->saved_kbd_focus_listener.link);
-		weston_keyboard_set_focus(keyboard, surface);
+		if (!keyboard->focus)
+			weston_keyboard_set_focus(keyboard, surface);
 		seat->saved_kbd_focus = NULL;
 	}
 }
-- 
2.11.1



More information about the wayland-devel mailing list