summaryrefslogtreecommitdiffstats
path: root/sway/handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index da765d6d..e1b90a07 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -917,6 +917,26 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w
917 // Update view pointer is on 917 // Update view pointer is on
918 pointer_state.view = container_under_pointer(); 918 pointer_state.view = container_under_pointer();
919 919
920 struct sway_mode *mode = config->current_mode;
921 // handle bindings
922 for (int i = 0; i < mode->bindings->length; ++i) {
923 struct sway_binding *binding = mode->bindings->items[i];
924 if ((modifiers->mods ^ binding->modifiers) == 0) {
925 switch (state) {
926 case WLC_BUTTON_STATE_PRESSED: {
927 if (!binding->release && handle_bindsym(binding, button, 0)) {
928 return EVENT_HANDLED;
929 }
930 }
931 case WLC_BUTTON_STATE_RELEASED:
932 if (binding->release && handle_bindsym(binding, button, 0)) {
933 return EVENT_HANDLED;
934 }
935 break;
936 }
937 }
938 }
939
920 // Update pointer_state 940 // Update pointer_state
921 switch (button) { 941 switch (button) {
922 case M_LEFT_CLICK: 942 case M_LEFT_CLICK: