From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Sat, 11 Feb 2023 08:36:42 +0000 (+0100) Subject: src/view.c: view_is_floating() add missing tiled_region_evacuate X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=aeb6aa0cd82e7c3de9c1df45e9c4a9e9a8358c2f;p=proto%2Flabwc.git 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 --- 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 */