Repository navigation
fix(wl_placement): read the geometry payload by structure, in any key order (runtime#1928) - #76
Merged
Merged
Conversation
… order (runtime#1928) get_own_geometry searched substrings from the first `"pid":N,`, which assumed the GNOME extension's key order (pid first, monitor after). A publisher that writes keys sorted — the KWin publisher of runtime#1928 — put "monitor" before "pid", so for the caller's last window `mon` was null and the unconditional device_scale lookup called strstr(nullptr): a segfault. In every other order it silently failed. The parser moves into a pure header (dxr_wl_geom_json.h) that walks the top-level object, the windows array, each window object and its monitor object, and looks every key up at its own depth. A pid that prefixes another, key names inside strings and nested objects can no longer be misread. Rect integers still truncate, as the runtime's cJSON consumer reads them. New test displayxr_linux_window_geom_json_test (GNOME order, sorted order, decoys, failures), run in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 12, 2026
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.
Reported by the KWin publisher author on DisplayXR/displayxr-runtime#1928.
Bug.
DxrWlPlacement::get_own_geometryfound keys by substring search from the first"pid":N,, assuming the GNOME extension's key order. With sorted keys (monitorbeforepid) and the caller's window last,monwas null and the unconditionaldevice_scalelookup calledstrstr(nullptr): a segfault (reproduced againstorigin/main's helpers). In any other non-GNOME order it silently returned false. We never saw it because the GNOME extension always writespidfirst andmonitorafter.Fix. The parser moves into a pure header,
common/linux/dxr_wl_geom_json.h. It walks the structure (top-level object →windows[]→ window object →monitorobject) and reads each key at its own depth, so key order, whitespace, pid prefixes (12vs123), key names inside strings and nested objects can't be misread. Rect integers still truncate, matching the runtime's cJSON consumer (comp_vk_native_wl_geom.c), so app and runtime agree on every pixel. No new dependency.Test. New
displayxr_linux_window_geom_json_test(GNOME order, fully sorted KWin order, decoys, failure cases), added to thelinux_windowCI job. The existing lattice/drag/input/scale tests pass locally.🤖 Generated with Claude Code