opt: avoid unnecessary focus animations
This commit is contained in:
@@ -402,6 +402,7 @@ struct Client {
|
|||||||
int force_tearing;
|
int force_tearing;
|
||||||
int allow_shortcuts_inhibit;
|
int allow_shortcuts_inhibit;
|
||||||
float scroller_proportion_single;
|
float scroller_proportion_single;
|
||||||
|
bool isfocusing;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -3206,15 +3207,18 @@ void focusclient(Client *c, int lift) {
|
|||||||
selmon = c->mon;
|
selmon = c->mon;
|
||||||
selmon->prevsel = selmon->sel;
|
selmon->prevsel = selmon->sel;
|
||||||
selmon->sel = c;
|
selmon->sel = c;
|
||||||
|
c->isfocusing = true;
|
||||||
|
|
||||||
if (last_focus_client && !last_focus_client->iskilling &&
|
if (last_focus_client && !last_focus_client->iskilling &&
|
||||||
last_focus_client != c) {
|
last_focus_client != c) {
|
||||||
|
last_focus_client->isfocusing = false;
|
||||||
client_set_unfocused_opacity_animation(last_focus_client);
|
client_set_unfocused_opacity_animation(last_focus_client);
|
||||||
}
|
}
|
||||||
|
|
||||||
wl_list_for_each(um, &mons, link) {
|
wl_list_for_each(um, &mons, link) {
|
||||||
if (um->wlr_output->enabled && um != selmon && um->sel &&
|
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);
|
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) {
|
void init_client_properties(Client *c) {
|
||||||
|
c->isfocusing = false;
|
||||||
c->ismaximizescreen = 0;
|
c->ismaximizescreen = 0;
|
||||||
c->isfullscreen = 0;
|
c->isfullscreen = 0;
|
||||||
c->need_float_size_reduce = 0;
|
c->need_float_size_reduce = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user