From 3a8ebf549b3f9385b3de8dccee5cf3f7972286d8 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sat, 3 May 2025 14:47:22 +0800 Subject: [PATCH] change: dispatch name change movewin->smartmovewin resizewin->smartresizewin --- config.conf | 20 ++++++++++---------- src/config/parse_config.h | 8 ++++---- src/dispatch/dispatch.h | 4 ++-- src/maomao.c | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/config.conf b/config.conf index 30f9fec..76a72de 100644 --- a/config.conf +++ b/config.conf @@ -285,17 +285,17 @@ bind=ALT+SHIFT,X,incgaps,1 bind=ALT+SHIFT,Z,incgaps,-1 bind=ALT+SHIFT,R,togglegaps -# movewin -bind=SUPER+SHIFT,Up,movewin,up -bind=SUPER+SHIFT,Down,movewin,down -bind=SUPER+SHIFT,Left,movewin,left -bind=SUPER+SHIFT,Right,movewin,right +# smartmovewin +bind=SUPER+SHIFT,Up,smartmovewin,up +bind=SUPER+SHIFT,Down,smartmovewin,down +bind=SUPER+SHIFT,Left,smartmovewin,left +bind=SUPER+SHIFT,Right,smartmovewin,right -# resizewin -bind=SUPER+ALT,Up,resizewin,up -bind=SUPER+ALT,Down,resizewin,down -bind=SUPER+ALT,Left,resizewin,left -bind=SUPER+ALT,Right,resizewin,right +# smartresizewin +bind=SUPER+ALT,Up,smartresizewin,up +bind=SUPER+ALT,Down,smartresizewin,down +bind=SUPER+ALT,Left,smartresizewin,left +bind=SUPER+ALT,Right,smartresizewin,right #custom app bind example # spawn_on_empty (if tag 4 is empty , open app in this,otherwise view to tag 4) diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 84ec0ce..382e208 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -520,11 +520,11 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value, char *arg_v } else if (strcmp(func_name, "toggleview") == 0) { func = toggleview; (*arg).ui = 1 << (atoi(arg_value) - 1); - } else if (strcmp(func_name, "movewin") == 0) { - func = movewin; + } else if (strcmp(func_name, "smartmovewin") == 0) { + func = smartmovewin; (*arg).i = parse_direction(arg_value); - } else if (strcmp(func_name, "resizewin") == 0) { - func = resizewin; + } else if (strcmp(func_name, "smartresizewin") == 0) { + func = smartresizewin; (*arg).i = parse_direction(arg_value); } else { return NULL; diff --git a/src/dispatch/dispatch.h b/src/dispatch/dispatch.h index 48469f5..191301e 100644 --- a/src/dispatch/dispatch.h +++ b/src/dispatch/dispatch.h @@ -36,8 +36,8 @@ void focusmon(const Arg *arg); void focusstack(const Arg *arg); void chvt(const Arg *arg); void reload_config(const Arg *arg); -void movewin(const Arg *arg); -void resizewin(const Arg *arg); +void smartmovewin(const Arg *arg); +void smartresizewin(const Arg *arg); void bind_to_view(const Arg *arg); void toggletag(const Arg *arg); void toggleview(const Arg *arg); diff --git a/src/maomao.c b/src/maomao.c index f532517..15a6f7b 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -136,7 +136,7 @@ enum { NetLast }; /* EWMH atoms */ #endif -enum { UP, DOWN, LEFT, RIGHT, UNDIR }; /* movewin */ +enum { UP, DOWN, LEFT, RIGHT, UNDIR }; /* smartmovewin */ enum { NONE, OPEN, MOVE, CLOSE, TAG }; struct vec2 { @@ -7174,7 +7174,7 @@ void zoom(const Arg *arg) { arrange(selmon, false); } -void movewin(const Arg *arg) { +void smartmovewin(const Arg *arg) { Client *c, *tc; int nx, ny; int buttom, top, left, right, tar; @@ -7272,7 +7272,7 @@ void movewin(const Arg *arg) { resize(c, c->oldgeom, 1); } -void resizewin(const Arg *arg) { +void smartresizewin(const Arg *arg) { Client *c, *tc; int nw, nh; int buttom, top, left, right, tar;