mirror of https://github.com/0intro/wmii
implemented reverting memory for toggle stuff between floating/managed area
This commit is contained in:
parent
f4db0019b2
commit
055fc504d7
|
@ -32,11 +32,17 @@ update_area_geometry(Area *a)
|
|||
void
|
||||
destroy_area(Area *a)
|
||||
{
|
||||
unsigned int i;
|
||||
Tag *t = a->tag;
|
||||
if(a->nframe)
|
||||
return;
|
||||
if(a->frame)
|
||||
free(a->frame);
|
||||
if(t->revert == area2index(a))
|
||||
t->revert = 0;
|
||||
for(i = 0; i < nclient; i++)
|
||||
if(client[i]->revert == a)
|
||||
client[i]->revert = 0;
|
||||
cext_array_detach((void **)t->area, a, &t->areasz);
|
||||
t->narea--;
|
||||
if(t->sel > 1)
|
||||
|
@ -73,9 +79,13 @@ select_area(Area *a, char *arg)
|
|||
int i = area2index(a);
|
||||
if(i == -1)
|
||||
return;
|
||||
if(i)
|
||||
t->revert = i;
|
||||
if(!strncmp(arg, "toggle", 7)) {
|
||||
if(i)
|
||||
i = 0;
|
||||
else if(t->revert < t->narea)
|
||||
i = t->revert;
|
||||
else
|
||||
i = 1;
|
||||
} else if(!strncmp(arg, "prev", 5)) {
|
||||
|
@ -105,6 +115,7 @@ select_area(Area *a, char *arg)
|
|||
void
|
||||
send2area(Area *to, Area *from, Client *c)
|
||||
{
|
||||
c->revert = from;
|
||||
detach_fromarea(from, c);
|
||||
attach_toarea(to, c);
|
||||
focus_client(c);
|
||||
|
|
|
@ -513,6 +513,8 @@ send2area_client(Client *c, char *arg)
|
|||
else if(!strncmp(arg, "toggle", 7)) {
|
||||
if(i)
|
||||
to = t->area[0];
|
||||
else if(c->revert)
|
||||
to = c->revert;
|
||||
else
|
||||
to = t->area[1];
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ struct Tag {
|
|||
unsigned int areasz;
|
||||
unsigned int narea;
|
||||
unsigned int sel;
|
||||
unsigned int revert;
|
||||
};
|
||||
|
||||
struct Area {
|
||||
|
@ -131,6 +132,7 @@ struct Client {
|
|||
unsigned int framesz;
|
||||
unsigned int sel;
|
||||
unsigned int nframe;
|
||||
Area *revert;
|
||||
};
|
||||
|
||||
typedef struct Key Key;
|
||||
|
|
Loading…
Reference in New Issue