mirror of
https://github.com/vale981/spectrwm
synced 2025-03-05 09:51:38 -05:00
Prevent acessing pointer that has been freed.
Still one weird focus bug leftover where when the last window in a ws gets destroyed and if there is a window on the alternate screen it gets focus.
This commit is contained in:
parent
ae6a9b20ce
commit
134554a043
1 changed files with 4 additions and 5 deletions
|
@ -1106,7 +1106,6 @@ cycle_layout(struct swm_region *r, union arg *args)
|
|||
if (ws->cur_layout->l_stack == NULL)
|
||||
ws->cur_layout = &layouts[0];
|
||||
ignore_enter = 1;
|
||||
|
||||
stack();
|
||||
}
|
||||
|
||||
|
@ -1930,16 +1929,16 @@ destroynotify(XEvent *e)
|
|||
ws->focus = TAILQ_PREV(win, ws_win_list, entry);
|
||||
if (ws->focus == NULL)
|
||||
ws->focus = TAILQ_FIRST(&ws->winlist);
|
||||
if (ws->focus == win)
|
||||
if (ws->focus == NULL || ws->focus == win) {
|
||||
ws->focus = NULL;
|
||||
if (cur_focus == win)
|
||||
unfocus_all();
|
||||
} else
|
||||
focus_win(ws->focus);
|
||||
|
||||
TAILQ_REMOVE(&ws->winlist, win, entry);
|
||||
set_win_state(win, WithdrawnState);
|
||||
free(win);
|
||||
stack();
|
||||
}
|
||||
stack();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Reference in a new issue