added a noanim rule

This commit is contained in:
Vaxry 2022-10-06 09:16:40 +01:00
parent 095688712d
commit 190ddb5697
4 changed files with 8 additions and 2 deletions

View file

@ -23,6 +23,7 @@ struct SWindowAdditionalConfigData {
bool forceNoBlur = false;
bool forceOpaque = false;
bool forceAllowsInput = false;
bool forceNoAnims = false;
};
class CWindow {

View file

@ -721,6 +721,7 @@ bool windowRuleValid(const std::string& RULE) {
&& RULE != "forceinput"
&& RULE != "fullscreen"
&& RULE != "pin"
&& RULE != "noanim"
&& RULE.find("animation") != 0
&& RULE.find("rounding") != 0
&& RULE.find("workspace") != 0);

View file

@ -166,6 +166,8 @@ void Events::listener_mapWindow(void* owner, void* data) {
PWINDOW->m_sAdditionalConfigData.forceAllowsInput = true;
} else if (r.szRule == "pin") {
PWINDOW->m_bPinned = true;
} else if (r.szRule == "noanim") {
PWINDOW->m_sAdditionalConfigData.forceNoAnims = true;
} else if (r.szRule.find("rounding") == 0) {
try {
PWINDOW->m_sAdditionalConfigData.rounding = std::stoi(r.szRule.substr(r.szRule.find_first_of(' ') + 1));

View file

@ -21,12 +21,12 @@ void CAnimationManager::addBezierWithName(std::string name, const Vector2D& p1,
void CAnimationManager::tick() {
bool animationsDisabled = false;
bool animGlobalDisabled = false;
static auto *const PANIMENABLED = &g_pConfigManager->getConfigValuePtr("animations:enabled")->intValue;
if (!*PANIMENABLED)
animationsDisabled = true;
animGlobalDisabled = true;
static auto *const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue;
static auto *const PSHADOWSENABLED = &g_pConfigManager->getConfigValuePtr("decoration:drop_shadow")->intValue;
@ -56,11 +56,13 @@ void CAnimationManager::tick() {
const auto PWORKSPACE = (CWorkspace*)av->m_pWorkspace;
const auto PLAYER = (SLayerSurface*)av->m_pLayer;
CMonitor* PMONITOR = nullptr;
bool animationsDisabled = animGlobalDisabled;
wlr_box WLRBOXPREV = {0,0,0,0};
if (PWINDOW) {
WLRBOXPREV = PWINDOW->getFullWindowBoundingBox();
PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID);
animationsDisabled = animationsDisabled || PWINDOW->m_sAdditionalConfigData.forceNoAnims;
} else if (PWORKSPACE) {
PMONITOR = g_pCompositor->getMonitorFromID(PWORKSPACE->m_iMonitorID);
WLRBOXPREV = {(int)PMONITOR->vecPosition.x, (int)PMONITOR->vecPosition.y, (int)PMONITOR->vecSize.x, (int)PMONITOR->vecSize.y};