From dab50b3ef3a1bad7f68320538223b6b41d1c6012 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:05:24 +0100 Subject: core: Optimize window/layer rule application and scanning (#8735) Optimizes window and layer rule parsing and later usage. --- src/desktop/Window.hpp | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'src/desktop/Window.hpp') diff --git a/src/desktop/Window.hpp b/src/desktop/Window.hpp index f57d6e60..c72f010e 100644 --- a/src/desktop/Window.hpp +++ b/src/desktop/Window.hpp @@ -17,6 +17,7 @@ #include "Subsurface.hpp" #include "WLSurface.hpp" #include "Workspace.hpp" +#include "WindowRule.hpp" class CXDGSurfaceResource; class CXWaylandSurface; @@ -195,26 +196,6 @@ struct SWindowData { CWindowOverridableVar inactiveBorderColor; }; -struct SWindowRule { - std::string szRule; - std::string szValue; - - bool v2 = false; - std::string szTitle; - std::string szClass; - std::string szInitialTitle; - std::string szInitialClass; - std::string szTag; - int bX11 = -1; // -1 means "ANY" - int bFloating = -1; - int bFullscreen = -1; - int bPinned = -1; - int bFocus = -1; - std::string szFullscreenState = ""; // empty means any - std::string szOnWorkspace = ""; // empty means any - std::string szWorkspace = ""; // empty means any -}; - struct SInitialWorkspaceToken { PHLWINDOWREF primaryOwner; std::string workspace; @@ -395,7 +376,7 @@ class CWindow { bool m_bTearingHint = false; // stores the currently matched window rules - std::vector m_vMatchedRules; + std::vector> m_vMatchedRules; // window tags CTagKeeper m_tags; @@ -427,7 +408,7 @@ class CWindow { void onMap(); void setHidden(bool hidden); bool isHidden(); - void applyDynamicRule(const SWindowRule& r); + void applyDynamicRule(const SP& r); void updateDynamicRules(); SBoxExtents getFullWindowReservedArea(); Vector2D middle(); -- cgit v1.2.3