mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-02 06:46:29 -04:00
Merge 98c2c9ce45 into b9c6a2c196
This commit is contained in:
commit
9e20252364
4 changed files with 15 additions and 2 deletions
|
|
@ -88,7 +88,7 @@ bindr=Super,Super_L,spawn,rofi -show run
|
|||
|
||||
| Command | Param | Description |
|
||||
| :--- | :--- | :--- |
|
||||
| `killclient` | - | Close the focused window. |
|
||||
| `killclient` | `force` | Close the focused window. If `force` is specified, sends `SIGKILL`. |
|
||||
| `togglefloating` | - | Toggle floating state. |
|
||||
| `toggle_all_floating` | - | Toggle all visible clients floating state. |
|
||||
| `togglefullscreen` | - | Toggle fullscreen. |
|
||||
|
|
|
|||
|
|
@ -983,6 +983,7 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
|
|||
(*arg).i = atoi(arg_value);
|
||||
} else if (strcmp(func_name, "killclient") == 0) {
|
||||
func = killclient;
|
||||
(*arg).v = strdup(arg_value);
|
||||
} else if (strcmp(func_name, "centerwin") == 0) {
|
||||
func = centerwin;
|
||||
} else if (strcmp(func_name, "focuslast") == 0) {
|
||||
|
|
|
|||
|
|
@ -356,7 +356,11 @@ int32_t killclient(const Arg *arg) {
|
|||
return 0;
|
||||
c = selmon->sel;
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -751,6 +751,7 @@ static bool check_hit_no_border(Client *c);
|
|||
static void reset_keyboard_layout(void);
|
||||
static void client_update_oldmonname_record(Client *c, Monitor *m);
|
||||
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 void set_layer_open_animaiton(LayerSurface *l, struct wlr_box geo);
|
||||
static void init_fadeout_layers(LayerSurface *l);
|
||||
|
|
@ -3977,6 +3978,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) {
|
||||
if (!c || c->iskilling)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue