mirror of
https://github.com/hyprwm/hyprlock.git
synced 2025-12-20 00:40:03 +01:00
core: remove --immediate option
not necessary anymore, grace is not a configuration option
This commit is contained in:
parent
6c3ba296c1
commit
0c99899157
3 changed files with 7 additions and 15 deletions
|
|
@ -35,7 +35,7 @@ static void setMallocThreshold() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
CHyprlock::CHyprlock(const std::string& wlDisplay, const bool immediate, const bool immediateRender, const int graceSeconds) {
|
CHyprlock::CHyprlock(const std::string& wlDisplay, const bool immediateRender, const int graceSeconds) {
|
||||||
setMallocThreshold();
|
setMallocThreshold();
|
||||||
|
|
||||||
m_sWaylandState.display = wl_display_connect(wlDisplay.empty() ? nullptr : wlDisplay.c_str());
|
m_sWaylandState.display = wl_display_connect(wlDisplay.empty() ? nullptr : wlDisplay.c_str());
|
||||||
|
|
@ -43,10 +43,7 @@ CHyprlock::CHyprlock(const std::string& wlDisplay, const bool immediate, const b
|
||||||
|
|
||||||
g_pEGL = makeUnique<CEGL>(m_sWaylandState.display);
|
g_pEGL = makeUnique<CEGL>(m_sWaylandState.display);
|
||||||
|
|
||||||
if (!immediate) {
|
m_tGraceEnds = graceSeconds ? std::chrono::system_clock::now() + std::chrono::seconds(graceSeconds) : std::chrono::system_clock::from_time_t(0);
|
||||||
m_tGraceEnds = graceSeconds ? std::chrono::system_clock::now() + std::chrono::seconds(graceSeconds) : std::chrono::system_clock::from_time_t(0);
|
|
||||||
} else
|
|
||||||
m_tGraceEnds = std::chrono::system_clock::from_time_t(0);
|
|
||||||
|
|
||||||
static const auto IMMEDIATERENDER = g_pConfigManager->getValue<Hyprlang::INT>("general:immediate_render");
|
static const auto IMMEDIATERENDER = g_pConfigManager->getValue<Hyprlang::INT>("general:immediate_render");
|
||||||
m_bImmediateRender = immediateRender || *IMMEDIATERENDER;
|
m_bImmediateRender = immediateRender || *IMMEDIATERENDER;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ struct SDMABUFModifier {
|
||||||
|
|
||||||
class CHyprlock {
|
class CHyprlock {
|
||||||
public:
|
public:
|
||||||
CHyprlock(const std::string& wlDisplay, const bool immediate, const bool immediateRender, const int gracePeriod);
|
CHyprlock(const std::string& wlDisplay, const bool immediateRender, const int gracePeriod);
|
||||||
~CHyprlock();
|
~CHyprlock();
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
|
|
||||||
13
src/main.cpp
13
src/main.cpp
|
|
@ -14,7 +14,6 @@ void help() {
|
||||||
" -c FILE, --config FILE - Specify config file to use\n"
|
" -c FILE, --config FILE - Specify config file to use\n"
|
||||||
" --display NAME - Specify the Wayland display to connect to\n"
|
" --display NAME - Specify the Wayland display to connect to\n"
|
||||||
" --grace SECONDS - Set grace period in seconds before requiring authentication\n"
|
" --grace SECONDS - Set grace period in seconds before requiring authentication\n"
|
||||||
" --immediate - Lock immediately, ignoring any configured grace period\n"
|
|
||||||
" --immediate-render - Do not wait for resources before drawing the background\n"
|
" --immediate-render - Do not wait for resources before drawing the background\n"
|
||||||
" --no-fade-in - Disable the fade-in animation when the lock screen appears\n"
|
" --no-fade-in - Disable the fade-in animation when the lock screen appears\n"
|
||||||
" -V, --version - Show version information\n"
|
" -V, --version - Show version information\n"
|
||||||
|
|
@ -41,10 +40,9 @@ static void printVersion() {
|
||||||
int main(int argc, char** argv, char** envp) {
|
int main(int argc, char** argv, char** envp) {
|
||||||
std::string configPath;
|
std::string configPath;
|
||||||
std::string wlDisplay;
|
std::string wlDisplay;
|
||||||
bool immediate = false;
|
|
||||||
bool immediateRender = false;
|
bool immediateRender = false;
|
||||||
bool noFadeIn = false;
|
bool noFadeIn = false;
|
||||||
int graceSeconds = 0;
|
int graceSeconds = 0;
|
||||||
|
|
||||||
std::vector<std::string> args(argv, argv + argc);
|
std::vector<std::string> args(argv, argv + argc);
|
||||||
|
|
||||||
|
|
@ -94,10 +92,7 @@ int main(int argc, char** argv, char** envp) {
|
||||||
} else
|
} else
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
} else if (arg == "--immediate")
|
} else if (arg == "--immediate-render")
|
||||||
immediate = true;
|
|
||||||
|
|
||||||
else if (arg == "--immediate-render")
|
|
||||||
immediateRender = true;
|
immediateRender = true;
|
||||||
|
|
||||||
else if (arg == "--no-fade-in")
|
else if (arg == "--no-fade-in")
|
||||||
|
|
@ -124,11 +119,11 @@ int main(int argc, char** argv, char** envp) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noFadeIn || immediate)
|
if (noFadeIn)
|
||||||
g_pConfigManager->m_AnimationTree.setConfigForNode("fadeIn", false, 0.f, "default");
|
g_pConfigManager->m_AnimationTree.setConfigForNode("fadeIn", false, 0.f, "default");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
g_pHyprlock = makeUnique<CHyprlock>(wlDisplay, immediate, immediateRender, graceSeconds);
|
g_pHyprlock = makeUnique<CHyprlock>(wlDisplay, immediateRender, graceSeconds);
|
||||||
g_pHyprlock->run();
|
g_pHyprlock->run();
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
Debug::log(CRIT, "Hyprlock threw: {}", ex.what());
|
Debug::log(CRIT, "Hyprlock threw: {}", ex.what());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue