diff --git a/src/maomao.c b/src/maomao.c index 6c2f969..40d166e 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -1893,7 +1893,7 @@ applyrules(Client *c) { int fullscreen_state_backup = c->isfullscreen; setmon(c, mon, newtags, !c->isopensilent); - if (!c->isopensilent && !(c->tags & (1 << (selmon->pertag->curtag - 1)))) { + if (!c->isopensilent && selmon && !(c->tags & (1 << (selmon->pertag->curtag - 1)))) { c->animation.from_rule = true; view(&(Arg){.ui = c->tags}, true); } @@ -4447,12 +4447,12 @@ mapnotify(struct wl_listener *listener, void *data) { c->drag_to_tile = false; c->fake_no_border = false; - if (new_is_master && + if (new_is_master && selmon && strcmp(selmon->pertag->ltidxs[selmon->pertag->curtag]->name, "scroller") != 0) // tile at the top wl_list_insert(&clients, &c->link); // 新窗口是master,头部入栈 - else if (strcmp(selmon->pertag->ltidxs[selmon->pertag->curtag]->name, + else if (selmon && strcmp(selmon->pertag->ltidxs[selmon->pertag->curtag]->name, "scroller") == 0 && center_select(selmon)) { Client *at_client = center_select(selmon);