Move isfocusable() from desktop.c to view.c

This commit is contained in:
Johan Malm 2023-08-20 16:43:29 +01:00 committed by Johan Malm
parent 602d59a3b2
commit e5a6c57a6e
5 changed files with 29 additions and 24 deletions

View file

@ -388,7 +388,6 @@ struct view *desktop_cycle_view(struct server *server, struct view *start_view,
enum lab_cycle_dir dir);
struct view *desktop_focused_view(struct server *server);
void desktop_focus_topmost_mapped_view(struct server *server);
bool isfocusable(struct view *view);
void keyboard_cancel_keybind_repeat(struct keyboard *keyboard);
void keyboard_key_notify(struct wl_listener *listener, void *data);

View file

@ -229,6 +229,20 @@ struct view *view_next(struct wl_list *head, struct view *view,
void view_array_append(struct server *server, struct wl_array *views,
enum lab_view_criteria criteria);
/**
* view_isfocusable() - Check whether or not a view can be focused
* @view: view to be checked
*
* The purpose of this test is to filter out views (generally Xwayland) which
* are not meant to be focused such as those with surfaces
* a. that have been created but never mapped;
* b. set to NULL after client minimize-request.
*
* The only views that are allowed to be focusd are those that have a surface
* and have been mapped at some point since creation.
*/
bool view_isfocusable(struct view *view);
bool view_inhibits_keybinds(struct view *view);
void view_toggle_keybinds(struct view *view);