core: eglReleaseThread when we have no outputs

This fixes monitor on/off on the somewhat broken nvidia 580 drivers
and potentially other nvidia drivers as well.
This commit is contained in:
Maximilian Seidler 2026-04-17 10:34:59 +02:00
parent 34532cbd80
commit 84aa55d223
3 changed files with 7 additions and 1 deletions

View file

@ -78,7 +78,7 @@ void updateGradientVariable(CAnimatedVariable<CGradientValueData>& av, const flo
void CHyprlockAnimationManager::tick() {
static const auto ANIMATIONSENABLED = g_pConfigManager->getValue<Hyprlang::INT>("animations:enabled");
const auto CPY = m_vActiveAnimatedVariables;
const auto CPY = m_vActiveAnimatedVariables;
for (const auto& PAV : CPY) {
if (!PAV || !PAV->ok())

View file

@ -306,6 +306,9 @@ void CHyprlock::run() {
g_pRenderer->removeWidgetsFor((*outputIt)->m_ID);
m_vOutputs.erase(outputIt);
}
if (m_vOutputs.empty())
eglReleaseThread();
});
wl_display_roundtrip(m_sWaylandState.display);

View file

@ -5,6 +5,7 @@
#include "../helpers/MiscFunctions.hpp"
#include "../core/hyprlock.hpp"
#include "../config/ConfigManager.hpp"
#include "../core/Egl.hpp"
#include <algorithm>
#include <cstdint>
@ -314,6 +315,8 @@ void CAsyncResourceManager::onResourceFinished(ResourceID id) {
Log::logger->log(Log::TRACE, "Resource to texture id:{}", id);
g_pEGL->makeCurrent(nullptr);
const auto texture = makeAtomicShared<CTexture>();
const cairo_status_t SURFACESTATUS = (cairo_status_t)RESOURCE->m_asset.cairoSurface->status();