<p dir="ltr">Why is this necessary? Won't events never be delivered while locked anyway?</p>
<div class="gmail_quote">On Apr 9, 2014 8:36 AM, "Neil Roberts" <<a href="mailto:neil@linux.intel.com">neil@linux.intel.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Before commit 2f5faff7f9142 when the compositor is locked it would<br>
reset the keyboard focus on all of the seats as part of pushing the<br>
focus_state. This was removed because it now always keeps track of the<br>
focus_state in the workspace instead of waiting until the state is<br>
pushed. However this had the side effect that the active surface would<br>
retain focus when the compositor is locked. This patch just makes it<br>
explicitly set the keyboard focus to NULL on all of the seats when<br>
locking. This will be restored based on the workspace's state when<br>
unlocking.<br>
<br>
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=73905" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=73905</a><br>
---<br>
 desktop-shell/shell.c | 18 ++++++++++++++++++<br>
 1 file changed, 18 insertions(+)<br>
<br>
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c<br>
index fa081f3..b19965f 100644<br>
--- a/desktop-shell/shell.c<br>
+++ b/desktop-shell/shell.c<br>
@@ -4498,6 +4498,19 @@ touch_to_activate_binding(struct weston_seat *seat, uint32_t time, void *data)<br>
 }<br>
<br>
 static void<br>
+unfocus_all_seats(struct desktop_shell *shell)<br>
+{<br>
+       struct weston_seat *seat, *next;<br>
+<br>
+       wl_list_for_each_safe(seat, next, &shell->compositor->seat_list, link) {<br>
+               if (seat->keyboard == NULL)<br>
+                       continue;<br>
+<br>
+               weston_keyboard_set_focus(seat->keyboard, NULL);<br>
+       }<br>
+}<br>
+<br>
+static void<br>
 lock(struct desktop_shell *shell)<br>
 {<br>
        struct workspace *ws = get_current_workspace(shell);<br>
@@ -4523,6 +4536,11 @@ lock(struct desktop_shell *shell)<br>
<br>
        launch_screensaver(shell);<br>
<br>
+       /* Remove the keyboard focus on all seats. This will be<br>
+        * restored to the workspace's saved state via<br>
+        * restore_focus_state when the compositor is unlocked */<br>
+       unfocus_all_seats(shell);<br>
+<br>
        /* TODO: disable bindings that should not work while locked. */<br>
<br>
        /* All this must be undone in resume_desktop(). */<br>
--<br>
1.8.5.3<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div>