Skip to content

fix: guard tiling preview without grabbed view - #4

Open
mateoalfaro wants to merge 1 commit into
singularityos-lab:singularityfrom
mateoalfaro:fix-tiling-crash
Open

fix: guard tiling preview without grabbed view#4
mateoalfaro wants to merge 1 commit into
singularityos-lab:singularityfrom
mateoalfaro:fix-tiling-crash

Conversation

@mateoalfaro

@mateoalfaro mateoalfaro commented Sep 4, 2026

Copy link
Copy Markdown

Summary

labwc aborts with an assertion failure when a tiling drop preview is requested
without an active interactive move, taking down the whole session:

labwc: ../src/view.c:1399: view_is_floating: Assertion `view' failed.
(EE) failed to read Wayland events: Broken pipe
.singularity-labwc-session-wrapped: line 35: 23973 Aborted (core dumped) labwc -S "$BIN/singularity-desktop-session"
[...] labwc session exited rc=134 after 4s; retrying with software rendering

This repeats on every session start (~4s in, SIGABRT), and even the session
wrapper's software-rendering retry crashes with the same assertion, so the
desktop never comes up.

Root cause

view_is_floating() asserts on a non-NULL view, but two tiling-preview call
sites pass server.grabbed_view, which is only set during an interactive
move. Overlay updates can also be requested by the singularity-tiling protocol
while no move is active, so the NULL grabbed view reaches the assertion.

Changes

  • src/interactive.c (edge_from_cursor): return early when there is no
    server.grabbed_view — with no grabbed view there is no edge-snap candidate.
  • src/regions.c (regions_should_snap): add the same !server.grabbed_view
    guard alongside the existing snap conditions.
  • src/protocols/singularity-tiling.c (handle_set_drop_preview): if the
    drop preview is not active, finish the overlay and return instead of calling
    overlay_update() on stale state.

Testing

  • Rebuilt and ran the session on the affected machine: the assertion no longer
    triggers and the session stays up past the previous ~4s crash point.
  • Verified view_is_floating() call sites: remaining callers either hold a
    valid view or already NULL-check.

Logs

Crash from ~/.local/state/singularity/labwc.log:

00:00:01.997 [ERROR] [xwayland/xwm.c:1984] xcb error: op ChangeWindowAttributes ...
labwc: ../src/view.c:1399: view_is_floating: Assertion `view' failed.
(EE) failed to read Wayland events: Broken pipe

Fix tested on NixOS 26.11

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.

1 participant