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

@ -43,7 +43,9 @@ keyboard_modifiers_notify(struct wl_listener *listener, void *data)
if ((event->state == WL_KEYBOARD_KEY_STATE_RELEASED)
&& !any_modifiers_pressed(device->keyboard)) {
/* end cycle */
desktop_focus_view(&server->seat, server->cycle_view);
desktop_focus_and_activate_view(&server->seat,
server->cycle_view);
desktop_raise_view(server->cycle_view);
server->cycle_view = NULL;
}
}