movecenter: fix the crash when no window is selected
This commit is contained in:
parent
565bf30529
commit
9277e38b0a
1 changed files with 5 additions and 3 deletions
8
dwm.c
8
dwm.c
|
@ -1206,9 +1206,11 @@ movemouse(const Arg *arg)
|
|||
void
|
||||
movecenter(const Arg *arg)
|
||||
{
|
||||
selmon->sel->x = selmon->sel->mon->mx + (selmon->sel->mon->mw - WIDTH(selmon->sel)) / 2;
|
||||
selmon->sel->y = selmon->sel->mon->my + (selmon->sel->mon->mh - HEIGHT(selmon->sel)) / 2;
|
||||
arrange(selmon);
|
||||
if (selmon->sel) {
|
||||
selmon->sel->x = selmon->sel->mon->mx + (selmon->sel->mon->mw - WIDTH(selmon->sel)) / 2;
|
||||
selmon->sel->y = selmon->sel->mon->my + (selmon->sel->mon->mh - HEIGHT(selmon->sel)) / 2;
|
||||
arrange(selmon);
|
||||
}
|
||||
}
|
||||
|
||||
Client *
|
||||
|
|
Loading…
Reference in a new issue