lock-surface: improved handling of egl window and surface creation#988
Merged
PointerDilemma merged 2 commits intohyprwm:mainfrom Apr 13, 2026
Merged
Conversation
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: hyprwm#986
5 tasks
Member
|
looks fine to me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successor of #987
Thanks @lvnilesh
I revised the logging a bit and also updated the code path for when
configure is called again (e.g. on a scale update). Just to make sure we only resize and don't associate an existing eglWindow with another eglSurface, which is invalid according to the docs for eglCreateWindowSurface.
I tried to provoke one of those errors, by allocating lots of gpu memory, but I wasn't able to make eglCreateWindowSurface fail. Compositor always froze before that.
From my comment in #987 I expect the following failure scenarios if either creating window or surface fails:
On startup:
When a new output gets added at runtime (1) and (2) happens. After that nothing will happen. One should still be able to unlock even though there might not be any UI.