mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-04 13:29:56 -05:00
feat: add isnosizehit option to windowrule
This commit is contained in:
parent
c8513da37e
commit
b65700ea6f
3 changed files with 13 additions and 4 deletions
|
|
@ -795,7 +795,8 @@ void resize(Client *c, struct wlr_box geo, int interact) {
|
||||||
bbox); // 去掉这个推荐的窗口大小,因为有时推荐的窗口特别大导致平铺异常
|
bbox); // 去掉这个推荐的窗口大小,因为有时推荐的窗口特别大导致平铺异常
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!c->ismaxmizescreen && !c->isfullscreen && c->isfloating) {
|
if (!c->isnosizehint && !c->ismaxmizescreen && !c->isfullscreen &&
|
||||||
|
c->isfloating) {
|
||||||
client_set_size_bound(c);
|
client_set_size_bound(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ typedef struct {
|
||||||
int isunglobal;
|
int isunglobal;
|
||||||
int isglobal;
|
int isglobal;
|
||||||
int isoverlay;
|
int isoverlay;
|
||||||
|
int isnosizehint;
|
||||||
const char *monitor;
|
const char *monitor;
|
||||||
int offsetx;
|
int offsetx;
|
||||||
int offsety;
|
int offsety;
|
||||||
|
|
@ -1352,6 +1353,7 @@ void parse_config_line(Config *config, const char *line) {
|
||||||
rule->isunglobal = -1;
|
rule->isunglobal = -1;
|
||||||
rule->isglobal = -1;
|
rule->isglobal = -1;
|
||||||
rule->isoverlay = -1;
|
rule->isoverlay = -1;
|
||||||
|
rule->isnosizehint = -1;
|
||||||
rule->isterm = -1;
|
rule->isterm = -1;
|
||||||
rule->noswallow = -1;
|
rule->noswallow = -1;
|
||||||
rule->monitor = NULL;
|
rule->monitor = NULL;
|
||||||
|
|
@ -1433,6 +1435,8 @@ void parse_config_line(Config *config, const char *line) {
|
||||||
rule->focused_opacity = atof(val);
|
rule->focused_opacity = atof(val);
|
||||||
} else if (strcmp(key, "isoverlay") == 0) {
|
} else if (strcmp(key, "isoverlay") == 0) {
|
||||||
rule->isoverlay = atoi(val);
|
rule->isoverlay = atoi(val);
|
||||||
|
} else if (strcmp(key, "isnosizehint") == 0) {
|
||||||
|
rule->isnosizehint = atoi(val);
|
||||||
} else if (strcmp(key, "isterm") == 0) {
|
} else if (strcmp(key, "isterm") == 0) {
|
||||||
rule->isterm = atoi(val);
|
rule->isterm = atoi(val);
|
||||||
} else if (strcmp(key, "noswallow") == 0) {
|
} else if (strcmp(key, "noswallow") == 0) {
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,7 @@ struct Client {
|
||||||
unsigned int configure_serial;
|
unsigned int configure_serial;
|
||||||
struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel;
|
struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel;
|
||||||
int isfloating, isurgent, isfullscreen, isfakefullscreen,
|
int isfloating, isurgent, isfullscreen, isfakefullscreen,
|
||||||
need_float_size_reduce, isminied, isoverlay;
|
need_float_size_reduce, isminied, isoverlay, isnosizehint;
|
||||||
int ismaxmizescreen;
|
int ismaxmizescreen;
|
||||||
int overview_backup_bw;
|
int overview_backup_bw;
|
||||||
int fullscreen_backup_x, fullscreen_backup_y, fullscreen_backup_w,
|
int fullscreen_backup_x, fullscreen_backup_y, fullscreen_backup_w,
|
||||||
|
|
@ -1052,6 +1052,7 @@ static void apply_rule_properties(Client *c, const ConfigWinRule *r) {
|
||||||
APPLY_INT_PROP(c, r, isnamedscratchpad);
|
APPLY_INT_PROP(c, r, isnamedscratchpad);
|
||||||
APPLY_INT_PROP(c, r, isglobal);
|
APPLY_INT_PROP(c, r, isglobal);
|
||||||
APPLY_INT_PROP(c, r, isoverlay);
|
APPLY_INT_PROP(c, r, isoverlay);
|
||||||
|
APPLY_INT_PROP(c, r, isnosizehint);
|
||||||
APPLY_INT_PROP(c, r, isunglobal);
|
APPLY_INT_PROP(c, r, isunglobal);
|
||||||
APPLY_INT_PROP(c, r, scratchpad_width);
|
APPLY_INT_PROP(c, r, scratchpad_width);
|
||||||
APPLY_INT_PROP(c, r, scratchpad_height);
|
APPLY_INT_PROP(c, r, scratchpad_height);
|
||||||
|
|
@ -1086,6 +1087,8 @@ int applyrulesgeom(Client *c) {
|
||||||
|
|
||||||
c->geom.width = r->width > 0 ? r->width : c->geom.width;
|
c->geom.width = r->width > 0 ? r->width : c->geom.width;
|
||||||
c->geom.height = r->height > 0 ? r->height : c->geom.height;
|
c->geom.height = r->height > 0 ? r->height : c->geom.height;
|
||||||
|
|
||||||
|
if (!c->isnosizehint)
|
||||||
client_set_size_bound(c);
|
client_set_size_bound(c);
|
||||||
|
|
||||||
// 重新计算居中的坐标
|
// 重新计算居中的坐标
|
||||||
|
|
@ -1145,6 +1148,7 @@ void applyrules(Client *c) {
|
||||||
if (r->height > 0)
|
if (r->height > 0)
|
||||||
c->geom.height = r->height;
|
c->geom.height = r->height;
|
||||||
|
|
||||||
|
if (!c->isnosizehint)
|
||||||
client_set_size_bound(c);
|
client_set_size_bound(c);
|
||||||
|
|
||||||
if (r->offsetx || r->offsety || r->width > 0 || r->height > 0) {
|
if (r->offsetx || r->offsety || r->width > 0 || r->height > 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue