mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-21 05:34:05 -04:00
opt: optimize focus change when change monitor
This commit is contained in:
parent
01b03dae88
commit
c0be8fd176
2 changed files with 10 additions and 8 deletions
|
|
@ -202,6 +202,7 @@ int focusmon(const Arg *arg) {
|
||||||
selmon->sel = NULL;
|
selmon->sel = NULL;
|
||||||
wlr_seat_pointer_notify_clear_focus(seat);
|
wlr_seat_pointer_notify_clear_focus(seat);
|
||||||
wlr_seat_keyboard_notify_clear_focus(seat);
|
wlr_seat_keyboard_notify_clear_focus(seat);
|
||||||
|
focusclient(NULL, 0);
|
||||||
} else
|
} else
|
||||||
focusclient(c, 1);
|
focusclient(c, 1);
|
||||||
|
|
||||||
|
|
|
||||||
17
src/mango.c
17
src/mango.c
|
|
@ -3166,14 +3166,6 @@ void focusclient(Client *c, int lift) {
|
||||||
client_set_unfocused_opacity_animation(last_focus_client);
|
client_set_unfocused_opacity_animation(last_focus_client);
|
||||||
}
|
}
|
||||||
|
|
||||||
wl_list_for_each(um, &mons, link) {
|
|
||||||
if (um->wlr_output->enabled && um != selmon && um->sel &&
|
|
||||||
!um->sel->iskilling && um->sel->isfocusing) {
|
|
||||||
um->sel->isfocusing = false;
|
|
||||||
client_set_unfocused_opacity_animation(um->sel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
client_set_focused_opacity_animation(c);
|
client_set_focused_opacity_animation(c);
|
||||||
|
|
||||||
// decide whether need to re-arrange
|
// decide whether need to re-arrange
|
||||||
|
|
@ -3193,6 +3185,15 @@ void focusclient(Client *c, int lift) {
|
||||||
c->isurgent = 0;
|
c->isurgent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update other monitor focus disappear
|
||||||
|
wl_list_for_each(um, &mons, link) {
|
||||||
|
if (um->wlr_output->enabled && um != selmon && um->sel &&
|
||||||
|
!um->sel->iskilling && um->sel->isfocusing) {
|
||||||
|
um->sel->isfocusing = false;
|
||||||
|
client_set_unfocused_opacity_animation(um->sel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (c && !c->iskilling && c->foreign_toplevel)
|
if (c && !c->iskilling && c->foreign_toplevel)
|
||||||
wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel, true);
|
wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel, true);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue