Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix focus change bug #220

Merged
merged 12 commits into from
Dec 21, 2023
6 changes: 3 additions & 3 deletions src/focus-change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<wayfire_toplevel_view>{};
Expand All @@ -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))
{
Expand Down
Loading