summaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Ivan Chebykin <ivan@chebykin.org>2018-05-26 13:34:14 +0300
committerLibravatar Ivan Chebykin <ivan@chebykin.org>2018-05-26 13:34:14 +0300
commit820a8c9c2d12b863b7bf9a9d2f45a3214dff72fa (patch)
treea77158853cdd39599c03c1ffbb8c5b024656f090 /sway
parentBreak after first tabbed/stacked layout (diff)
downloadsway-820a8c9c2d12b863b7bf9a9d2f45a3214dff72fa.tar.gz
sway-820a8c9c2d12b863b7bf9a9d2f45a3214dff72fa.tar.zst
sway-820a8c9c2d12b863b7bf9a9d2f45a3214dff72fa.zip
Moved visibility check of of loop, added asserts
Diffstat (limited to 'sway')
-rw-r--r--sway/input/cursor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 0b6999ea..b404a634 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -167,10 +167,12 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
167 // If pointed container is in nested containers which are 167 // If pointed container is in nested containers which are
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 sway_assert(c->type == C_VIEW, "pointed container is not a view");
171 bool is_visible = view_is_visible(c->sway_view);
170 struct sway_container *p = c->parent; 172 struct sway_container *p = c->parent;
171 while (p) { 173 while (p) {
172 if ((p->layout == L_TABBED || p->layout == L_STACKED) 174 if ((p->layout == L_TABBED || p->layout == L_STACKED)
173 && !view_is_visible(c->sway_view)) { 175 && !is_visible) {
174 do_mouse_focus = false; 176 do_mouse_focus = false;
175 break; 177 break;
176 } 178 }
@@ -179,6 +181,8 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
179 if (!do_mouse_focus) { 181 if (!do_mouse_focus) {
180 struct sway_container *next_focus = seat_get_focus_inactive( 182 struct sway_container *next_focus = seat_get_focus_inactive(
181 cursor->seat, p); 183 cursor->seat, p);
184 sway_assert(next_focus->type == C_VIEW,
185 "focus inactive container is not a view");
182 if (next_focus && view_is_visible(next_focus->sway_view)) { 186 if (next_focus && view_is_visible(next_focus->sway_view)) {
183 seat_set_focus_warp(cursor->seat, next_focus, false); 187 seat_set_focus_warp(cursor->seat, next_focus, false);
184 } 188 }