src/view.c: view_is_floating() add missing tiled_region_evacuate

Also
- remove static inline (e.g. trust the compiler to optimize)
- move from include/view.h to src/view.c
This commit is contained in:
Consolatis 2023-02-11 09:36:42 +01:00 committed by Johan Malm
parent a90adab948
commit aeb6aa0cd8
2 changed files with 10 additions and 11 deletions

View file

@ -116,13 +116,6 @@ struct xdg_toplevel_view {
struct wl_listener new_popup;
};
static inline bool
view_is_floating(struct view *view)
{
return !view->fullscreen && !view->maximized && !view->tiled
&& !view->tiled_region;
}
void view_set_activated(struct view *view);
void view_close(struct view *view);
@ -151,6 +144,7 @@ void view_toggle_decorations(struct view *view);
void view_toggle_always_on_top(struct view *view);
bool view_is_always_on_top(struct view *view);
bool view_is_tiled(struct view *view);
bool view_is_floating(struct view *view);
void view_move_to_workspace(struct view *view, struct workspace *workspace);
void view_set_decorations(struct view *view, bool decorations);
void view_toggle_fullscreen(struct view *view);

View file

@ -546,10 +546,15 @@ view_restore_to(struct view *view, struct wlr_box geometry)
bool
view_is_tiled(struct view *view)
{
if (!view) {
return false;
}
return view->tiled || view->tiled_region || view->tiled_region_evacuate;
return view && (view->tiled || view->tiled_region
|| view->tiled_region_evacuate);
}
bool
view_is_floating(struct view *view)
{
return view && !(view->fullscreen || view->maximized || view->tiled
|| view->tiled_region || view->tiled_region_evacuate);
}
/* Reset tiled state of view without changing geometry */