mirror of
https://github.com/vale981/bspwm
synced 2025-03-06 02:01:42 -05:00
Update the window border when pseudo-focusing
This commit is contained in:
parent
14b3fd235e
commit
56d17d8572
3 changed files with 15 additions and 7 deletions
18
tree.c
18
tree.c
|
@ -261,11 +261,16 @@ void insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f)
|
|||
put_status();
|
||||
}
|
||||
|
||||
void pseudo_focus(desktop_t *d, node_t *n)
|
||||
void pseudo_focus(monitor_t *m, desktop_t *d, node_t *n)
|
||||
{
|
||||
d->focus = n;
|
||||
if (n != NULL)
|
||||
if (n != NULL) {
|
||||
stack(n, STACK_ABOVE);
|
||||
if (d->focus != n) {
|
||||
window_draw_border(d->focus, false, m == mon);
|
||||
window_draw_border(n, true, m == mon);
|
||||
}
|
||||
}
|
||||
d->focus = n;
|
||||
}
|
||||
|
||||
void focus_node(monitor_t *m, desktop_t *d, node_t *n)
|
||||
|
@ -308,12 +313,15 @@ void focus_node(monitor_t *m, desktop_t *d, node_t *n)
|
|||
}
|
||||
|
||||
focus_desktop(m, d);
|
||||
pseudo_focus(d, n);
|
||||
|
||||
d->focus = n;
|
||||
|
||||
if (n == NULL) {
|
||||
history_add(m, d, NULL);
|
||||
ewmh_update_active_window();
|
||||
return;
|
||||
} else {
|
||||
stack(n, STACK_ABOVE);
|
||||
}
|
||||
|
||||
PRINTF("focus node %X\n", n->client->window);
|
||||
|
@ -1010,7 +1018,7 @@ bool transfer_node(monitor_t *ms, desktop_t *ds, node_t *ns, monitor_t *md, desk
|
|||
if (focused)
|
||||
focus_node(md, dd, ns);
|
||||
else if (active)
|
||||
pseudo_focus(dd, ns);
|
||||
pseudo_focus(md, dd, ns);
|
||||
} else {
|
||||
if (focused)
|
||||
update_current();
|
||||
|
|
2
tree.h
2
tree.h
|
@ -28,7 +28,7 @@
|
|||
void arrange(monitor_t *m, desktop_t *d);
|
||||
void apply_layout(monitor_t *m, desktop_t *d, node_t *n, xcb_rectangle_t rect, xcb_rectangle_t root_rect);
|
||||
void insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f);
|
||||
void pseudo_focus(desktop_t *d, node_t *n);
|
||||
void pseudo_focus(monitor_t *m, desktop_t *d, node_t *n);
|
||||
void focus_node(monitor_t *m, desktop_t *d, node_t *n);
|
||||
void update_current(void);
|
||||
node_t *make_node(void);
|
||||
|
|
2
window.c
2
window.c
|
@ -136,7 +136,7 @@ void manage_window(xcb_window_t win, rule_consequence_t *csq, int fd)
|
|||
if (give_focus)
|
||||
focus_node(m, d, n);
|
||||
else if (csq->focus)
|
||||
pseudo_focus(d, n);
|
||||
pseudo_focus(m, d, n);
|
||||
else
|
||||
stack(n, STACK_ABOVE);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue