From aeb6aa0cd82e7c3de9c1df45e9c4a9e9a8358c2f Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Sat, 11 Feb 2023 09:36:42 +0100 Subject: [PATCH] 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 --- include/view.h | 8 +------- src/view.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/view.h b/include/view.h index 2adf0269..3b6844a8 100644 --- a/include/view.h +++ b/include/view.h @@ -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); diff --git a/src/view.c b/src/view.c index a42cde25..43fdfa87 100644 --- a/src/view.c +++ b/src/view.c @@ -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 */