mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
feat: add centerwin dispatch
This commit is contained in:
parent
1f77e58baf
commit
795a2ec9fb
3 changed files with 17 additions and 0 deletions
|
|
@ -708,6 +708,8 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
|
|||
func = tagtoright;
|
||||
} else if (strcmp(func_name, "killclient") == 0) {
|
||||
func = killclient;
|
||||
} else if (strcmp(func_name, "centerwin") == 0) {
|
||||
func = centerwin;
|
||||
} else if (strcmp(func_name, "focuslast") == 0) {
|
||||
func = focuslast;
|
||||
} else if (strcmp(func_name, "setlayout") == 0) {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ void chvt(const Arg *arg);
|
|||
void reload_config(const Arg *arg);
|
||||
void smartmovewin(const Arg *arg);
|
||||
void smartresizewin(const Arg *arg);
|
||||
void centerwin(const Arg *arg);
|
||||
void bind_to_view(const Arg *arg);
|
||||
void toggletag(const Arg *arg);
|
||||
void toggleview(const Arg *arg);
|
||||
|
|
|
|||
|
|
@ -601,6 +601,20 @@ void smartresizewin(const Arg *arg) {
|
|||
resize(c, c->oldgeom, 1);
|
||||
}
|
||||
|
||||
void centerwin(const Arg *arg) {
|
||||
Client *c;
|
||||
c = selmon->sel;
|
||||
|
||||
if (!c || c->isfullscreen)
|
||||
return;
|
||||
if (!c->isfloating)
|
||||
setfloating(c, true);
|
||||
|
||||
c->oldgeom = setclient_coordinate_center(c, c->geom, 0, 0);
|
||||
|
||||
resize(c, c->oldgeom, 1);
|
||||
}
|
||||
|
||||
void spawn(const Arg *arg) {
|
||||
|
||||
if (!arg->v)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue