summaryrefslogtreecommitdiff
path: root/src/desktop/Window.hpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-12-16 19:05:24 +0100
committerGitHub <noreply@github.com>2024-12-16 19:05:24 +0100
commitdab50b3ef3a1bad7f68320538223b6b41d1c6012 (patch)
tree3b911a592b2bece2017bdfdcc7557cbc6a3d22b0 /src/desktop/Window.hpp
parenteaac5c7cbdd40a2211c75a770df56bd2153b77cb (diff)
core: Optimize window/layer rule application and scanning (#8735)
Optimizes window and layer rule parsing and later usage.
Diffstat (limited to 'src/desktop/Window.hpp')
-rw-r--r--src/desktop/Window.hpp25
1 files changed, 3 insertions, 22 deletions
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<CGradientValueData> 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<SWindowRule> m_vMatchedRules;
+ std::vector<SP<CWindowRule>> 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<CWindowRule>& r);
void updateDynamicRules();
SBoxExtents getFullWindowReservedArea();
Vector2D middle();