summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2020-04-26 14:11:44 -0500
committerDevin J. Pohly <djpohly@gmail.com>2020-04-26 14:11:44 -0500
commitcd6683e6a1a9afdbb397433658ba85925dbf437c (patch)
tree5622a621c008178a6abe8f718882998ce16fb708
parent88f0ea343bbb103fed819c4d3febec4d7044a246 (diff)
fix refocus on sendmon
-rw-r--r--dwl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dwl.c b/dwl.c
index 9105347..13d07f8 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1057,6 +1057,7 @@ sendmon(Client *c, Monitor *m)
{
if (c->mon == m)
return;
+ int hadfocus = (c == selclient());
c->mon = m;
/* Make sure window actually overlaps with the monitor */
applybounds(c, &c->mon->m);
@@ -1064,7 +1065,7 @@ sendmon(Client *c, Monitor *m)
wlr_surface_send_enter(c->xdg_surface->surface, c->mon->wlr_output);
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
- if (c == selclient())
+ if (hadfocus)
refocus();
}