feat: add dispatch spawn_on_empty

This commit is contained in:
DreamMaoMao 2025-03-20 17:03:54 +08:00
parent 98f942568a
commit ab4c8d5679
4 changed files with 32 additions and 1 deletions

View file

@ -5287,6 +5287,25 @@ void spawn(const Arg *arg) {
}
}
void spawn_on_empty(const Arg *arg) {
bool is_empty = true;
Client *c;
wl_list_for_each(c, &clients, link) {
if (arg->ui & c->tags) {
is_empty = false;
break;
}
}
if(!is_empty) {
view(arg,true);
return;
} else {
view(arg,true);
spawn(arg);
}
}
void startdrag(struct wl_listener *listener, void *data) {
struct wlr_drag *drag = data;
if (!drag->icon)