aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
authorLibravatar Scott Leggett <scott@sl.id.au>2018-05-28 02:25:42 +1000
committerLibravatar Scott Leggett <scott@sl.id.au>2018-05-28 02:25:42 +1000
commitb57f88e7dbefcda5a49ea515b410dc170e642a58 (patch)
tree401540b13bcad5f45b05af88a9a6a581e9495e9b /sway/input/cursor.c
parentMove previous cursor_position inline. (diff)
downloadsway-b57f88e7dbefcda5a49ea515b410dc170e642a58.tar.gz
sway-b57f88e7dbefcda5a49ea515b410dc170e642a58.tar.zst
sway-b57f88e7dbefcda5a49ea515b410dc170e642a58.zip
Avoid assert on container type.
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 3e8fd5d8..a0afd78a 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -178,14 +178,9 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
178 } else { 178 } else {
179 struct sway_container *next_focus = 179 struct sway_container *next_focus =
180 seat_get_focus_inactive(cursor->seat, &root_container); 180 seat_get_focus_inactive(cursor->seat, &root_container);
181 if (next_focus) { 181 if (next_focus && next_focus->type == C_VIEW &&
182 if (!sway_assert(next_focus->type == C_VIEW, 182 view_is_visible(next_focus->sway_view)) {
183 "focus inactive container is not a view")) { 183 seat_set_focus_warp(cursor->seat, next_focus, false);
184 return;
185 }
186 if (view_is_visible(next_focus->sway_view)) {
187 seat_set_focus_warp(cursor->seat, next_focus, false);
188 }
189 } 184 }
190 } 185 }
191 } 186 }