mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-09 08:21:27 -04:00
add force kill option
This commit is contained in:
parent
d2679e63ff
commit
15f17dd62b
3 changed files with 14 additions and 1 deletions
|
|
@ -977,6 +977,7 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
|
||||||
(*arg).i = atoi(arg_value);
|
(*arg).i = atoi(arg_value);
|
||||||
} else if (strcmp(func_name, "killclient") == 0) {
|
} else if (strcmp(func_name, "killclient") == 0) {
|
||||||
func = killclient;
|
func = killclient;
|
||||||
|
(*arg).v = strdup(arg_value);
|
||||||
} else if (strcmp(func_name, "centerwin") == 0) {
|
} else if (strcmp(func_name, "centerwin") == 0) {
|
||||||
func = centerwin;
|
func = centerwin;
|
||||||
} else if (strcmp(func_name, "focuslast") == 0) {
|
} else if (strcmp(func_name, "focuslast") == 0) {
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,11 @@ int32_t killclient(const Arg *arg) {
|
||||||
return 0;
|
return 0;
|
||||||
c = selmon->sel;
|
c = selmon->sel;
|
||||||
if (c) {
|
if (c) {
|
||||||
pending_kill_client(c);
|
if (arg->v && strcmp(arg->v, "force") == 0) {
|
||||||
|
pending_force_kill_client(c);
|
||||||
|
} else {
|
||||||
|
pending_kill_client(c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -751,6 +751,7 @@ static bool check_hit_no_border(Client *c);
|
||||||
static void reset_keyboard_layout(void);
|
static void reset_keyboard_layout(void);
|
||||||
static void client_update_oldmonname_record(Client *c, Monitor *m);
|
static void client_update_oldmonname_record(Client *c, Monitor *m);
|
||||||
static void pending_kill_client(Client *c);
|
static void pending_kill_client(Client *c);
|
||||||
|
static void pending_force_kill_client(Client *c);
|
||||||
static uint32_t get_tags_first_tag_num(uint32_t source_tags);
|
static uint32_t get_tags_first_tag_num(uint32_t source_tags);
|
||||||
static void set_layer_open_animaiton(LayerSurface *l, struct wlr_box geo);
|
static void set_layer_open_animaiton(LayerSurface *l, struct wlr_box geo);
|
||||||
static void init_fadeout_layers(LayerSurface *l);
|
static void init_fadeout_layers(LayerSurface *l);
|
||||||
|
|
@ -3919,6 +3920,13 @@ void keypressmod(struct wl_listener *listener, void *data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pending_force_kill_client(Client *c) {
|
||||||
|
if (!c)
|
||||||
|
return;
|
||||||
|
kill(c->pid, SIGKILL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void pending_kill_client(Client *c) {
|
void pending_kill_client(Client *c) {
|
||||||
if (!c || c->iskilling)
|
if (!c || c->iskilling)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue