call setfullscreen() in setmon()

this will help when sending to another monitor a fullscreen client
and also will prevent a crash when a client request fullscreen when it has no monitor
This commit is contained in:
Leonardo Hernández Hernández 2022-09-02 18:22:15 -05:00
parent 1f59b76d77
commit 19a8a095eb
Failed to generate hash of commit

7
dwl.c
View file

@ -1438,9 +1438,6 @@ mapnotify(struct wl_listener *listener, void *data)
} }
printstatus(); printstatus();
if (c->isfullscreen)
setfullscreen(c, 1);
c->mon->un_map = 1; c->mon->un_map = 1;
} }
@ -1889,6 +1886,8 @@ void
setfullscreen(Client *c, int fullscreen) setfullscreen(Client *c, int fullscreen)
{ {
c->isfullscreen = fullscreen; c->isfullscreen = fullscreen;
if (!c->mon)
return;
c->bw = fullscreen ? 0 : borderpx; c->bw = fullscreen ? 0 : borderpx;
client_set_fullscreen(c, fullscreen); client_set_fullscreen(c, fullscreen);
@ -1968,7 +1967,7 @@ setmon(Client *c, Monitor *m, unsigned int newtags)
resize(c, c->geom, 0); resize(c, c->geom, 0);
wlr_surface_send_enter(client_surface(c), m->wlr_output); wlr_surface_send_enter(client_surface(c), m->wlr_output);
c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */ c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
arrange(m); setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
} }
focusclient(focustop(selmon), 1); focusclient(focustop(selmon), 1);
} }