desktop: simplify interface for view raise/focus

Split desktop_focus_view() into the following two functions:
  - desktop_focus_and_activate_view()
  - desktop_raise_view()

Always call view_set_activated() rather than using the private
set_activated(). This keeps the code cleaner and ensures
wlr_foreign_toplevel_handle_v1_set_activated() is called.
This commit is contained in:
Johan Malm 2021-10-16 19:44:54 +01:00
parent 70144ac113
commit 9a290feeea
6 changed files with 72 additions and 29 deletions

View file

@ -340,8 +340,22 @@ void view_update_title(struct view *view);
void foreign_toplevel_handle_create(struct view *view);
/*
* desktop.c routines deal with a collection of views
*
* Definition of a few keywords used in desktop.c
* raise - Bring view to front.
* focus - Give keyboard focus to view.
* activate - Set view surface as active so that client window decorations
* are painted to show that the window is active,typically by
* using a different color. Although xdg-shell protocol says you
* cannot assume this means that the window actually has keyboard
* or pointer focus, in this compositor are they called together.
*/
void desktop_set_focus_view_only(struct seat *seat, struct view *view);
void desktop_focus_view(struct seat *seat, struct view *view);
void desktop_raise_view(struct view *view);
void desktop_focus_and_activate_view(struct seat *seat, struct view *view);
/**
* desktop_cycle_view - return view to 'cycle' to