mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-18 05:34:23 -04:00
opt: optimize border color set when change monitor
This commit is contained in:
parent
2258574e25
commit
44c271ee52
2 changed files with 9 additions and 5 deletions
|
|
@ -171,7 +171,7 @@ int toggle_trackpad_enable(const Arg *arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int focusmon(const Arg *arg) {
|
int focusmon(const Arg *arg) {
|
||||||
Client *c = NULL, *old_selmon_sel = NULL;
|
Client *c = NULL;
|
||||||
Monitor *m = NULL;
|
Monitor *m = NULL;
|
||||||
|
|
||||||
if (arg->i != UNDIR) {
|
if (arg->i != UNDIR) {
|
||||||
|
|
@ -192,7 +192,6 @@ int focusmon(const Arg *arg) {
|
||||||
if (!m || !m->wlr_output->enabled || m == selmon)
|
if (!m || !m->wlr_output->enabled || m == selmon)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
old_selmon_sel = selmon->sel;
|
|
||||||
selmon = m;
|
selmon = m;
|
||||||
if (warpcursor) {
|
if (warpcursor) {
|
||||||
warp_cursor_to_selmon(selmon);
|
warp_cursor_to_selmon(selmon);
|
||||||
|
|
@ -205,9 +204,6 @@ int focusmon(const Arg *arg) {
|
||||||
} else
|
} else
|
||||||
focusclient(c, 1);
|
focusclient(c, 1);
|
||||||
|
|
||||||
if (old_selmon_sel) {
|
|
||||||
client_set_unfocused_opacity_animation(old_selmon_sel);
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3166,6 +3166,7 @@ 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;
|
Client *last_focus_client = NULL;
|
||||||
|
Monitor *um = 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;
|
||||||
|
|
@ -3211,6 +3212,13 @@ 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) {
|
||||||
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue