mirror of
https://github.com/hyprwm/hyprlock.git
synced 2026-05-19 19:28:08 +02:00
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
This commit is contained in:
parent
d7079a1248
commit
2393fb7590
1 changed files with 10 additions and 2 deletions
|
|
@ -84,13 +84,21 @@ void CSessionLockSurface::configure(const Vector2D& size_, uint32_t serial_) {
|
|||
|
||||
if (!eglWindow) {
|
||||
eglWindow = wl_egl_window_create((wl_surface*)surface->resource(), size.x, size.y);
|
||||
RASSERT(eglWindow, "Couldn't create eglWindow");
|
||||
if (!eglWindow) {
|
||||
Debug::log(ERR, "Couldn't create eglWindow (GPU memory pressure?), will retry on next configure");
|
||||
readyForFrame = false;
|
||||
return;
|
||||
}
|
||||
} else
|
||||
wl_egl_window_resize(eglWindow, size.x, size.y, 0, 0);
|
||||
|
||||
if (!eglSurface) {
|
||||
eglSurface = g_pEGL->eglCreatePlatformWindowSurfaceEXT(g_pEGL->eglDisplay, g_pEGL->eglConfig, eglWindow, nullptr);
|
||||
RASSERT(eglSurface, "Couldn't create eglSurface");
|
||||
if (!eglSurface) {
|
||||
Debug::log(ERR, "Couldn't create eglSurface (GPU memory pressure?), will retry on next configure");
|
||||
readyForFrame = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (readyForFrame && !(SAMESIZE && SAMESCALE)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue