]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/view.c: view_is_floating() add missing tiled_region_evacuate
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Sat, 11 Feb 2023 08:36:42 +0000 (09:36 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 11 Feb 2023 13:15:49 +0000 (13:15 +0000)
Also
- remove static inline (e.g. trust the compiler to optimize)
- move from include/view.h to src/view.c

include/view.h
src/view.c

index 2adf0269ea2bad75a245794004e52a54d9bfba1b..3b6844a8d436e248d694eb21053ca43c483f3736 100644 (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);
index a42cde25454010db3e6433ead47e99a6969c455b..43fdfa874f1ff6d1a2447048e3483d92be7694f3 100644 (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 */