-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sway/ipc-json: don't get decoration box for containers in scratchpad #7315
Conversation
Regressed by a5a44ba cc @baltitenger |
I think we should still populate the deco rect for scratchpad windows. |
I wasnt able to reproduce the issue from #7303, do the scratchpad containers have a geometry? |
Yes. In other words this patch introduces a regression: |
Is #7303 not a dupe of #7123? Either way testing A scratchpad container has A scratchpad hidden container has A scratchpad hidden split container child (parent is scratchpad hidden) has #7126 added a We should keep the deco_rect field regardless, but its fine to return zeros for hidden containers imo. |
…fore getting siblings
1d74975
to
10e060e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good now!
Scratchpad hidden split containers do have children, so those children have siblings, and I'm not sure its a good idea to say they don't. E.g. in sway it is possible to move a container into a scratchpad hidden parent as long as you can match it with criteria. It might be reasonable to refuse these actions, but we shouldn't crash on them: move to child of scratchpad hidden split container w/ this patch
^ caller gets confused because a container with a parent has no siblings. The problem in #7123 is that we can't really rely on the invariant Callers will still need to check the return value of this function if they didn't previously guarantee it isn't called on detached containers. Some existing calls already guard against this directly: Lines 1565 to 1566 in c32a507
But I think prior to #7113 all callers of Lines 775 to 776 in c32a507
The scratchpad is special cased in a lot of places so this pitfall may have just been accidentally avoided. There is no point in keeping this footgun around so #7126 is a good change, except the I'm guessing #7303 was already fixed by #7126 as I am not able to reproduce it on master. I think the current code in master is correct, except for the redundant check just mentioned, and that get_deco_rect should probably immediately return 0's when parent_layout == L_NONE instead of calling container_get_siblings and crashing (or waiting around to see that it is NULL on master): Lines 529 to 531 in c32a507
Yes this is all pretty annoying and ugly and could use a rework. |
return container->pending.parent->pending.children; | ||
} | ||
if (container_is_scratchpad_hidden(container)) { | ||
if (container_is_scratchpad_hidden_or_child(container)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning NULL for children of scratchpad hidden split containers may crash in certain operations. See comment.
The check for container->pending.workspace already covers this. References: swaywm#7315 (comment)
The check for container->pending.workspace already covers this. References: #7315 (comment)
I believe per the comment above this PR is not needed. |
Fixes #7303