mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-31 22:25:29 -04:00
opt: center pos when no pos rule hit
This commit is contained in:
parent
51b3034bb2
commit
fbc0ecfe01
1 changed files with 10 additions and 1 deletions
11
src/maomao.c
11
src/maomao.c
|
|
@ -1817,6 +1817,7 @@ applyrules(Client *c) {
|
|||
int ji;
|
||||
const ConfigWinRule *r;
|
||||
Monitor *mon = selmon, *m;
|
||||
bool hit_rule_pos = false;
|
||||
|
||||
c->isfloating = client_is_float_type(c);
|
||||
if (!(appid = client_get_appid(c)))
|
||||
|
|
@ -1872,13 +1873,21 @@ applyrules(Client *c) {
|
|||
c->geom.width = r->width > 0 ? r->width : c->geom.width;
|
||||
c->geom.height = r->height > 0 ? r->height : c->geom.height;
|
||||
// 重新计算居中的坐标
|
||||
if (r->offsetx || r->offsety)
|
||||
if (r->offsetx || r->offsety) {
|
||||
hit_rule_pos = true;
|
||||
c->oldgeom = c->geom =
|
||||
setclient_coordinate_center(c, c->geom, r->offsetx, r->offsety);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if no pos rule hit, use the default pos
|
||||
if(!hit_rule_pos && (!client_is_x11(c) || !client_should_ignore_focus(c))) {
|
||||
c->oldgeom = c->geom =
|
||||
setclient_coordinate_center(c, c->geom, 0, 0);
|
||||
}
|
||||
|
||||
if (!client_surface(c)->mapped)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue