Skip to content

Commit

Permalink
seat: add get_active_node()
Browse files Browse the repository at this point in the history
  • Loading branch information
ammen99 committed Oct 23, 2023
1 parent 99d0fbb commit 71b95df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/wayfire/seat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ class seat_t
*/
void set_active_node(wf::scene::node_ptr node);

/**
* Get the node which has current keyboard focus.
*/
wf::scene::node_ptr get_active_node();

/**
* Try to focus the given view. This may not work if another view or a node requests a higher focus
* importance.
Expand Down
5 changes: 5 additions & 0 deletions src/core/seat/seat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ void wf::seat_t::set_active_node(wf::scene::node_ptr node)
priv->set_keyboard_focus(focus.node ? focus.node->shared_from_this() : nullptr);
}

wf::scene::node_ptr wf::seat_t::get_active_node()
{
return priv->keyboard_focus;
}

void wf::seat_t::focus_output(wf::output_t *wo)
{
if (priv->active_output == wo)
Expand Down

0 comments on commit 71b95df

Please sign in to comment.