mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-24 06:59:54 -05:00
feat: add dispatch spawn_on_empty
This commit is contained in:
parent
98f942568a
commit
ab4c8d5679
4 changed files with 32 additions and 1 deletions
19
maomao.c
19
maomao.c
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue