aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-04-02 21:17:16 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-04-02 21:17:16 -0400
commit0bf3b88019b038f7465b5e333742baacfe0a9eed (patch)
treec6436df2cf49f6ca2a648d39392105590d5ee92e /sway/input/cursor.c
parentGive exclusive focus to layers above shell layer (diff)
downloadsway-0bf3b88019b038f7465b5e333742baacfe0a9eed.tar.gz
sway-0bf3b88019b038f7465b5e333742baacfe0a9eed.tar.zst
sway-0bf3b88019b038f7465b5e333742baacfe0a9eed.zip
Give layer shells under the shell layer focus
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 97b4473c..9229e92d 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -180,13 +180,18 @@ static void handle_cursor_button(struct wl_listener *listener, void *data) {
180 double sx, sy; 180 double sx, sy;
181 struct sway_container *cont = 181 struct sway_container *cont =
182 container_at_cursor(cursor, &surface, &sx, &sy); 182 container_at_cursor(cursor, &surface, &sx, &sy);
183 if (surface && wlr_surface_is_layer_surface(surface)) {
184 struct wlr_layer_surface *layer =
185 wlr_layer_surface_from_wlr_surface(surface);
186 if (layer->current.keyboard_interactive) {
187 seat_set_focus_layer(cursor->seat, layer);
188 return;
189 }
190 }
183 // Avoid moving keyboard focus from a surface that accepts it to one 191 // Avoid moving keyboard focus from a surface that accepts it to one
184 // that does not unless the change would move us to a new workspace. 192 // that does not unless the change would move us to a new workspace.
185 // 193 //
186 // This prevents, for example, losing focus when clicking on swaybar. 194 // This prevents, for example, losing focus when clicking on swaybar.
187 //
188 // TODO: Replace this condition with something like
189 // !surface_accepts_keyboard_input
190 if (surface && cont && cont->type != C_VIEW) { 195 if (surface && cont && cont->type != C_VIEW) {
191 struct sway_container *new_ws = cont; 196 struct sway_container *new_ws = cont;
192 if (new_ws && new_ws->type != C_WORKSPACE) { 197 if (new_ws && new_ws->type != C_WORKSPACE) {