desktop: switch workspaces and optionally raise in desktop_focus_view()

Make desktop_focus_view() always switch to the workspace containing the
view being focused. It doesn't make much sense for an invisible view to
have the keyboard focus.

Also add an optional "raise" parameter to desktop_focus_view(). This
allows the common pattern of desktop_focus_view() + view_move_to_front()
to be reduced to a single function call.
This commit is contained in:
John Lindgren 2023-09-27 18:37:28 -04:00 committed by Consolatis
parent e77330bc3f
commit e5aef03319
11 changed files with 44 additions and 43 deletions

View file

@ -51,8 +51,7 @@ view_impl_move_sub_views(struct view *parent, enum z_direction z_direction)
void
view_impl_map(struct view *view)
{
desktop_focus_view(view);
view_move_to_front(view);
desktop_focus_view(view, /*raise*/ true);
view_update_title(view);
view_update_app_id(view);
if (!view->been_mapped) {