diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-11-17 20:24:01 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-17 20:24:01 +1000 |
commit | cb63321de6b663530a5b27f323363843cd2720a7 (patch) | |
tree | ff3e8ba6194cc76936a707568ece17f376d8464b /sway/input/cursor.c | |
parent | Merge pull request #3141 from tslocum/resize-set-floating-ppt (diff) | |
parent | Fix segfault in dispatch_cursor_button (diff) | |
download | sway-cb63321de6b663530a5b27f323363843cd2720a7.tar.gz sway-cb63321de6b663530a5b27f323363843cd2720a7.tar.zst sway-cb63321de6b663530a5b27f323363843cd2720a7.zip |
Merge pull request #3132 from emersion/dispatch-cursor-btn-segfault
Fix segfault in dispatch_cursor_button
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 62cdba37..81b82abc 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -863,8 +863,8 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
863 | } | 863 | } |
864 | 864 | ||
865 | // Handle tiling resize via border | 865 | // Handle tiling resize via border |
866 | if (resize_edge && button == BTN_LEFT && state == WLR_BUTTON_PRESSED && | 866 | if (cont && resize_edge && button == BTN_LEFT && |
867 | !is_floating) { | 867 | state == WLR_BUTTON_PRESSED && !is_floating) { |
868 | seat_set_focus_container(seat, cont); | 868 | seat_set_focus_container(seat, cont); |
869 | seat_begin_resize_tiling(seat, cont, button, edge); | 869 | seat_begin_resize_tiling(seat, cont, button, edge); |
870 | return; | 870 | return; |
@@ -873,7 +873,8 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
873 | // Handle tiling resize via mod | 873 | // Handle tiling resize via mod |
874 | bool mod_pressed = keyboard && | 874 | bool mod_pressed = keyboard && |
875 | (wlr_keyboard_get_modifiers(keyboard) & config->floating_mod); | 875 | (wlr_keyboard_get_modifiers(keyboard) & config->floating_mod); |
876 | if (!is_floating_or_child && mod_pressed && state == WLR_BUTTON_PRESSED) { | 876 | if (cont && !is_floating_or_child && mod_pressed && |
877 | state == WLR_BUTTON_PRESSED) { | ||
877 | uint32_t btn_resize = config->floating_mod_inverse ? | 878 | uint32_t btn_resize = config->floating_mod_inverse ? |
878 | BTN_LEFT : BTN_RIGHT; | 879 | BTN_LEFT : BTN_RIGHT; |
879 | if (button == btn_resize) { | 880 | if (button == btn_resize) { |
@@ -901,7 +902,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
901 | } | 902 | } |
902 | 903 | ||
903 | // Handle beginning floating move | 904 | // Handle beginning floating move |
904 | if (is_floating_or_child && !is_fullscreen_or_child && | 905 | if (cont && is_floating_or_child && !is_fullscreen_or_child && |
905 | state == WLR_BUTTON_PRESSED) { | 906 | state == WLR_BUTTON_PRESSED) { |
906 | uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT; | 907 | uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT; |
907 | if (button == btn_move && state == WLR_BUTTON_PRESSED && | 908 | if (button == btn_move && state == WLR_BUTTON_PRESSED && |
@@ -916,7 +917,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
916 | } | 917 | } |
917 | 918 | ||
918 | // Handle beginning floating resize | 919 | // Handle beginning floating resize |
919 | if (is_floating_or_child && !is_fullscreen_or_child && | 920 | if (cont && is_floating_or_child && !is_fullscreen_or_child && |
920 | state == WLR_BUTTON_PRESSED) { | 921 | state == WLR_BUTTON_PRESSED) { |
921 | // Via border | 922 | // Via border |
922 | if (button == BTN_LEFT && resize_edge != WLR_EDGE_NONE) { | 923 | if (button == BTN_LEFT && resize_edge != WLR_EDGE_NONE) { |