Skip to content

Commit

Permalink
config: add no_fade_in
Browse files Browse the repository at this point in the history
fixes #55
  • Loading branch information
vaxerski committed Feb 22, 2024
1 parent 7ca13a8 commit 57ce4f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/config/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void CConfigManager::init() {
m_config.addConfigValue("general:disable_loading_bar", Hyprlang::INT{0});
m_config.addConfigValue("general:hide_cursor", Hyprlang::INT{0});
m_config.addConfigValue("general:grace", Hyprlang::INT{0});
m_config.addConfigValue("general:no_fade_in", Hyprlang::INT{0});

m_config.addSpecialCategory("background", Hyprlang::SSpecialCategoryOptions{.key = nullptr, .anonymousKeyBased = true});
m_config.addSpecialConfigValue("background", "monitor", Hyprlang::STRING{""});
Expand Down
10 changes: 7 additions & 3 deletions src/renderer/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static int frames = 0;
//
CRenderer::SRenderFeedback CRenderer::renderLock(const CSessionLockSurface& surf) {
static auto* const PDISABLEBAR = (Hyprlang::INT* const*)g_pConfigManager->getValuePtr("general:disable_loading_bar");
static auto* const PNOFADEIN = (Hyprlang::INT* const*)g_pConfigManager->getValuePtr("general:no_fade_in");

matrixProjection(projection.data(), surf.size.x, surf.size.y, WL_OUTPUT_TRANSFORM_NORMAL);

Expand All @@ -171,9 +172,9 @@ CRenderer::SRenderFeedback CRenderer::renderLock(const CSessionLockSurface& surf

SRenderFeedback feedback;

const float bga = asyncResourceGatherer->applied ?
std::clamp(std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - gatheredAt).count() / 500000.0, 0.0, 1.0) :
0.0;
float bga = asyncResourceGatherer->applied ?
std::clamp(std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - gatheredAt).count() / 500000.0, 0.0, 1.0) :
0.0;

if (!asyncResourceGatherer->ready) {
// render status
Expand All @@ -188,6 +189,9 @@ CRenderer::SRenderFeedback CRenderer::renderLock(const CSessionLockSurface& surf
gatheredAt = std::chrono::system_clock::now();
}

if (**PNOFADEIN)
bga = 1.0;

// render widgets
const auto WIDGETS = getOrCreateWidgetsFor(&surf);
for (auto& w : *WIDGETS) {
Expand Down

0 comments on commit 57ce4f7

Please sign in to comment.