Keep unmapped windows out of the window lists

51f18c5131f6c7e951d80a4830ec4aab00ac71ab
Alexis Sellier committed ago 1 parent bd14fad1
swm.c +6 -2
3052 3052
        return;
3053 3053
3054 3054
    if (c && client_is_blocked(c))
3055 3055
        c = focus_top(c->mon);
3056 3056
3057 -
    /* Raise the window when requested. */
3058 -
    if (c && lift)
3057 +
    /* Raise the window when requested. An unmapped window has no scene. */
3058 +
    if (c && lift && c->scene)
3059 3059
        wlr_scene_node_raise_to_top(&c->scene->node);
3060 3060
3061 3061
    if (c && client_surface(c) == old)
3062 3062
        return;
3063 3063
6206 6206
6207 6207
        if (wasfocused)
6208 6208
            next = focus_close(c);
6209 6209
        wl_list_remove(&c->link);
6210 6210
        wl_list_remove(&c->flink);
6211 +
        /* The window outlives this list membership, so leave both links in a
6212 +
         * state that a second removal cannot corrupt. */
6213 +
        wl_list_init(&c->link);
6214 +
        wl_list_init(&c->flink);
6211 6215
        c->mon = nullptr;
6212 6216
6213 6217
        if (hadfocus && !sloppyfocus)
6214 6218
            focus_client(next ? next : focus_top(selmon), 1);
6215 6219