opt: optimize xwayland focus ignore judge
This commit is contained in:
11
src/mango.c
11
src/mango.c
@@ -1305,7 +1305,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);
|
||||
}
|
||||
|
||||
@@ -3080,9 +3080,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)
|
||||
@@ -3598,7 +3597,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 {
|
||||
@@ -4399,7 +4398,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);
|
||||
@@ -4708,7 +4707,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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user