opt: opt func name

This commit is contained in:
DreamMaoMao 2025-05-14 11:33:37 +08:00
parent 335a8fa2b1
commit 47cf6a1a84
2 changed files with 9 additions and 9 deletions

View file

@ -363,7 +363,7 @@ static inline void client_set_suspended(Client *c, int suspended) {
wlr_xdg_toplevel_set_suspended(c->surface.xdg->toplevel, suspended); wlr_xdg_toplevel_set_suspended(c->surface.xdg->toplevel, suspended);
} }
static inline int client_surface_wants_focus(Client *c) { static inline int client_should_ignore_focus(Client *c) {
#ifdef XWAYLAND #ifdef XWAYLAND
if (client_is_x11(c)) { if (client_is_x11(c)) {
@ -384,12 +384,12 @@ static inline int client_surface_wants_focus(Client *c) {
for (size_t i = 0; i < sizeof(no_focus_types) / sizeof(no_focus_types[0]); for (size_t i = 0; i < sizeof(no_focus_types) / sizeof(no_focus_types[0]);
++i) { ++i) {
if (wlr_xwayland_surface_has_window_type(surface, no_focus_types[i])) { if (wlr_xwayland_surface_has_window_type(surface, no_focus_types[i])) {
return 0; return 1;
} }
} }
} }
#endif #endif
return 1; return 0;
} }
static inline int client_wants_focus(Client *c) { static inline int client_wants_focus(Client *c) {

View file

@ -1763,7 +1763,7 @@ applyrulesgeom(Client *c) {
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 || if (r->offsetx || r->offsety ||
(!client_is_x11(c) || client_surface_wants_focus(c))) (!client_is_x11(c) || !client_should_ignore_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
@ -1827,7 +1827,7 @@ applyrules(Client *c) {
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 || if (r->offsetx || r->offsety ||
(!client_is_x11(c) || client_surface_wants_focus(c))) (!client_is_x11(c) || !client_should_ignore_focus(c)))
c->geom = c->geom =
setclient_coordinate_center(c->geom, r->offsetx, r->offsety); setclient_coordinate_center(c->geom, r->offsetx, r->offsety);
} }
@ -3733,7 +3733,7 @@ void focusclient(Client *c, int lift) {
if (c && c->animation.tagouting && !c->animation.tagouting) if (c && c->animation.tagouting && !c->animation.tagouting)
return; return;
if (c && !client_surface_wants_focus(c)) { if (c && client_should_ignore_focus(c)) {
return; return;
} }
@ -3877,7 +3877,7 @@ Client * // 0.5
focustop(Monitor *m) { focustop(Monitor *m) {
Client *c; Client *c;
wl_list_for_each(c, &fstack, flink) { wl_list_for_each(c, &fstack, flink) {
if (c->iskilling || !client_surface_wants_focus(c)) if (c->iskilling || client_should_ignore_focus(c))
continue; continue;
if (VISIBLEON(c, m)) if (VISIBLEON(c, m))
return c; return c;
@ -4310,7 +4310,7 @@ mapnotify(struct wl_listener *listener, void *data) {
client_get_geometry(c, &c->geom); client_get_geometry(c, &c->geom);
if (client_is_unmanaged(c) || !client_surface_wants_focus(c)) { if (client_is_unmanaged(c) || client_should_ignore_focus(c)) {
c->bw = 0; c->bw = 0;
c->isnoborder = 1; c->isnoborder = 1;
} else { } else {
@ -5337,7 +5337,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) || client_surface_wants_focus(c)) if (!client_is_x11(c) || !client_should_ignore_focus(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);