mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 16:05:58 +01:00
rules: add nodim
This commit is contained in:
parent
baf81cdc5d
commit
e76bd43f53
6 changed files with 13 additions and 8 deletions
|
@ -1665,7 +1665,7 @@ void CCompositor::updateWindowAnimatedDecorationValues(CWindow* pWindow) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// dim
|
// dim
|
||||||
if (pWindow == m_pLastWindow) {
|
if (pWindow == m_pLastWindow || pWindow->m_sAdditionalConfigData.forceNoDim) {
|
||||||
pWindow->m_fDimPercent = 0;
|
pWindow->m_fDimPercent = 0;
|
||||||
} else {
|
} else {
|
||||||
pWindow->m_fDimPercent = *PDIMSTRENGTH;
|
pWindow->m_fDimPercent = *PDIMSTRENGTH;
|
||||||
|
|
|
@ -435,6 +435,8 @@ void CWindow::applyDynamicRule(const SWindowRule& r) {
|
||||||
m_sAdditionalConfigData.forceNoBorder = true;
|
m_sAdditionalConfigData.forceNoBorder = true;
|
||||||
} else if (r.szRule == "noshadow") {
|
} else if (r.szRule == "noshadow") {
|
||||||
m_sAdditionalConfigData.forceNoShadow = true;
|
m_sAdditionalConfigData.forceNoShadow = true;
|
||||||
|
} else if (r.szRule == "nodim") {
|
||||||
|
m_sAdditionalConfigData.forceNoDim = true;
|
||||||
} else if (r.szRule == "forcergbx") {
|
} else if (r.szRule == "forcergbx") {
|
||||||
m_sAdditionalConfigData.forceRGBX = true;
|
m_sAdditionalConfigData.forceRGBX = true;
|
||||||
} else if (r.szRule == "opaque") {
|
} else if (r.szRule == "opaque") {
|
||||||
|
@ -495,6 +497,7 @@ void CWindow::updateDynamicRules() {
|
||||||
m_sAdditionalConfigData.forceNoBlur = false;
|
m_sAdditionalConfigData.forceNoBlur = false;
|
||||||
m_sAdditionalConfigData.forceNoBorder = false;
|
m_sAdditionalConfigData.forceNoBorder = false;
|
||||||
m_sAdditionalConfigData.forceNoShadow = false;
|
m_sAdditionalConfigData.forceNoShadow = false;
|
||||||
|
m_sAdditionalConfigData.forceNoDim = false;
|
||||||
if (!m_sAdditionalConfigData.forceOpaqueOverridden)
|
if (!m_sAdditionalConfigData.forceOpaqueOverridden)
|
||||||
m_sAdditionalConfigData.forceOpaque = false;
|
m_sAdditionalConfigData.forceOpaque = false;
|
||||||
m_sAdditionalConfigData.forceNoAnims = false;
|
m_sAdditionalConfigData.forceNoAnims = false;
|
||||||
|
|
|
@ -10,8 +10,7 @@
|
||||||
#include "helpers/Vector2D.hpp"
|
#include "helpers/Vector2D.hpp"
|
||||||
#include "helpers/WLSurface.hpp"
|
#include "helpers/WLSurface.hpp"
|
||||||
|
|
||||||
enum eIdleInhibitMode
|
enum eIdleInhibitMode {
|
||||||
{
|
|
||||||
IDLEINHIBIT_NONE = 0,
|
IDLEINHIBIT_NONE = 0,
|
||||||
IDLEINHIBIT_ALWAYS,
|
IDLEINHIBIT_ALWAYS,
|
||||||
IDLEINHIBIT_FULLSCREEN,
|
IDLEINHIBIT_FULLSCREEN,
|
||||||
|
@ -117,6 +116,7 @@ struct SWindowAdditionalConfigData {
|
||||||
CWindowOverridableVar<bool> forceNoAnims = false;
|
CWindowOverridableVar<bool> forceNoAnims = false;
|
||||||
CWindowOverridableVar<bool> forceNoBorder = false;
|
CWindowOverridableVar<bool> forceNoBorder = false;
|
||||||
CWindowOverridableVar<bool> forceNoShadow = false;
|
CWindowOverridableVar<bool> forceNoShadow = false;
|
||||||
|
CWindowOverridableVar<bool> forceNoDim = false;
|
||||||
CWindowOverridableVar<bool> windowDanceCompat = false;
|
CWindowOverridableVar<bool> windowDanceCompat = false;
|
||||||
CWindowOverridableVar<bool> noMaxSize = false;
|
CWindowOverridableVar<bool> noMaxSize = false;
|
||||||
CWindowOverridableVar<bool> dimAround = false;
|
CWindowOverridableVar<bool> dimAround = false;
|
||||||
|
|
|
@ -856,10 +856,10 @@ void CConfigManager::handleUnbind(const std::string& command, const std::string&
|
||||||
bool windowRuleValid(const std::string& RULE) {
|
bool windowRuleValid(const std::string& RULE) {
|
||||||
return !(RULE != "float" && RULE != "tile" && RULE.find("opacity") != 0 && RULE.find("move") != 0 && RULE.find("size") != 0 && RULE.find("minsize") != 0 &&
|
return !(RULE != "float" && RULE != "tile" && RULE.find("opacity") != 0 && RULE.find("move") != 0 && RULE.find("size") != 0 && RULE.find("minsize") != 0 &&
|
||||||
RULE.find("maxsize") != 0 && RULE.find("pseudo") != 0 && RULE.find("monitor") != 0 && RULE.find("idleinhibit") != 0 && RULE != "nofocus" && RULE != "noblur" &&
|
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 != "noshadow" && RULE != "nodim" && RULE != "noborder" && RULE != "center" && RULE != "opaque" && RULE != "forceinput" && RULE != "fullscreen" &&
|
||||||
RULE != "fakefullscreen" && RULE != "nomaxsize" && RULE != "pin" && RULE != "noanim" && RULE != "dimaround" && RULE != "windowdance" && RULE != "maximize" &&
|
RULE != "nofullscreenrequest" && RULE != "fakefullscreen" && RULE != "nomaxsize" && RULE != "pin" && RULE != "noanim" && RULE != "dimaround" &&
|
||||||
RULE.find("animation") != 0 && RULE.find("rounding") != 0 && RULE.find("workspace") != 0 && RULE.find("bordercolor") != 0 && RULE != "forcergbx" &&
|
RULE != "windowdance" && RULE != "maximize" && RULE.find("animation") != 0 && RULE.find("rounding") != 0 && RULE.find("workspace") != 0 &&
|
||||||
RULE != "noinitialfocus");
|
RULE.find("bordercolor") != 0 && RULE != "forcergbx" && RULE != "noinitialfocus");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool layerRuleValid(const std::string& RULE) {
|
bool layerRuleValid(const std::string& RULE) {
|
||||||
|
|
|
@ -952,6 +952,8 @@ std::string dispatchSetProp(std::string request) {
|
||||||
PWINDOW->m_sAdditionalConfigData.forceNoBorder.forceSetIgnoreLocked(configStringToInt(VAL), lock);
|
PWINDOW->m_sAdditionalConfigData.forceNoBorder.forceSetIgnoreLocked(configStringToInt(VAL), lock);
|
||||||
} else if (PROP == "forcenoshadow") {
|
} else if (PROP == "forcenoshadow") {
|
||||||
PWINDOW->m_sAdditionalConfigData.forceNoShadow.forceSetIgnoreLocked(configStringToInt(VAL), lock);
|
PWINDOW->m_sAdditionalConfigData.forceNoShadow.forceSetIgnoreLocked(configStringToInt(VAL), lock);
|
||||||
|
} else if (PROP == "forcenodim") {
|
||||||
|
PWINDOW->m_sAdditionalConfigData.forceNoDim.forceSetIgnoreLocked(configStringToInt(VAL), lock);
|
||||||
} else if (PROP == "windowdancecompat") {
|
} else if (PROP == "windowdancecompat") {
|
||||||
PWINDOW->m_sAdditionalConfigData.windowDanceCompat.forceSetIgnoreLocked(configStringToInt(VAL), lock);
|
PWINDOW->m_sAdditionalConfigData.windowDanceCompat.forceSetIgnoreLocked(configStringToInt(VAL), lock);
|
||||||
} else if (PROP == "nomaxsize") {
|
} else if (PROP == "nomaxsize") {
|
||||||
|
|
|
@ -438,7 +438,7 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
(PWINDOW->m_iX11Type != 2 || (PWINDOW->m_bIsX11 && wlr_xwayland_or_surface_wants_focus(PWINDOW->m_uSurface.xwayland))) && !workspaceSilent) {
|
(PWINDOW->m_iX11Type != 2 || (PWINDOW->m_bIsX11 && wlr_xwayland_or_surface_wants_focus(PWINDOW->m_uSurface.xwayland))) && !workspaceSilent) {
|
||||||
g_pCompositor->focusWindow(PWINDOW);
|
g_pCompositor->focusWindow(PWINDOW);
|
||||||
PWINDOW->m_fActiveInactiveAlpha.setValueAndWarp(*PACTIVEALPHA);
|
PWINDOW->m_fActiveInactiveAlpha.setValueAndWarp(*PACTIVEALPHA);
|
||||||
PWINDOW->m_fDimPercent.setValueAndWarp(*PDIMSTRENGTH);
|
PWINDOW->m_fDimPercent.setValueAndWarp(PWINDOW->m_sAdditionalConfigData.forceNoDim ? 0.f : *PDIMSTRENGTH);
|
||||||
} else {
|
} else {
|
||||||
PWINDOW->m_fActiveInactiveAlpha.setValueAndWarp(*PINACTIVEALPHA);
|
PWINDOW->m_fActiveInactiveAlpha.setValueAndWarp(*PINACTIVEALPHA);
|
||||||
PWINDOW->m_fDimPercent.setValueAndWarp(0);
|
PWINDOW->m_fDimPercent.setValueAndWarp(0);
|
||||||
|
|
Loading…
Reference in a new issue