mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 18:01:29 +00:00
#149 change focus before pointer_mode
This commit is contained in:
parent
9acd3d2068
commit
836f24b047
|
@ -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));
|
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
|
// Check whether to change focus
|
||||||
swayc_t *pointer = pointer_state.view;
|
swayc_t *pointer = pointer_state.view;
|
||||||
sway_log(L_DEBUG, "pointer:%p",pointer);
|
|
||||||
if (pointer) {
|
if (pointer) {
|
||||||
if (focused != pointer) {
|
if (focused != pointer) {
|
||||||
set_focused_container(pointer_state.view);
|
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
|
// Finally send click
|
||||||
return EVENT_PASSTHROUGH;
|
return EVENT_PASSTHROUGH;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue