diff options
-rw-r--r-- | sway/handlers.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index fa5c6c93..d0b129e8 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -447,19 +447,8 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w | |||
447 | pointer_mode_set(button, !(modifiers->mods ^ config->floating_mod)); | 447 | pointer_mode_set(button, !(modifiers->mods ^ config->floating_mod)); |
448 | } | 448 | } |
449 | 449 | ||
450 | // Return if mode has been set | ||
451 | if (pointer_state.mode) { | ||
452 | return EVENT_HANDLED; | ||
453 | } | ||
454 | |||
455 | // Always send mouse release | ||
456 | if (state == WLC_BUTTON_STATE_RELEASED) { | ||
457 | return EVENT_PASSTHROUGH; | ||
458 | } | ||
459 | |||
460 | // Check whether to change focus | 450 | // Check whether to change focus |
461 | swayc_t *pointer = pointer_state.view; | 451 | swayc_t *pointer = pointer_state.view; |
462 | sway_log(L_DEBUG, "pointer:%p",pointer); | ||
463 | if (pointer) { | 452 | if (pointer) { |
464 | if (focused != pointer) { | 453 | if (focused != pointer) { |
465 | set_focused_container(pointer_state.view); | 454 | set_focused_container(pointer_state.view); |
@@ -478,6 +467,16 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w | |||
478 | } | 467 | } |
479 | } | 468 | } |
480 | 469 | ||
470 | // Return if mode has been set | ||
471 | if (pointer_state.mode) { | ||
472 | return EVENT_HANDLED; | ||
473 | } | ||
474 | |||
475 | // Always send mouse release | ||
476 | if (state == WLC_BUTTON_STATE_RELEASED) { | ||
477 | return EVENT_PASSTHROUGH; | ||
478 | } | ||
479 | |||
481 | // Finally send click | 480 | // Finally send click |
482 | return EVENT_PASSTHROUGH; | 481 | return EVENT_PASSTHROUGH; |
483 | } | 482 | } |