diff options
-rw-r--r-- | sway/desktop/layer_shell.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index b6dddff6..b1ee8ae3 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -222,7 +222,7 @@ void arrange_layers(struct sway_output *output) { | |||
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
225 | static struct sway_layer_surface *find_any_layer_by_client( | 225 | static struct sway_layer_surface *find_mapped_layer_by_client( |
226 | struct wl_client *client, struct wlr_output *ignore_output) { | 226 | struct wl_client *client, struct wlr_output *ignore_output) { |
227 | for (int i = 0; i < root->outputs->length; ++i) { | 227 | for (int i = 0; i < root->outputs->length; ++i) { |
228 | struct sway_output *output = root->outputs->items[i]; | 228 | struct sway_output *output = root->outputs->items[i]; |
@@ -234,7 +234,8 @@ static struct sway_layer_surface *find_any_layer_by_client( | |||
234 | wl_list_for_each(lsurface, | 234 | wl_list_for_each(lsurface, |
235 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], link) { | 235 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], link) { |
236 | struct wl_resource *resource = lsurface->layer_surface->resource; | 236 | struct wl_resource *resource = lsurface->layer_surface->resource; |
237 | if (wl_resource_get_client(resource) == client) { | 237 | if (wl_resource_get_client(resource) == client |
238 | && lsurface->layer_surface->mapped) { | ||
238 | return lsurface; | 239 | return lsurface; |
239 | } | 240 | } |
240 | } | 241 | } |
@@ -258,7 +259,7 @@ static void handle_output_destroy(struct wl_listener *listener, void *data) { | |||
258 | 259 | ||
259 | if (set_focus) { | 260 | if (set_focus) { |
260 | struct sway_layer_surface *layer = | 261 | struct sway_layer_surface *layer = |
261 | find_any_layer_by_client(client, sway_layer->layer_surface->output); | 262 | find_mapped_layer_by_client(client, sway_layer->layer_surface->output); |
262 | if (layer) { | 263 | if (layer) { |
263 | seat_set_focus_layer(seat, layer->layer_surface); | 264 | seat_set_focus_layer(seat, layer->layer_surface); |
264 | } | 265 | } |