diff options
-rw-r--r-- | sway/input/cursor.c | 7 |
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 { |