diff --git a/src/focus-change.cpp b/src/focus-change.cpp index 3418455..26aa118 100644 --- a/src/focus-change.cpp +++ b/src/focus-change.cpp @@ -64,12 +64,13 @@ class wayfire_focus_change_t : public wf::plugin_interface_t void change_focus(orientation_t orientation) { + const bool should_pad_workspace = cross_outputs.value(); const auto cur_view = wf::get_core().seat->get_active_view(); const auto cur_output = cur_view->get_output(); const auto cur_lg = cur_output->get_layout_geometry(); const auto cur_bb = cur_view->get_bounding_box(); - const int32_t cur_cx = cur_bb.x + cur_bb.width / 2 + cur_lg.x; - const int32_t cur_cy = cur_bb.y + cur_bb.height / 2 + cur_lg.y; + const int32_t cur_cx = cur_bb.x + cur_bb.width / 2 + (should_pad_workspace ? cur_lg.x : 0); + const int32_t cur_cy = cur_bb.y + cur_bb.height / 2 + (should_pad_workspace ? cur_lg.y : 0); wf::view_interface_t *new_focus = nullptr; auto iterating_output = std::vector{}; @@ -89,7 +90,6 @@ class wayfire_focus_change_t : public wf::plugin_interface_t iterating_output = cur_output->wset()->get_views(); } - const bool should_pad_workspace = cross_outputs.value(); int32_t closest_cur = INT32_MAX; for (auto&& view : std::move(iterating_output)) {