Skip to content

fix(movetoworkspace): guard node dereference when moving floating window#304

Open
sim590 wants to merge 1 commit into
outfoxxed:masterfrom
sim590:fix/movetoworkspace-float-follow
Open

fix(movetoworkspace): guard node dereference when moving floating window#304
sim590 wants to merge 1 commit into
outfoxxed:masterfrom
sim590:fix/movetoworkspace-float-follow

Conversation

@sim590

@sim590 sim590 commented May 4, 2026

Copy link
Copy Markdown

Problem

When a floating window (not managed by hy3) is focused and hy3:movetoworkspace is dispatched with follow=true, getWorkspaceFocusedNode returns nullptr because the window has no hy3 node. The code correctly takes the floating-window path and calls moveWindowToWorkspaceSafe, but then falls through to the if (follow) block which calls node->layout() unconditionally, causing a SIGSEGV.

Reproducible with any floating window (e.g. alacritty in float mode):

hy3:movetoworkspace, <workspace>, follow

Fix

Add a null check on node before dereferencing it in the follow block. The workspace switch and monitor focus still happen; only the hy3-specific recalc and focus calls are skipped when there is no hy3 node to act on.

When a floating window (not managed by hy3) is moved to another
workspace with follow=true, getWorkspaceFocusedNode returns nullptr.
The code correctly takes the floating window path and calls
moveWindowToWorkspaceSafe, but then falls through to the follow block
which calls node->layout() unconditionally, causing a SIGSEGV.

Add a null check before dereferencing node in the follow block.
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