Fix scratchpad segmentation fault

This commit is contained in:
2026-07-04 03:44:32 -04:00
parent 2c62542e0b
commit 2773724d77
+4 -3
View File
@@ -114,15 +114,16 @@ void swapdirscratchpad(const Arg *arg) {
if (sel->isscratchpad) { if (sel->isscratchpad) {
/* Move FROM scratchpad to current workspace */ /* Move FROM scratchpad to current workspace */
Client *next = nullptr; Client *next = nullptr, *n;
sel->isscratchpad = 0; sel->isscratchpad = 0;
sel->isfloating = 0; sel->isfloating = 0;
sel->tags = selmon->tagset[selmon->seltags]; sel->tags = selmon->tagset[selmon->seltags];
if (selmon->scratchpad_visible) { if (selmon->scratchpad_visible) {
/* Find another scratchpad client to show */ /* Find another scratchpad client to show */
wl_list_for_each(next, &fstack, flink) { wl_list_for_each(n, &fstack, flink) {
if (next != sel && next->isscratchpad && next->mon == selmon) { if (n != sel && n->isscratchpad && n->mon == selmon) {
scratchpad_arrange(selmon); scratchpad_arrange(selmon);
next = n;
break; break;
} }
} }