aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-03-26 02:00:24 +0100
committervaxerski <[email protected]>2023-03-26 02:00:24 +0100
commit3343aac6bf6aa601cb882859edf63a6cb59bb774 (patch)
tree935a1b71231fd6e46c5a444fe723a6d3a8c3a3dd
parent41f7736c8521162cb3ea5f3c003e0643c1bcf616 (diff)
downloadHyprland-3343aac6bf6aa601cb882859edf63a6cb59bb774.tar.gz
Hyprland-3343aac6bf6aa601cb882859edf63a6cb59bb774.zip
feat: add forcergbx rule
-rw-r--r--src/Window.cpp3
-rw-r--r--src/Window.hpp1
-rw-r--r--src/config/ConfigManager.cpp2
-rw-r--r--src/debug/HyprCtl.cpp2
-rw-r--r--src/render/OpenGL.cpp5
5 files changed, 11 insertions, 2 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index 840944d4..b8c7ab36 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -406,6 +406,8 @@ void CWindow::applyDynamicRule(const SWindowRule& r) {
m_sAdditionalConfigData.forceNoBorder = true;
} else if (r.szRule == "noshadow") {
m_sAdditionalConfigData.forceNoShadow = true;
+ } else if (r.szRule == "forcergbx") {
+ m_sAdditionalConfigData.forceRGBX = true;
} else if (r.szRule == "opaque") {
if (!m_sAdditionalConfigData.forceOpaqueOverriden)
m_sAdditionalConfigData.forceOpaque = true;
@@ -470,6 +472,7 @@ void CWindow::updateDynamicRules() {
m_sAdditionalConfigData.animationStyle = std::string("");
m_sAdditionalConfigData.rounding = -1;
m_sAdditionalConfigData.dimAround = false;
+ m_sAdditionalConfigData.forceRGBX = false;
const auto WINDOWRULES = g_pConfigManager->getMatchingRules(this);
for (auto& r : WINDOWRULES) {
diff --git a/src/Window.hpp b/src/Window.hpp
index 6cada8c8..e4cff0aa 100644
--- a/src/Window.hpp
+++ b/src/Window.hpp
@@ -119,6 +119,7 @@ struct SWindowAdditionalConfigData {
CWindowOverridableVar<bool> windowDanceCompat = false;
CWindowOverridableVar<bool> noMaxSize = false;
CWindowOverridableVar<bool> dimAround = false;
+ CWindowOverridableVar<bool> forceRGBX = false;
};
struct SWindowRule {
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index c6a3abd1..2283b61c 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -780,7 +780,7 @@ bool windowRuleValid(const std::string& RULE) {
RULE.find("maxsize") != 0 && RULE.find("pseudo") != 0 && RULE.find("monitor") != 0 && RULE.find("idleinhibit") != 0 && RULE != "nofocus" && RULE != "noblur" &&
RULE != "noshadow" && RULE != "noborder" && RULE != "center" && RULE != "opaque" && RULE != "forceinput" && RULE != "fullscreen" && RULE != "nofullscreenrequest" &&
RULE != "nomaxsize" && RULE != "pin" && RULE != "noanim" && RULE != "dimaround" && RULE != "windowdance" && RULE != "maximize" && RULE.find("animation") != 0 &&
- RULE.find("rounding") != 0 && RULE.find("workspace") != 0 && RULE.find("bordercolor") != 0);
+ RULE.find("rounding") != 0 && RULE.find("workspace") != 0 && RULE.find("bordercolor") != 0 && RULE != "forcergbx");
}
bool layerRuleValid(const std::string& RULE) {
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index c9b8a25d..345a5288 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -960,6 +960,8 @@ std::string dispatchSetProp(std::string request) {
PWINDOW->m_sSpecialRenderData.activeBorderColor.forceSetIgnoreLocked(configStringToInt(VAL), lock);
} else if (PROP == "inactivebordercolor") {
PWINDOW->m_sSpecialRenderData.inactiveBorderColor.forceSetIgnoreLocked(configStringToInt(VAL), lock);
+ } else if (PROP == "forcergbx") {
+ PWINDOW->m_sAdditionalConfigData.forceRGBX.forceSetIgnoreLocked(configStringToInt(VAL), lock);
} else {
return "prop not found";
}
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 420872e1..10ab3687 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -521,6 +521,9 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(const CTexture& tex, wlr_b
}
}
+ if (m_pCurrentWindow && m_pCurrentWindow->m_sAdditionalConfigData.forceRGBX)
+ shader = &m_RenderData.pCurrentMonData->m_shRGBX;
+
glActiveTexture(GL_TEXTURE0);
glBindTexture(tex.m_iTarget, tex.m_iTexID);
@@ -875,7 +878,7 @@ void CHyprOpenGLImpl::renderTextureWithBlur(const CTexture& tex, wlr_box* pBox,
return;
if (*PBLURENABLED == 0 || (*PNOBLUROVERSIZED && m_RenderData.primarySurfaceUVTopLeft != Vector2D(-1, -1)) ||
- (m_pCurrentWindow && m_pCurrentWindow->m_sAdditionalConfigData.forceNoBlur)) {
+ (m_pCurrentWindow && (m_pCurrentWindow->m_sAdditionalConfigData.forceNoBlur || m_pCurrentWindow->m_sAdditionalConfigData.forceRGBX))) {
renderTexture(tex, pBox, a, round, false, true);
return;
}