diff --git a/sway/handlers.c b/sway/handlers.c index 896caa101..d26ce5f33 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -407,6 +407,14 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w break; } + // get focused window and check if to change focus on mouse click + swayc_t *focused = get_focused_container(&root_container); + + // dont change focus or mode if fullscreen + if (swayc_is_fullscreen(focused)) { + return SEND_CLICK; + } + // set pointer mode pointer_mode_set(button, (modifiers->mods & config->floating_mod) == config->floating_mod); @@ -421,9 +429,6 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w return SEND_CLICK; } - // get focused window and check if to change focus on mouse click - swayc_t *focused = get_focused_container(&root_container); - // Check whether to change focus swayc_t *pointer = pointer_state.view; if (pointer && focused != pointer) { @@ -442,11 +447,6 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w } } - // dont change focus if fullscreen - if (swayc_is_fullscreen(focused)) { - return SEND_CLICK; - } - // Finally send click return SEND_CLICK; }