Skip to content

Commit

Permalink
Move ensure_pointer() call to oswitch (#2035)
Browse files Browse the repository at this point in the history
When a view is opened on another output than the focused one, i.e.
with window-rules plugin, focus_output() was calling ensure_pointer()
which was moving the pointer to the center of the output where the
view was opened. Here we move the call to oswitch so this only
happens when the user would want it to.

Fixes #2013.
  • Loading branch information
soreau authored Nov 27, 2023
1 parent b20c87d commit d6abead
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions plugins/single_plugins/oswitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class wayfire_oswitch : public wf::plugin_interface_t
idle_next_output.run_once([=] ()
{
wf::get_core().seat->focus_output(next);
next->ensure_pointer(true);
});

return true;
Expand All @@ -43,6 +44,7 @@ class wayfire_oswitch : public wf::plugin_interface_t
idle_next_output.run_once([=] ()
{
wf::get_core().seat->focus_output(next);
next->ensure_pointer(true);
});

return true;
Expand Down
2 changes: 0 additions & 2 deletions src/core/seat/seat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ void wf::seat_t::focus_output(wf::output_t *wo)
if (wo)
{
LOGC(KBD, "focus output: ", wo->handle->name);
/* Move to the middle of the output if this is the first output */
wo->ensure_pointer((priv->active_output == nullptr));

refocus();

Expand Down

0 comments on commit d6abead

Please sign in to comment.