aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorIvan Chebykin <ivan@chebykin.org>2018-05-26 15:51:36 +0300
committerIvan Chebykin <ivan@chebykin.org>2018-05-26 15:51:36 +0300
commit6e6b0decd95eb3fd4b336817839c08a2c71c7505 (patch)
tree5020892ac6a7ff3e1c3dab80e5220db2d3220575 /sway/input
parent820a8c9c2d12b863b7bf9a9d2f45a3214dff72fa (diff)
downloadsway-6e6b0decd95eb3fd4b336817839c08a2c71c7505.tar.xz
Fix usage of sway_assert
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/cursor.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index b404a634..62967cb8 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -167,7 +167,9 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
// If pointed container is in nested containers which are
// inside tabbed/stacked layout we should skip them
bool do_mouse_focus = true;
- sway_assert(c->type == C_VIEW, "pointed container is not a view");
+ if(!sway_assert(c->type == C_VIEW, "pointed container is not a view")) {
+ return;
+ }
bool is_visible = view_is_visible(c->sway_view);
struct sway_container *p = c->parent;
while (p) {
@@ -181,8 +183,10 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
if (!do_mouse_focus) {
struct sway_container *next_focus = seat_get_focus_inactive(
cursor->seat, p);
- sway_assert(next_focus->type == C_VIEW,
- "focus inactive container is not a view");
+ if(!sway_assert(next_focus->type == C_VIEW,
+ "focus inactive container is not a view")) {
+ return;
+ }
if (next_focus && view_is_visible(next_focus->sway_view)) {
seat_set_focus_warp(cursor->seat, next_focus, false);
}