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

@ -22,7 +22,7 @@
static bool
matches_criteria(struct view *view, enum lab_view_criteria criteria)
{
if (!isfocusable(view)) {
if (!view_isfocusable(view)) {
return false;
}
if (criteria & LAB_VIEW_CRITERIA_CURRENT_WORKSPACE) {
@ -80,6 +80,15 @@ view_array_append(struct server *server, struct wl_array *views,
}
}
bool
view_isfocusable(struct view *view)
{
if (!view->surface) {
return false;
}
return (view->mapped || view->minimized);
}
/**
* All view_apply_xxx_geometry() functions must *not* modify
* any state besides repositioning or resizing the view.