opt: Respect the position prompt of the x11 pop-up window

This commit is contained in:
DreamMaoMao 2025-05-13 09:20:24 +08:00
parent aec027f7fa
commit 73750ecea6

View file

@ -1747,6 +1747,7 @@ 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(r->offsetx || r->offsety || (client_is_x11(c) && client_surface_wants_focus(c)))
c->geom = setclient_coordinate_center(c->geom, r->offsetx, r->offsety); c->geom = setclient_coordinate_center(c->geom, r->offsetx, r->offsety);
hit = r->height > 0 || r->width > 0 || r->offsetx != 0 || r->offsety != 0 hit = r->height > 0 || r->width > 0 || r->offsetx != 0 || r->offsety != 0
? 1 ? 1
@ -1809,6 +1810,7 @@ applyrules(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(r->offsetx || r->offsety || (client_is_x11(c) && client_surface_wants_focus(c)))
c->geom = setclient_coordinate_center(c->geom, r->offsetx, r->offsety); c->geom = setclient_coordinate_center(c->geom, r->offsetx, r->offsety);
} }
} }
@ -5297,6 +5299,7 @@ setfloating(Client *c, int floating) {
target_box.width = target_box.width * 0.8; target_box.width = target_box.width * 0.8;
} }
// 重新计算居中的坐标 // 重新计算居中的坐标
if(!client_is_x11(c))
target_box = setclient_coordinate_center(target_box, 0, 0); target_box = setclient_coordinate_center(target_box, 0, 0);
backup_box = c->geom; backup_box = c->geom;
hit = applyrulesgeom(c); hit = applyrulesgeom(c);