Skip to content

Commit

Permalink
Bring back --no-fade-in and move g_pAnimationManager initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
PaideiaDilemma committed Jan 3, 2025
1 parent d219cdd commit 8860989
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/core/hyprlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

using namespace Hyprutils::OS;

CHyprlock::CHyprlock(const std::string& wlDisplay, const bool immediate, const bool immediateRender, const bool noFadeIn) {
CHyprlock::CHyprlock(const std::string& wlDisplay, const bool immediate, const bool immediateRender) {
m_sWaylandState.display = wl_display_connect(wlDisplay.empty() ? nullptr : wlDisplay.c_str());
if (!m_sWaylandState.display) {
Debug::log(CRIT, "Couldn't connect to a wayland compositor");
Expand Down
4 changes: 1 addition & 3 deletions src/core/hyprlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct SDMABUFModifier {

class CHyprlock {
public:
CHyprlock(const std::string& wlDisplay, const bool immediate, const bool immediateRender, const bool noFadeIn);
CHyprlock(const std::string& wlDisplay, const bool immediate, const bool immediateRender);
~CHyprlock();

void run();
Expand Down Expand Up @@ -95,8 +95,6 @@ class CHyprlock {

bool m_bImmediateRender = false;

bool m_bNoFadeIn = false;

std::string m_sCurrentDesktop = "";

//
Expand Down
10 changes: 7 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ int main(int argc, char** argv, char** envp) {
}
}

g_pAnimationManager = std::make_unique<CHyprlockAnimationManager>();

try {
g_pAnimationManager = std::make_unique<CHyprlockAnimationManager>();
g_pConfigManager = std::make_unique<CConfigManager>(configPath);
g_pConfigManager = std::make_unique<CConfigManager>(configPath);
g_pConfigManager->init();
} catch (const std::exception& ex) {
Debug::log(CRIT, "ConfigManager threw: {}", ex.what());
Expand All @@ -102,8 +103,11 @@ int main(int argc, char** argv, char** envp) {
return 1;
}

if (noFadeIn)
g_pConfigManager->m_AnimationTree.setConfigForNode("fadeIn", false, 0.f, "default");

try {
g_pHyprlock = std::make_unique<CHyprlock>(wlDisplay, immediate, immediateRender, noFadeIn);
g_pHyprlock = std::make_unique<CHyprlock>(wlDisplay, immediate, immediateRender);
g_pHyprlock->run();
} catch (const std::exception& ex) {
Debug::log(CRIT, "Hyprlock threw: {}", ex.what());
Expand Down

0 comments on commit 8860989

Please sign in to comment.