Limit resize frame blocking to visible clients

78eecfbb2735736cd4ade13ab3672fd0fd21a300
Alexis Sellier committed ago 1 parent a30c2cbf
swm.c +7 -1
1118 1118
        s, &client_surface(c)->current_outputs, link
1119 1119
    ) if (s->output == m->wlr_output) return true;
1120 1120
    return false;
1121 1121
}
1122 1122
1123 +
/* Wait for a resize only while the same client scene remains visible. */
1124 +
static inline bool resize_blocks_frame(bool visible, bool rendered) {
1125 +
    return visible && rendered;
1126 +
}
1127 +
1123 1128
/* Return whether the client process is stopped. */
1124 1129
static inline bool client_is_stopped(client_t *c) {
1125 1130
    int       pid;
1126 1131
    siginfo_t in = {};
1127 1132
5165 5170
    struct timespec         now;
5166 5171
5167 5172
    /* Render if no XDG clients have an outstanding resize and are visible on
5168 5173
     * this monitor. */
5169 5174
    wl_list_for_each(c, &clients, link) {
5170 -
        if (c->resize && !c->is_floating && client_is_rendered_on_mon(c, m) &&
5175 +
        if (c->resize && !c->is_floating &&
5176 +
            resize_blocks_frame(VISIBLEON(c, m), client_is_rendered_on_mon(c, m)) &&
5171 5177
            !client_is_stopped(c))
5172 5178
            goto skip;
5173 5179
    }
5174 5180
    wlr_scene_output_commit(m->scene_output, nullptr);
5175 5181
test/unit.c +3 -0
720 720
    assert(serial_at_least(10, 10));
721 721
    assert(serial_at_least(11, 10));
722 722
    assert(!serial_at_least(9, 10));
723 723
    assert(serial_at_least(1, UINT32_MAX));
724 724
    assert(!serial_at_least(UINT32_MAX, 1));
725 +
    assert(resize_blocks_frame(true, true));
726 +
    assert(!resize_blocks_frame(false, true));
727 +
    assert(!resize_blocks_frame(true, false));
725 728
    assert(pointer_event_time(0) != 0);
726 729
    assert(pointer_selected_monitor(&monitor, 10, 10) == &monitor);
727 730
    seat = &fake_seat;
728 731
    assert(shortcuts_inhibited() == 0);
729 732
    assert(focus_close(nullptr) == nullptr);