aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
authorLibravatar Ivan Chebykin <ivan@chebykin.org>2018-05-25 17:45:41 +0300
committerLibravatar Ivan Chebykin <ivan@chebykin.org>2018-05-25 17:45:41 +0300
commit740234a4bc9c8509c766f8feb9f7116bf8950c49 (patch)
tree4d56fcd2439600d293f6ed5fe653caa2e39c63f4 /sway/input/cursor.c
parentFix mouse focusing for horizontal/vertical views in tabbed containers (diff)
downloadsway-740234a4bc9c8509c766f8feb9f7116bf8950c49.tar.gz
sway-740234a4bc9c8509c766f8feb9f7116bf8950c49.tar.zst
sway-740234a4bc9c8509c766f8feb9f7116bf8950c49.zip
Break after first tabbed/stacked layout
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 4e01df70..0b6999ea 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -168,19 +168,18 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
168 // inside tabbed/stacked layout we should skip them 168 // inside tabbed/stacked layout we should skip them
169 bool do_mouse_focus = true; 169 bool do_mouse_focus = true;
170 struct sway_container *p = c->parent; 170 struct sway_container *p = c->parent;
171 struct sway_container *first_tabbed_parent = c->parent;
172 while (p) { 171 while (p) {
173 if ((p->layout == L_TABBED || p->layout == L_STACKED) 172 if ((p->layout == L_TABBED || p->layout == L_STACKED)
174 && !view_is_visible(c->sway_view)) { 173 && !view_is_visible(c->sway_view)) {
175 do_mouse_focus = false; 174 do_mouse_focus = false;
176 first_tabbed_parent = p; 175 break;
177 } 176 }
178 p = p->parent; 177 p = p->parent;
179 } 178 }
180 if (!do_mouse_focus) { 179 if (!do_mouse_focus) {
181 struct sway_container *next_focus = seat_get_focus_inactive( 180 struct sway_container *next_focus = seat_get_focus_inactive(
182 cursor->seat, first_tabbed_parent); 181 cursor->seat, p);
183 if (next_focus) { 182 if (next_focus && view_is_visible(next_focus->sway_view)) {
184 seat_set_focus_warp(cursor->seat, next_focus, false); 183 seat_set_focus_warp(cursor->seat, next_focus, false);
185 } 184 }
186 } else { 185 } else {