mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-28 07:58:47 -04:00
fix: fix border color change when swithc mon focus
This commit is contained in:
parent
cfb66111de
commit
bd6a71f05e
4 changed files with 13 additions and 5 deletions
|
|
@ -1084,7 +1084,7 @@ void client_set_focused_opacity_animation(Client *c) {
|
||||||
c->opacity_animation.running = true;
|
c->opacity_animation.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleint_set_unfocused_opacity_animation(Client *c) {
|
void client_set_unfocused_opacity_animation(Client *c) {
|
||||||
// Start border color animation to unfocused
|
// Start border color animation to unfocused
|
||||||
float *border_color = get_border_color(c);
|
float *border_color = get_border_color(c);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ int focusmon(const Arg *arg) {
|
||||||
focusclient(c, 1);
|
focusclient(c, 1);
|
||||||
|
|
||||||
if (old_selmon_sel) {
|
if (old_selmon_sel) {
|
||||||
setborder_color(old_selmon_sel);
|
client_set_unfocused_opacity_animation(old_selmon_sel);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -374,7 +374,10 @@ Client *get_next_stack_client(Client *c, bool reverse) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float *get_border_color(Client *c) {
|
float *get_border_color(Client *c) {
|
||||||
if (c->isurgent) {
|
|
||||||
|
if (c->mon != selmon) {
|
||||||
|
return bordercolor;
|
||||||
|
} else if (c->isurgent) {
|
||||||
return urgentcolor;
|
return urgentcolor;
|
||||||
} else if (c->is_in_scratchpad && selmon && c == selmon->sel) {
|
} else if (c->is_in_scratchpad && selmon && c == selmon->sel) {
|
||||||
return scratchpadcolor;
|
return scratchpadcolor;
|
||||||
|
|
|
||||||
|
|
@ -3103,6 +3103,9 @@ void destroykeyboardgroup(struct wl_listener *listener, void *data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void focusclient(Client *c, int lift) {
|
void focusclient(Client *c, int lift) {
|
||||||
|
|
||||||
|
Client *last_focus_client = NULL;
|
||||||
|
|
||||||
struct wlr_surface *old_keyboard_focus_surface =
|
struct wlr_surface *old_keyboard_focus_surface =
|
||||||
seat->keyboard_state.focused_surface;
|
seat->keyboard_state.focused_surface;
|
||||||
|
|
||||||
|
|
@ -3137,12 +3140,14 @@ void focusclient(Client *c, int lift) {
|
||||||
|
|
||||||
if (c && !c->iskilling && !client_is_unmanaged(c) && c->mon) {
|
if (c && !c->iskilling && !client_is_unmanaged(c) && c->mon) {
|
||||||
|
|
||||||
|
last_focus_client = selmon->sel;
|
||||||
selmon = c->mon;
|
selmon = c->mon;
|
||||||
selmon->prevsel = selmon->sel;
|
selmon->prevsel = selmon->sel;
|
||||||
selmon->sel = c;
|
selmon->sel = c;
|
||||||
|
|
||||||
if (selmon->prevsel && !selmon->prevsel->iskilling) {
|
if (last_focus_client && !last_focus_client->iskilling &&
|
||||||
cleint_set_unfocused_opacity_animation(selmon->prevsel);
|
last_focus_client != c) {
|
||||||
|
client_set_unfocused_opacity_animation(last_focus_client);
|
||||||
}
|
}
|
||||||
|
|
||||||
client_set_focused_opacity_animation(c);
|
client_set_focused_opacity_animation(c);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue