* 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.
* lockSurface: discard frameCallback when eglSwapBuffers fails
* egl: log more errors
* fix: handle EGL surface creation failure gracefully instead of aborting
When GPU VRAM is exhausted, eglCreatePlatformWindowSurfaceEXT and
wl_egl_window_create can return null. Previously this triggered
RASSERT -> std::abort(), crashing hyprlock and leaving the session
in a broken lock state.
Replace RASSERT with error logging and early return, setting
readyForFrame = false so the next configure event retries the
allocation. This allows hyprlock to survive transient GPU memory
pressure rather than crashing.
Fixes: https://github.com/hyprwm/hyprlock/issues/986
* lock-surface: improve error handling for lock surface configure
---------
Co-authored-by: Nilesh <nilesh@cloudgeni.us>
* pam: fix username race by using getpwuid_r instead of getpwuid
getpwuid() returns a pointer into a static buffer shared across all
threads. Any getpw*/getpwent call from another thread — including
those made internally by PAM modules during authentication — will
overwrite it before pam_start() reads pw_name, causing hyprlock to
authenticate as a random system user (root, bin, systemd-network)
or fail with 'user unknown'.
Replace with getpwuid_r(), which writes into a caller-supplied buffer,
and copy pw_name into a std::string before calling pam_start().
* pam: get username once
Instead of retrieving the username via getpwuid_r as in a69f526c95,
get the username once when initializing CPam and save it in a string.
This should be sufficent for making sure there are no problems with the
static buffer returned by getpwuid and is simpler.
* misc: clang-format
---------
Co-authored-by: mcgi5sr2 <mcgi5sr2@gmail.com>
Properly lock AWP<IWidget> weak pointers before calling onAssetUpdate()
to prevent use-after-free when widgets are destroyed during shutdown or
output removal. Guard timer callback against null g_asyncResourceManager.
Fix destruction order to join threads before resetting globals.
* core: use Hyprgraphics::CAsyncResourceGatherer
* core: move screencopy frame generation to the new resource manager
* core: introduce a dedicated onAssetUpdate callback
* check for unloaded before finished and some cleanup
* also allow for dynamic label resource deduplication
use a simple counter instead of a timestamp to allow the same
widget on a different monitor to reuse a text cmd resource.
I didn't do this before, because I was worried about two labels that use
the same command with different reload times. I mitigated that by just
incrementing the revision by the time interval. This should be sufficent
to avoid clashes.
* don't render within onAssetUpdate to avoid duplicate renders
another much improvement for multi monitor setups.
allows updating within the same frame for most labels.
* remove nvidia workaround :)
I tested and it seems like the resource manager revision makes
the nvidia workaround obsolete.
FreeBSD has the pam library installed in the base system. However, it does not provide pam.pc file. So pkg_check_modules() fails to detect pam library. With this change, cmake tries to find it using find_library() first and falls back to pkg_check_modules().