diff options
author | Luminarys <kizunanohikari@gmail.com> | 2015-08-18 10:39:37 -0500 |
---|---|---|
committer | Luminarys <kizunanohikari@gmail.com> | 2015-08-18 10:39:37 -0500 |
commit | 23b90d8e69d203697c5548fdd140bf3052749dfa (patch) | |
tree | 9305fd6a20d457c7cc7cb0ee7cbd59a801d92b8d /sway | |
parent | 85a573dab73654fb4462dd8fe48ef16400770f04 (diff) | |
download | sway-23b90d8e69d203697c5548fdd140bf3052749dfa.tar.xz |
Fixed mouse clicks from triggering a segfault
Diffstat (limited to 'sway')
-rw-r--r-- | sway/handlers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index cd97ab43..4980f65c 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -322,7 +322,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct int i = 0; // Do checks to determine if proper keys are being held swayc_t *view = active_workspace->focused; - if (m1_held) { + if (m1_held && view) { if (view->is_floating) { while (keys_pressed[i++]) { if (keys_pressed[i] == config->floating_mod) { @@ -338,7 +338,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct } } } - } else if (m2_held) { + } else if (m2_held && view) { if (view->is_floating) { while (keys_pressed[i++]) { if (keys_pressed[i] == config->floating_mod) { |