mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-12-22 13:29:48 +01:00
parent
ba4b08e5f5
commit
972c1c27e6
3 changed files with 22 additions and 17 deletions
|
@ -1083,10 +1083,16 @@ void CHyprlock::attemptRestoreOnDeath() {
|
|||
if (m_bTerminate)
|
||||
return;
|
||||
|
||||
const auto XDG_RUNTIME_DIR = getenv("XDG_RUNTIME_DIR");
|
||||
const auto HIS = getenv("HYPRLAND_INSTANCE_SIGNATURE");
|
||||
|
||||
if (!XDG_RUNTIME_DIR || !HIS)
|
||||
return;
|
||||
|
||||
// dirty hack
|
||||
uint64_t timeNowMs = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - std::chrono::system_clock::from_time_t({0})).count();
|
||||
|
||||
constexpr const char* LASTRESTARTPATH = "/tmp/hypr/.hyprlockrestart";
|
||||
const auto LASTRESTARTPATH = std::string{XDG_RUNTIME_DIR} + "/.hyprlockrestart";
|
||||
|
||||
if (std::filesystem::exists(LASTRESTARTPATH)) {
|
||||
std::ifstream ifs(LASTRESTARTPATH);
|
||||
|
|
|
@ -52,7 +52,6 @@ cairo_surface_t* WEBP::createSurfaceFromWEBP(const std::filesystem::path& path)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
config.output.colorspace = MODE_bgrA;
|
||||
#else
|
||||
|
@ -81,5 +80,4 @@ cairo_surface_t* WEBP::createSurfaceFromWEBP(const std::filesystem::path& path)
|
|||
WebPFreeDecBuffer(&config.output);
|
||||
|
||||
return cairoSurface;
|
||||
|
||||
}
|
||||
|
|
|
@ -204,7 +204,8 @@ CRenderer::SRenderFeedback CRenderer::renderLock(const CSessionLockSurface& surf
|
|||
bga = 1.0;
|
||||
|
||||
if (g_pHyprlock->m_bFadeStarted && !**PNOFADEOUT) {
|
||||
bga = std::clamp(std::chrono::duration_cast<std::chrono::microseconds>(g_pHyprlock->m_tFadeEnds - std::chrono::system_clock::now()).count() / 500000.0 - 0.02, 0.0, 1.0);
|
||||
bga =
|
||||
std::clamp(std::chrono::duration_cast<std::chrono::microseconds>(g_pHyprlock->m_tFadeEnds - std::chrono::system_clock::now()).count() / 500000.0 - 0.02, 0.0, 1.0);
|
||||
// - 0.02 so that the fade ends a little earlier than the final second
|
||||
}
|
||||
// render widgets
|
||||
|
|
Loading…
Reference in a new issue