raboof/volare
6
22
Fork
You've already forked volare
2

Avoid crash in 'unsplit' #69

Merged
raboof merged 1 commit from avoid_unsplit_crash into main 2023年07月17日 16:40:54 +02:00

When the target sibling doesn't allow children.

Possibly even better would be to insert a tabbed container in this case,
but leaving that for a future improvement.

Fixes #68

When the target sibling doesn't allow children. Possibly even better would be to insert a tabbed container in this case, but leaving that for a future improvement. Fixes #68
@ -90,0 +95,4 @@
}
if (!destination->pending.children) {
sway_log(SWAY_DEBUG, "do_unsplit: destination has no children list");
fprintf(stderr, "layout %d\n", destination->pending.layout);
Collaborator
Copy link

Stray fprintf() here should be removed.

Stray `fprintf()` here should be removed.
edmonds marked this conversation as resolved
Collaborator
Copy link

I'd omit the function names from the log messages sway_log(..."do_unsplit: "...); and sway_log(..."container_add_child: "...);. The sway_log() macro already adds the source filename and line number which is enough to identify where the log message was generated, and the general style in the Sway code base seems to be to omit function names from log messages. But if adding the function name to the log messages is useful maybe the sway_log() macro itself should also log the value of __func__ so the function name gets logged for every log message.

I'd omit the function names from the log messages `sway_log(..."do_unsplit: "...);` and `sway_log(..."container_add_child: "...);`. The `sway_log()` macro already adds the source filename and line number which is enough to identify where the log message was generated, and the general style in the Sway code base seems to be to omit function names from log messages. But if adding the function name to the log messages is useful maybe the `sway_log()` macro itself should also log the value of `__func__` so the function name gets logged for every log message.
edmonds left a comment
Copy link

Confirmed that it fixes the crash.

Confirmed that it fixes the crash.
raboof force-pushed avoid_unsplit_crash from fb67f593a5
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
to c3d4bf23a5
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2023年07月17日 09:08:35 +02:00
Compare
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
raboof/volare!69
Reference in a new issue
raboof/volare
No description provided.
Delete branch "avoid_unsplit_crash"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?