opt: optimize focus lift logic

This commit is contained in:
DreamMaoMao 2026-07-09 16:03:51 +08:00
parent 380ced0452
commit c58e96db6e
3 changed files with 5 additions and 7 deletions

View file

@ -680,7 +680,7 @@ int32_t restore_minimized(const Arg *arg) {
show_hide_client(c);
setborder_color(c);
arrange(c->mon, false, false);
focusclient(c, 0);
focusclient(c, 1);
warp_cursor(c);
return 0;
}

View file

@ -608,8 +608,6 @@ monocle(Monitor *m) {
geom.height = m->w.height - 2 * cur_gappov;
client_tile_resize(c, geom, 0);
}
if ((c = focustop(m)))
wlr_scene_node_raise_to_top(&c->scene->node);
}
// 网格布局窗口大小和位置计算

View file

@ -1439,7 +1439,7 @@ bool switch_scratchpad_client_state(Client *c) {
c->tags = get_tags_first_tag(selmon->tagset[selmon->seltags]);
resize(c, c->float_geom, 0);
arrange(selmon, false, false);
focusclient(c, true);
focusclient(c, 1);
c->scratchpad_switching_mon = false;
return true;
} else {
@ -1452,7 +1452,7 @@ bool switch_scratchpad_client_state(Client *c) {
(c->mon->tagset[c->mon->seltags] & c->tags) == 0) {
c->tags = c->mon->tagset[c->mon->seltags];
arrange(c->mon, false, false);
focusclient(c, true);
focusclient(c, 1);
return true;
} else if (c->is_in_scratchpad && c->is_scratchpad_show &&
(c->mon->tagset[c->mon->seltags] & c->tags) != 0) {
@ -3876,7 +3876,7 @@ void destroylock(SessionLock *lock, int32_t unlock) {
wlr_scene_node_set_enabled(&locked_bg->node, false);
}
focusclient(focustop(selmon), 0);
focusclient(focustop(selmon), 1);
motionnotify(0, NULL, 0, 0, 0, 0);
destroy:
@ -6869,7 +6869,7 @@ void unmapnotify(struct wl_listener *listener, void *data) {
}
if (nextfocus) {
focusclient(nextfocus, 0);
focusclient(nextfocus, 1);
}
if (!nextfocus && selmon->isoverview) {