Skip to content

lock-surface: improved handling of egl window and surface creation#988

Merged
PointerDilemma merged 2 commits intohyprwm:mainfrom
PointerDilemma:lock-surface-configure-error-handling
Apr 13, 2026
Merged

lock-surface: improved handling of egl window and surface creation#988
PointerDilemma merged 2 commits intohyprwm:mainfrom
PointerDilemma:lock-surface-configure-error-handling

Conversation

@PointerDilemma
Copy link
Copy Markdown
Collaborator

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:

  1. We fail to commit a lock surface to an output (there is no retry mechanism)
  2. After a slight delay the "lockscreen app died" image will render on that output. A solid color on other compositors.
  3. The compositor will kick us as the lock screen application, because we failed to commit a lock surface after some amount of time.
  4. hyprlock exits gracefully after receiving the finished event. (Which is better than an abort)

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.

lvnilesh and others added 2 commits April 10, 2026 09:20
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
@vaxerski
Copy link
Copy Markdown
Member

looks fine to me

@PointerDilemma PointerDilemma merged commit ca2aa5e into hyprwm:main Apr 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants