make dialog clients be iconified/re-screened with their respective leader client

This commit is contained in:
Lucas de Sena
2026-02-04 16:12:48 +00:00
parent 0a400a366a
commit 6685043266
10 changed files with 107 additions and 50 deletions

View File

@@ -153,6 +153,9 @@ void open_fscrn(Client *c)
c->fsscr = scr = openscreen(NULL, scr->root);
c->reparenting = 1;
XReparentWindow(dpy, c->window, scr->back, 0, 0);
for (Client *dialog = clients; dialog != NULL; dialog = dialog->next)
if (dialog->leader == c)
reparent_client(c->fsscr, dialog);
XResizeWindow(dpy, c->window, scr->width, scr->height);
realizescreens();
scr = c->fsscr;
@@ -177,6 +180,9 @@ void close_fscrn(Client *c, int state)
scr = c->scr;
if (state != IconicState)
XMapWindow(dpy, c->parent);
for (Client *dialog = clients; dialog != NULL; dialog = dialog->next)
if (dialog->leader == c)
reparent_client(c->scr, dialog);
}
void setclientstate(Client *c, int state)
@@ -348,6 +354,9 @@ void rmclient(Client *c)
XDeleteContext(dpy, c->window, client_context);
if (c->sizehints)
XFree(c->sizehints);
for (Client *dialog = clients; dialog != NULL; dialog = dialog->next)
if (dialog->leader == c)
dialog->leader = NULL;
free(c);
}
@@ -432,7 +441,8 @@ reparent_client(Scrn *s, Client *client)
client->scr = s;
if(client->parent != client->scr->root)
XReparentWindow(dpy, client->parent, s->back, client->x, client->y);
setstringprop(client->window, amiwm_screen, s->deftitle);
if (s->deftitle != NULL)
setstringprop(client->window, amiwm_screen, s->deftitle);
sendconfig(client);
}