mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-02 07:15:55 -04:00
opt: remove smfact
This commit is contained in:
parent
a8834a78a6
commit
1afb1d6240
6 changed files with 8 additions and 37 deletions
|
|
@ -227,9 +227,7 @@ bind=ALT+SHIFT,R,togglegaps
|
||||||
# change master fact for tile,spiral,deck,dwindle
|
# change master fact for tile,spiral,deck,dwindle
|
||||||
bind=ALT+SUPER,h,setmfact,-0.05
|
bind=ALT+SUPER,h,setmfact,-0.05
|
||||||
bind=ALT+SUPER,l,setmfact,+0.05
|
bind=ALT+SUPER,l,setmfact,+0.05
|
||||||
# change sub master fact for dwindle,spiral
|
|
||||||
bind=ALT+SUPER,k,setsmfact,-0.05
|
|
||||||
bind=ALT+SUPER,j,setsmfact,+0.05
|
|
||||||
# change scroller proportion
|
# change scroller proportion
|
||||||
bind=ctrl+super,j,increase_proportion,0.1
|
bind=ctrl+super,j,increase_proportion,0.1
|
||||||
bind=ctrl+super,k,increase_proportion,-0.1
|
bind=ctrl+super,k,increase_proportion,-0.1
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,6 @@ typedef struct {
|
||||||
|
|
||||||
unsigned int new_is_master;
|
unsigned int new_is_master;
|
||||||
float default_mfact;
|
float default_mfact;
|
||||||
float default_smfact;
|
|
||||||
unsigned int default_nmaster;
|
unsigned int default_nmaster;
|
||||||
int center_master_overspread;
|
int center_master_overspread;
|
||||||
int center_when_single_slave;
|
int center_when_single_slave;
|
||||||
|
|
@ -727,9 +726,6 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
|
||||||
} else if (strcmp(func_name, "setmfact") == 0) {
|
} else if (strcmp(func_name, "setmfact") == 0) {
|
||||||
func = setmfact;
|
func = setmfact;
|
||||||
(*arg).f = atof(arg_value);
|
(*arg).f = atof(arg_value);
|
||||||
} else if (strcmp(func_name, "setsmfact") == 0) {
|
|
||||||
func = setsmfact;
|
|
||||||
(*arg).f = atof(arg_value);
|
|
||||||
} else if (strcmp(func_name, "zoom") == 0) {
|
} else if (strcmp(func_name, "zoom") == 0) {
|
||||||
func = zoom;
|
func = zoom;
|
||||||
} else if (strcmp(func_name, "exchange_client") == 0) {
|
} else if (strcmp(func_name, "exchange_client") == 0) {
|
||||||
|
|
@ -1262,8 +1258,6 @@ void parse_option(Config *config, char *key, char *value) {
|
||||||
config->new_is_master = atoi(value);
|
config->new_is_master = atoi(value);
|
||||||
} else if (strcmp(key, "default_mfact") == 0) {
|
} else if (strcmp(key, "default_mfact") == 0) {
|
||||||
config->default_mfact = atof(value);
|
config->default_mfact = atof(value);
|
||||||
} else if (strcmp(key, "default_smfact") == 0) {
|
|
||||||
config->default_smfact = atof(value);
|
|
||||||
} else if (strcmp(key, "default_nmaster") == 0) {
|
} else if (strcmp(key, "default_nmaster") == 0) {
|
||||||
config->default_nmaster = atoi(value);
|
config->default_nmaster = atoi(value);
|
||||||
} else if (strcmp(key, "center_master_overspread") == 0) {
|
} else if (strcmp(key, "center_master_overspread") == 0) {
|
||||||
|
|
@ -2478,7 +2472,6 @@ void override_config(void) {
|
||||||
|
|
||||||
// 主从布局设置
|
// 主从布局设置
|
||||||
default_mfact = CLAMP_FLOAT(config.default_mfact, 0.1f, 0.9f);
|
default_mfact = CLAMP_FLOAT(config.default_mfact, 0.1f, 0.9f);
|
||||||
default_smfact = CLAMP_FLOAT(config.default_smfact, 0.1f, 0.9f);
|
|
||||||
default_nmaster = CLAMP_INT(config.default_nmaster, 1, 1000);
|
default_nmaster = CLAMP_INT(config.default_nmaster, 1, 1000);
|
||||||
center_master_overspread = CLAMP_INT(config.center_master_overspread, 0, 1);
|
center_master_overspread = CLAMP_INT(config.center_master_overspread, 0, 1);
|
||||||
center_when_single_slave = CLAMP_INT(config.center_when_single_slave, 0, 1);
|
center_when_single_slave = CLAMP_INT(config.center_when_single_slave, 0, 1);
|
||||||
|
|
@ -2624,10 +2617,9 @@ void set_value_default() {
|
||||||
config.axis_bind_apply_timeout =
|
config.axis_bind_apply_timeout =
|
||||||
axis_bind_apply_timeout; // 滚轮绑定动作的触发的时间间隔
|
axis_bind_apply_timeout; // 滚轮绑定动作的触发的时间间隔
|
||||||
config.focus_on_activate =
|
config.focus_on_activate =
|
||||||
focus_on_activate; // 收到窗口激活请求是否自动跳转聚焦
|
focus_on_activate; // 收到窗口激活请求是否自动跳转聚焦
|
||||||
config.new_is_master = new_is_master; // 新窗口是否插在头部
|
config.new_is_master = new_is_master; // 新窗口是否插在头部
|
||||||
config.default_mfact = default_mfact; // master 窗口比例
|
config.default_mfact = default_mfact; // master 窗口比例
|
||||||
config.default_smfact = default_smfact; // 第一个stack比例
|
|
||||||
config.default_nmaster = default_nmaster; // 默认master数量
|
config.default_nmaster = default_nmaster; // 默认master数量
|
||||||
config.center_master_overspread =
|
config.center_master_overspread =
|
||||||
center_master_overspread; // 中心master时是否铺满
|
center_master_overspread; // 中心master时是否铺满
|
||||||
|
|
@ -2983,7 +2975,6 @@ void reapply_master(void) {
|
||||||
}
|
}
|
||||||
m->pertag->nmasters[i] = default_nmaster;
|
m->pertag->nmasters[i] = default_nmaster;
|
||||||
m->pertag->mfacts[i] = default_mfact;
|
m->pertag->mfacts[i] = default_mfact;
|
||||||
m->pertag->smfacts[i] = default_smfact;
|
|
||||||
m->gappih = gappih;
|
m->gappih = gappih;
|
||||||
m->gappiv = gappiv;
|
m->gappiv = gappiv;
|
||||||
m->gappoh = gappoh;
|
m->gappoh = gappoh;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ unsigned int axis_bind_apply_timeout = 100; // 滚轮绑定动作的触发的时
|
||||||
unsigned int focus_on_activate = 1; // 收到窗口激活请求是否自动跳转聚焦
|
unsigned int focus_on_activate = 1; // 收到窗口激活请求是否自动跳转聚焦
|
||||||
unsigned int new_is_master = 1; // 新窗口是否插在头部
|
unsigned int new_is_master = 1; // 新窗口是否插在头部
|
||||||
double default_mfact = 0.55f; // master 窗口比例
|
double default_mfact = 0.55f; // master 窗口比例
|
||||||
double default_smfact = 0.5f; // 第一个stack窗口比例
|
|
||||||
unsigned int default_nmaster = 1; // 默认master数量
|
unsigned int default_nmaster = 1; // 默认master数量
|
||||||
int center_master_overspread = 0; // 中心master时是否铺满
|
int center_master_overspread = 0; // 中心master时是否铺满
|
||||||
int center_when_single_slave = 1; // 单个slave时是否居中
|
int center_when_single_slave = 1; // 单个slave时是否居中
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ void setlayout(const Arg *arg);
|
||||||
void switch_layout(const Arg *arg);
|
void switch_layout(const Arg *arg);
|
||||||
void switch_keyboard_layout(const Arg *arg);
|
void switch_keyboard_layout(const Arg *arg);
|
||||||
void setmfact(const Arg *arg);
|
void setmfact(const Arg *arg);
|
||||||
void setsmfact(const Arg *arg);
|
|
||||||
void quit(const Arg *arg);
|
void quit(const Arg *arg);
|
||||||
void moveresize(const Arg *arg);
|
void moveresize(const Arg *arg);
|
||||||
void exchange_client(const Arg *arg);
|
void exchange_client(const Arg *arg);
|
||||||
|
|
|
||||||
|
|
@ -263,20 +263,6 @@ void increase_proportion(const Arg *arg) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setsmfact(const Arg *arg) {
|
|
||||||
float f;
|
|
||||||
|
|
||||||
if (!arg || !selmon ||
|
|
||||||
!selmon->pertag->ltidxs[selmon->pertag->curtag]->arrange)
|
|
||||||
return;
|
|
||||||
f = arg->f < 1.0 ? arg->f + selmon->pertag->smfacts[selmon->pertag->curtag]
|
|
||||||
: arg->f - 1.0;
|
|
||||||
if (f < 0.1 || f > 0.9)
|
|
||||||
return;
|
|
||||||
// selmon->mfact = f;
|
|
||||||
selmon->pertag->smfacts[selmon->pertag->curtag] = f;
|
|
||||||
arrange(selmon, false);
|
|
||||||
}
|
|
||||||
/* arg > 1.0 will set mfact absolutely */
|
/* arg > 1.0 will set mfact absolutely */
|
||||||
void // 17
|
void // 17
|
||||||
setmfact(const Arg *arg) {
|
setmfact(const Arg *arg) {
|
||||||
|
|
|
||||||
10
src/mango.c
10
src/mango.c
|
|
@ -820,11 +820,10 @@ static struct {
|
||||||
#include "config/preset.h"
|
#include "config/preset.h"
|
||||||
|
|
||||||
struct Pertag {
|
struct Pertag {
|
||||||
unsigned int curtag, prevtag; /* current and previous tag */
|
unsigned int curtag, prevtag; /* current and previous tag */
|
||||||
int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
|
int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
|
||||||
float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
|
float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
|
||||||
float smfacts[LENGTH(tags) + 1]; /* smfacts per tag */
|
bool no_hide[LENGTH(tags) + 1]; /* no_hide per tag */
|
||||||
bool no_hide[LENGTH(tags) + 1]; /* no_hide per tag */
|
|
||||||
const Layout
|
const Layout
|
||||||
*ltidxs[LENGTH(tags) + 1]; /* matrix of tags and layouts indexes */
|
*ltidxs[LENGTH(tags) + 1]; /* matrix of tags and layouts indexes */
|
||||||
};
|
};
|
||||||
|
|
@ -2635,7 +2634,6 @@ void createmon(struct wl_listener *listener, void *data) {
|
||||||
for (i = 0; i <= LENGTH(tags); i++) {
|
for (i = 0; i <= LENGTH(tags); i++) {
|
||||||
m->pertag->nmasters[i] = m->nmaster;
|
m->pertag->nmasters[i] = m->nmaster;
|
||||||
m->pertag->mfacts[i] = m->mfact;
|
m->pertag->mfacts[i] = m->mfact;
|
||||||
m->pertag->smfacts[i] = default_smfact;
|
|
||||||
m->pertag->ltidxs[i] = m->lt;
|
m->pertag->ltidxs[i] = m->lt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue