diff options
-rw-r--r-- | sway/extensions.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sway/extensions.c b/sway/extensions.c index 547aa931..5fee7d38 100644 --- a/sway/extensions.c +++ b/sway/extensions.c | |||
@@ -69,7 +69,15 @@ void lock_surface_destructor(struct wl_resource *resource) { | |||
69 | } | 69 | } |
70 | } | 70 | } |
71 | if (desktop_shell.lock_surfaces->length == 0) { | 71 | if (desktop_shell.lock_surfaces->length == 0) { |
72 | sway_log(L_DEBUG, "Desktop shell unlocked"); | ||
72 | desktop_shell.is_locked = false; | 73 | desktop_shell.is_locked = false; |
74 | |||
75 | // We need to now give focus back to the focus which we internally | ||
76 | // track, since when we lock sway we don't actually change our internal | ||
77 | // focus tracking. | ||
78 | swayc_t *focus = get_focused_container(swayc_active_workspace()); | ||
79 | set_focused_container(focus); | ||
80 | wlc_view_focus(focus->handle); | ||
73 | } | 81 | } |
74 | } | 82 | } |
75 | 83 | ||
@@ -159,10 +167,6 @@ static void set_lock_surface(struct wl_client *client, struct wl_resource *resou | |||
159 | desktop_shell.is_locked = true; | 167 | desktop_shell.is_locked = true; |
160 | input_init(); | 168 | input_init(); |
161 | arrange_windows(workspace, -1, -1); | 169 | arrange_windows(workspace, -1, -1); |
162 | swayc_t *focus_output = swayc_active_output(); | ||
163 | if (focus_output == output) { | ||
164 | set_focused_container(view); | ||
165 | } | ||
166 | list_add(desktop_shell.lock_surfaces, surface); | 170 | list_add(desktop_shell.lock_surfaces, surface); |
167 | wl_resource_set_destructor(surface, lock_surface_destructor); | 171 | wl_resource_set_destructor(surface, lock_surface_destructor); |
168 | } else { | 172 | } else { |