mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-05 04:06:28 -05:00
opt: avoid unnecessary focus animations
This commit is contained in:
parent
44c271ee52
commit
11b425faad
1 changed files with 6 additions and 1 deletions
|
|
@ -402,6 +402,7 @@ struct Client {
|
|||
int force_tearing;
|
||||
int allow_shortcuts_inhibit;
|
||||
float scroller_proportion_single;
|
||||
bool isfocusing;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -3206,15 +3207,18 @@ void focusclient(Client *c, int lift) {
|
|||
selmon = c->mon;
|
||||
selmon->prevsel = selmon->sel;
|
||||
selmon->sel = c;
|
||||
c->isfocusing = true;
|
||||
|
||||
if (last_focus_client && !last_focus_client->iskilling &&
|
||||
last_focus_client != c) {
|
||||
last_focus_client->isfocusing = false;
|
||||
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->iskilling && um->sel->isfocusing) {
|
||||
um->sel->isfocusing = false;
|
||||
client_set_unfocused_opacity_animation(um->sel);
|
||||
}
|
||||
}
|
||||
|
|
@ -3663,6 +3667,7 @@ static void iter_xdg_scene_buffers(struct wlr_scene_buffer *buffer, int sx,
|
|||
}
|
||||
|
||||
void init_client_properties(Client *c) {
|
||||
c->isfocusing = false;
|
||||
c->ismaximizescreen = 0;
|
||||
c->isfullscreen = 0;
|
||||
c->need_float_size_reduce = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue