sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 836f24b04713217fea569c240b1cd6cb922d5091
parent 9acd3d20681de1bbce791bdf82e5fb5e74dfb80f
Author: taiyu <taiyu.len@gmail.com>
Date:   Fri, 28 Aug 2015 23:43:52 -0700

#149 change focus before pointer_mode

Diffstat:
Msway/handlers.c | 21++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)

diff --git 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 pointer_mode_set(button, !(modifiers->mods ^ config->floating_mod)); } - // Return if mode has been set - if (pointer_state.mode) { - return EVENT_HANDLED; - } - - // Always send mouse release - if (state == WLC_BUTTON_STATE_RELEASED) { - return EVENT_PASSTHROUGH; - } - // Check whether to change focus swayc_t *pointer = pointer_state.view; - sway_log(L_DEBUG, "pointer:%p",pointer); if (pointer) { if (focused != pointer) { set_focused_container(pointer_state.view); @@ -478,6 +467,16 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w } } + // Return if mode has been set + if (pointer_state.mode) { + return EVENT_HANDLED; + } + + // Always send mouse release + if (state == WLC_BUTTON_STATE_RELEASED) { + return EVENT_PASSTHROUGH; + } + // Finally send click return EVENT_PASSTHROUGH; }