enum lab_view_criteria criteria);
/**
- * view_isfocusable() - Check whether or not a view can be focused
+ * view_is_focusable() - 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
* 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_is_focusable(struct view *view);
-bool view_inhibits_keybinds(struct view *view);
void view_toggle_keybinds(struct view *view);
void view_set_activated(struct view *view, bool activated);
continue;
}
struct view *view = node_view_from_node(node);
- if (view_isfocusable(view)) {
+ if (view_is_focusable(view)) {
return view;
}
}
view = node_view_from_node(node);
enum property skip = window_rules_get_property(view, "skipWindowSwitcher");
- if (view_isfocusable(view) && skip != LAB_PROP_TRUE) {
+ if (view_is_focusable(view) && skip != LAB_PROP_TRUE) {
return view;
}
} while (view != start_view);
continue;
}
view = node_view_from_node(node);
- if (view->mapped && view_isfocusable(view)) {
+ if (view->mapped && view_is_focusable(view)) {
return view;
}
}
continue;
}
view = node_view_from_node(node);
- if (!view_isfocusable(view)) {
+ if (!view_is_focusable(view)) {
continue;
}
if (wlr_output_layout_intersects(layout,
static bool
matches_criteria(struct view *view, enum lab_view_criteria criteria)
{
- if (!view_isfocusable(view)) {
+ if (!view_is_focusable(view)) {
return false;
}
if (criteria & LAB_VIEW_CRITERIA_CURRENT_WORKSPACE) {
}
bool
-view_isfocusable(struct view *view)
+view_is_focusable(struct view *view)
{
+ assert(view);
if (!view->surface) {
return false;
}
void
view_resize_relative(struct view *view, int left, int right, int top, int bottom)
{
+ assert(view);
if (view->fullscreen || view->maximized) {
return;
}
void
view_move_relative(struct view *view, int x, int y)
{
+ assert(view);
if (view->fullscreen) {
return;
}
struct view_size_hints
view_get_size_hints(struct view *view)
{
+ assert(view);
if (view->impl->get_size_hints) {
return view->impl->get_size_hints(view);
}
void
view_minimize(struct view *view, bool minimized)
{
+ assert(view);
/*
* Minimize the root window first because some xwayland clients send a
* request-unmap to sub-windows at this point (for example gimp and its
bool
view_is_tiled(struct view *view)
{
- return view && (view->tiled || view->tiled_region
+ assert(view);
+ return (view->tiled || view->tiled_region
|| view->tiled_region_evacuate);
}
bool
view_is_floating(struct view *view)
{
- return view && !(view->fullscreen || view->maximized || view->tiled
+ assert(view);
+ return !(view->fullscreen || view->maximized || view->tiled
|| view->tiled_region || view->tiled_region_evacuate);
}
}
}
-static void
-inhibit_keybinds(struct view *view, bool inhibit)
+void
+view_toggle_keybinds(struct view *view)
{
- assert(view->inhibits_keybinds != inhibit);
-
- view->inhibits_keybinds = inhibit;
- if (inhibit) {
+ assert(view);
+ view->inhibits_keybinds = !view->inhibits_keybinds;
+ if (view->inhibits_keybinds) {
view->server->seat.nr_inhibited_keybind_views++;
} else {
view->server->seat.nr_inhibited_keybind_views--;
}
if (view->ssd_enabled) {
- ssd_enable_keybind_inhibit_indicator(view->ssd, inhibit);
+ ssd_enable_keybind_inhibit_indicator(view->ssd,
+ view->inhibits_keybinds);
}
}
-bool
-view_inhibits_keybinds(struct view *view)
-{
- return view && view->inhibits_keybinds;
-}
-
-void
-view_toggle_keybinds(struct view *view)
-{
- assert(view);
- inhibit_keybinds(view, !view->inhibits_keybinds);
-}
-
void
view_destroy(struct view *view)
{