opt: optimize x11 popup focus ignore

This commit is contained in:
DreamMaoMao
2025-11-07 11:34:12 +08:00
parent 5bbe6c5c1a
commit df46194b5f
5 changed files with 21 additions and 29 deletions

View File

@@ -1304,8 +1304,7 @@ void applyrules(Client *c) {
// if no geom rule hit and is normal winodw, use the center pos and record
// the hit size
if (!hit_rule_pos &&
(!client_is_x11(c) || !client_should_ignore_focus_open(c))) {
if (!hit_rule_pos && (!client_is_x11(c) || !client_is_x11_popup(c))) {
c->float_geom = c->geom = setclient_coordinate_center(c, c->geom, 0, 0);
}
@@ -3080,7 +3079,7 @@ void focusclient(Client *c, int lift) {
if (c && !client_surface(c)->mapped)
return;
if (c && client_should_ignore_focus_always(c))
if (c && client_should_ignore_focus(c) && client_is_x11_popup(c))
return;
/* Raise client in stacking order if requested */
@@ -3597,7 +3596,7 @@ mapnotify(struct wl_listener *listener, void *data) {
init_client_properties(c);
// set special window properties
if (client_is_unmanaged(c) || client_should_ignore_focus_open(c)) {
if (client_is_unmanaged(c) || client_is_x11_popup(c)) {
c->bw = 0;
c->isnoborder = 1;
} else {
@@ -4398,7 +4397,7 @@ setfloating(Client *c, int floating) {
}
// 重新计算居中的坐标
if (!client_is_x11(c) || !client_should_ignore_focus_open(c))
if (!client_is_x11(c) || !client_is_x11_popup(c))
target_box = setclient_coordinate_center(c, target_box, 0, 0);
backup_box = c->geom;
hit = applyrulesgeom(c);
@@ -4707,7 +4706,7 @@ void setmon(Client *c, Monitor *m, unsigned int newtags, bool focus) {
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
}
if (focus && !client_should_ignore_focus_open(c)) {
if (focus && !client_is_x11_popup(c)) {
focusclient(focustop(selmon), 1);
}