opt: optimize xwayland focus ignore judge

This commit is contained in:
DreamMaoMao 2025-11-06 19:45:16 +08:00
parent a90027e16b
commit 38bc6b2ffc
5 changed files with 34 additions and 17 deletions

View file

@ -1314,7 +1314,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(c))) {
(!client_is_x11(c) || !client_should_ignore_focus_open(c))) {
c->float_geom = c->geom = setclient_coordinate_center(c, c->geom, 0, 0);
}
@ -3025,9 +3025,8 @@ void focusclient(Client *c, int lift) {
if (c && !client_surface(c)->mapped)
return;
if (c && client_should_ignore_focus(c)) {
if (c && client_should_ignore_focus_always(c))
return;
}
/* Raise client in stacking order if requested */
if (c && lift)
@ -3516,7 +3515,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(c)) {
if (client_is_unmanaged(c) || client_should_ignore_focus_open(c)) {
c->bw = 0;
c->isnoborder = 1;
} else {
@ -4337,7 +4336,7 @@ setfloating(Client *c, int floating) {
}
// 重新计算居中的坐标
if (!client_is_x11(c) || !client_should_ignore_focus(c))
if (!client_is_x11(c) || !client_should_ignore_focus_open(c))
target_box = setclient_coordinate_center(c, target_box, 0, 0);
backup_box = c->geom;
hit = applyrulesgeom(c);
@ -4646,7 +4645,7 @@ void setmon(Client *c, Monitor *m, unsigned int newtags, bool focus) {
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
}
if (focus) {
if (focus && !client_should_ignore_focus_open(c)) {
focusclient(focustop(selmon), 1);
}