layout.c
changeset 830 5a4fd8fec414
parent 829 f1ec35606dbc
child 831 8b84189854dc
equal deleted inserted replaced
829:f1ec35606dbc 830:5a4fd8fec414
    29 	for(i = 0, c = clients; c; c = c->next)
    29 	for(i = 0, c = clients; c; c = c->next)
    30 		if(isvisible(c)) {
    30 		if(isvisible(c)) {
    31 			if(c->isbanned)
    31 			if(c->isbanned)
    32 				XMoveWindow(dpy, c->win, c->x, c->y);
    32 				XMoveWindow(dpy, c->win, c->x, c->y);
    33 			c->isbanned = False;
    33 			c->isbanned = False;
    34 			if(c->isversatile)
    34 			if(c->isuntiled)
    35 				continue;
    35 				continue;
    36 			c->ismax = False;
    36 			c->ismax = False;
    37 			nx = wax;
    37 			nx = wax;
    38 			ny = way;
    38 			ny = way;
    39 			if(i < nmaster) {
    39 			if(i < nmaster) {
   146 	}
   146 	}
   147 }
   147 }
   148 
   148 
   149 Client *
   149 Client *
   150 nexttiled(Client *c) {
   150 nexttiled(Client *c) {
   151 	for(; c && (c->isversatile || !isvisible(c)); c = c->next);
   151 	for(; c && (c->isuntiled || !isvisible(c)); c = c->next);
   152 	return c;
   152 	return c;
   153 }
   153 }
   154 
   154 
   155 void
   155 void
   156 restack(void) {
   156 restack(void) {
   158 	XEvent ev;
   158 	XEvent ev;
   159 
   159 
   160 	drawstatus();
   160 	drawstatus();
   161 	if(!sel)
   161 	if(!sel)
   162 		return;
   162 		return;
   163 	if(sel->isversatile || lt->arrange == versatile)
   163 	if(sel->isuntiled || lt->arrange == untile)
   164 		XRaiseWindow(dpy, sel->win);
   164 		XRaiseWindow(dpy, sel->win);
   165 	if(lt->arrange != versatile) {
   165 	if(lt->arrange != untile) {
   166 		if(!sel->isversatile)
   166 		if(!sel->isuntiled)
   167 			XLowerWindow(dpy, sel->win);
   167 			XLowerWindow(dpy, sel->win);
   168 		for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
   168 		for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
   169 			if(c == sel)
   169 			if(c == sel)
   170 				continue;
   170 				continue;
   171 			XLowerWindow(dpy, c->win);
   171 			XLowerWindow(dpy, c->win);
   200 
   200 
   201 void
   201 void
   202 togglemax(const char *arg) {
   202 togglemax(const char *arg) {
   203 	XEvent ev;
   203 	XEvent ev;
   204 
   204 
   205 	if(!sel || (lt->arrange != versatile && !sel->isversatile) || sel->isfixed)
   205 	if(!sel || (lt->arrange != untile && !sel->isuntiled) || sel->isfixed)
   206 		return;
   206 		return;
   207 	if((sel->ismax = !sel->ismax)) {
   207 	if((sel->ismax = !sel->ismax)) {
   208 		sel->rx = sel->x;
   208 		sel->rx = sel->x;
   209 		sel->ry = sel->y;
   209 		sel->ry = sel->y;
   210 		sel->rw = sel->w;
   210 		sel->rw = sel->w;
   216 	drawstatus();
   216 	drawstatus();
   217 	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
   217 	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
   218 }
   218 }
   219 
   219 
   220 void
   220 void
   221 versatile(void) {
   221 untile(void) {
   222 	Client *c;
   222 	Client *c;
   223 
   223 
   224 	for(c = clients; c; c = c->next) {
   224 	for(c = clients; c; c = c->next) {
   225 		if(isvisible(c)) {
   225 		if(isvisible(c)) {
   226 			if(c->isbanned)
   226 			if(c->isbanned)
   243 void
   243 void
   244 zoom(const char *arg) {
   244 zoom(const char *arg) {
   245 	unsigned int n;
   245 	unsigned int n;
   246 	Client *c;
   246 	Client *c;
   247 
   247 
   248 	if(!sel || lt->arrange != tile || sel->isversatile)
   248 	if(!sel || lt->arrange != tile || sel->isuntiled)
   249 		return;
   249 		return;
   250 	for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
   250 	for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
   251 		n++;
   251 		n++;
   252 	if((c = sel) == nexttiled(clients))
   252 	if((c = sel) == nexttiled(clients))
   253 		if(!(c = nexttiled(c->next)))
   253 		if(!(c = nexttiled(c->next)))