2006-03-23 12:36:51 +03:00
|
|
|
/*
|
|
|
|
* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
|
|
|
* See LICENSE file for license details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "wm.h"
|
|
|
|
|
2006-04-11 12:16:01 +04:00
|
|
|
static Vector *
|
2006-04-13 17:35:10 +04:00
|
|
|
vector_of_views(ViewVector *vv)
|
2006-04-03 00:53:56 +04:00
|
|
|
{
|
2006-04-03 15:40:34 +04:00
|
|
|
return (Vector *) vv;
|
2006-04-03 00:53:56 +04:00
|
|
|
}
|
|
|
|
|
2006-04-13 18:52:33 +04:00
|
|
|
static int
|
|
|
|
comp_view_name(const void *v1, const void *v2)
|
|
|
|
{
|
|
|
|
View *vv1 = *(View **)v1;
|
|
|
|
View *vv2 = *(View **)v2;
|
|
|
|
return strcmp(vv1->name, vv2->name);
|
|
|
|
}
|
|
|
|
|
2006-03-23 12:36:51 +03:00
|
|
|
View *
|
2006-04-12 12:44:07 +04:00
|
|
|
create_view(char *name)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
|
|
|
static unsigned short id = 1;
|
2006-03-23 17:01:32 +03:00
|
|
|
View *v = cext_emallocz(sizeof(View));
|
2006-03-23 12:36:51 +03:00
|
|
|
|
|
|
|
v->id = id++;
|
2006-04-04 14:25:36 +04:00
|
|
|
cext_strlcpy(v->name, name, sizeof(v->name));
|
2006-05-21 21:21:37 +04:00
|
|
|
create_area(v, v->area.size);
|
|
|
|
create_area(v, v->area.size);
|
2006-04-13 17:35:10 +04:00
|
|
|
cext_vattach(vector_of_views(&view), v);
|
2006-04-13 18:52:33 +04:00
|
|
|
qsort(view.data, view.size, sizeof(View *), comp_view_name);
|
2006-03-23 17:01:32 +03:00
|
|
|
return v;
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
|
2006-03-29 11:45:54 +04:00
|
|
|
void
|
2006-03-23 12:43:57 +03:00
|
|
|
destroy_view(View *v)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
2006-04-03 00:53:56 +04:00
|
|
|
while(v->area.size)
|
|
|
|
destroy_area(v->area.data[0]);
|
2006-03-23 12:36:51 +03:00
|
|
|
|
2006-04-13 17:35:10 +04:00
|
|
|
cext_vdetach(vector_of_views(&view), v);
|
2006-04-03 00:53:56 +04:00
|
|
|
if(sel >= view.size)
|
2006-03-23 12:36:51 +03:00
|
|
|
sel = 0;
|
|
|
|
|
2006-03-23 18:12:06 +03:00
|
|
|
free(v);
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2006-04-12 12:44:07 +04:00
|
|
|
idx_of_view(View *v)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
|
|
|
int i;
|
2006-04-03 00:53:56 +04:00
|
|
|
for(i = 0; i < view.size; i++)
|
|
|
|
if(v == view.data[i])
|
2006-03-23 12:36:51 +03:00
|
|
|
return i;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
update_frame_selectors(View *v)
|
|
|
|
{
|
|
|
|
unsigned int i, j;
|
|
|
|
|
|
|
|
/* select correct frames of clients */
|
2006-04-26 13:09:16 +04:00
|
|
|
for(i = 0; i < client.size; i++) {
|
|
|
|
Client *c = client.data[i];
|
|
|
|
for(j = 0; j < c->frame.size; j++)
|
|
|
|
if(c->frame.data[j]->area->view == v) {
|
|
|
|
c->sel = j;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-03-23 12:43:57 +03:00
|
|
|
focus_view(View *v)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
2006-03-29 11:45:54 +04:00
|
|
|
Client *c;
|
2006-03-23 12:36:51 +03:00
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
XGrabServer(dpy);
|
2006-04-12 12:44:07 +04:00
|
|
|
sel = idx_of_view(v);
|
2006-03-23 12:36:51 +03:00
|
|
|
|
|
|
|
update_frame_selectors(v);
|
|
|
|
|
|
|
|
/* gives all(!) clients proper geometry (for use of different tags) */
|
2006-04-03 00:53:56 +04:00
|
|
|
for(i = 0; i < client.size; i++)
|
|
|
|
if(client.data[i]->frame.size) {
|
|
|
|
Frame *f = client.data[i]->frame.data[client.data[i]->sel];
|
2006-03-23 12:36:51 +03:00
|
|
|
if(f->area->view == v) {
|
2006-04-03 00:53:56 +04:00
|
|
|
XMoveWindow(dpy, client.data[i]->framewin, f->rect.x, f->rect.y);
|
2006-04-27 13:54:25 +04:00
|
|
|
resize_client(client.data[i], &f->rect, False);
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
else
|
2006-04-03 00:53:56 +04:00
|
|
|
XMoveWindow(dpy, client.data[i]->framewin,
|
2006-04-26 13:09:16 +04:00
|
|
|
2 * rect.width + f->rect.x, f->rect.y);
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
2006-04-28 14:37:19 +04:00
|
|
|
if((c = sel_client_of_view(v)))
|
|
|
|
focus_client(c, True);
|
|
|
|
draw_clients();
|
2006-04-12 12:44:07 +04:00
|
|
|
update_view_bars();
|
2006-03-23 12:36:51 +03:00
|
|
|
XSync(dpy, False);
|
|
|
|
XUngrabServer(dpy);
|
2006-05-01 23:15:24 +04:00
|
|
|
flush_masked_events(EnterWindowMask);
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
XRectangle *
|
2006-04-12 12:44:07 +04:00
|
|
|
rects_of_view(View *v, Bool isfloat, unsigned int *num)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
2006-03-23 17:01:32 +03:00
|
|
|
XRectangle *result = nil;
|
2006-03-23 12:36:51 +03:00
|
|
|
unsigned int i;
|
2006-03-23 18:12:06 +03:00
|
|
|
|
2006-03-23 12:36:51 +03:00
|
|
|
*num = 0;
|
|
|
|
if(isfloat)
|
2006-04-14 12:06:05 +04:00
|
|
|
*num = v->area.data[0]->frame.size + 1;
|
2006-03-23 12:36:51 +03:00
|
|
|
else {
|
2006-04-03 00:53:56 +04:00
|
|
|
for(i = 1; i < v->area.size; i++)
|
2006-04-14 12:06:05 +04:00
|
|
|
*num += v->area.data[i]->frame.size + 1;
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if(*num) {
|
2006-03-23 17:01:32 +03:00
|
|
|
result = cext_emallocz(*num * sizeof(XRectangle));
|
2006-03-23 12:36:51 +03:00
|
|
|
if(isfloat) {
|
|
|
|
for(i = 0; i < *num; i++)
|
2006-04-03 00:53:56 +04:00
|
|
|
result[i] = v->area.data[0]->frame.data[0]->rect;
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
unsigned int j, n = 0;
|
2006-04-03 00:53:56 +04:00
|
|
|
for(i = 1; i < v->area.size; i++) {
|
|
|
|
for(j = 0; j < v->area.data[i]->frame.size; j++)
|
|
|
|
result[n++] = v->area.data[i]->frame.data[j]->rect;
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
}
|
2006-04-14 12:06:05 +04:00
|
|
|
result[*num - 1] = brect;
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
2006-03-23 17:01:32 +03:00
|
|
|
return result;
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2006-04-12 12:44:07 +04:00
|
|
|
idx_of_view_id(unsigned short id)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
|
|
|
int i;
|
2006-04-03 00:53:56 +04:00
|
|
|
for(i = 0; i < view.size; i++)
|
|
|
|
if(view.data[i]->id == id)
|
2006-03-23 12:36:51 +03:00
|
|
|
return i;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
View *
|
2006-04-12 12:44:07 +04:00
|
|
|
view_of_name(char *name)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
2006-03-24 15:36:35 +03:00
|
|
|
unsigned int i;
|
2006-03-23 12:36:51 +03:00
|
|
|
|
2006-04-04 14:25:36 +04:00
|
|
|
for(i = 0; i < view.size; i++)
|
2006-04-11 19:38:58 +04:00
|
|
|
if(!strncmp(view.data[i]->name, name, strlen(name))
|
|
|
|
&& !strncmp(view.data[i]->name, name, strlen(view.data[i]->name)))
|
2006-04-05 21:37:38 +04:00
|
|
|
return view.data[i];
|
2006-03-24 15:36:35 +03:00
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
2006-04-12 12:44:07 +04:00
|
|
|
static View *
|
2006-03-24 15:36:35 +03:00
|
|
|
get_view(char *name)
|
|
|
|
{
|
2006-04-12 12:44:07 +04:00
|
|
|
View *v = view_of_name(name);
|
|
|
|
return v ? v : create_view(name);
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-03-23 12:43:57 +03:00
|
|
|
select_view(char *arg)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
2006-05-23 18:56:43 +04:00
|
|
|
sel = idx_of_view(get_view(arg));
|
|
|
|
update_views(); /* performs focus_view */
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
|
2006-04-11 11:20:19 +04:00
|
|
|
static Bool
|
2006-04-12 12:44:07 +04:00
|
|
|
is_of_view(View *v, Client *c)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
|
|
|
unsigned int i;
|
2006-04-11 12:16:01 +04:00
|
|
|
for(i = 0; i < v->area.size; i++)
|
2006-04-12 12:44:07 +04:00
|
|
|
if(is_of_area(v->area.data[i], c))
|
2006-03-23 12:36:51 +03:00
|
|
|
return True;
|
|
|
|
return False;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-04-12 12:44:07 +04:00
|
|
|
detach_from_view(View *v, Client *c)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
2006-04-10 19:43:13 +04:00
|
|
|
unsigned int i;
|
|
|
|
|
2006-04-03 00:53:56 +04:00
|
|
|
for(i = 0; i < v->area.size; i++) {
|
2006-04-12 12:44:07 +04:00
|
|
|
if(is_of_area(v->area.data[i], c)) {
|
|
|
|
detach_from_area(v->area.data[i], c);
|
2006-03-23 12:36:51 +03:00
|
|
|
XMoveWindow(dpy, c->framewin, 2 * rect.width, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-04-12 12:44:07 +04:00
|
|
|
attach_to_view(View *v, Client *c)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
|
|
|
Area *a;
|
|
|
|
|
2006-04-26 18:00:47 +04:00
|
|
|
c->revert = nil;
|
|
|
|
|
2006-05-23 00:35:20 +04:00
|
|
|
if(c->trans || c->floating || c->fixedsize
|
2006-04-26 18:23:05 +04:00
|
|
|
|| (c->rect.width == rect.width && c->rect.height == rect.height))
|
2006-04-03 00:53:56 +04:00
|
|
|
a = v->area.data[0];
|
2006-03-23 12:36:51 +03:00
|
|
|
else
|
2006-04-03 00:53:56 +04:00
|
|
|
a = v->area.data[v->sel];
|
2006-04-12 12:44:07 +04:00
|
|
|
attach_to_area(a, c);
|
2006-04-13 12:06:07 +04:00
|
|
|
v->sel = idx_of_area(a);
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Client *
|
2006-03-23 12:43:57 +03:00
|
|
|
sel_client_of_view(View *v)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
|
|
|
if(v) {
|
2006-04-03 00:53:56 +04:00
|
|
|
Area *a = v->area.size ? v->area.data[v->sel] : nil;
|
2006-05-08 23:44:56 +04:00
|
|
|
return sel_client_of_area(a);
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-03-23 12:43:57 +03:00
|
|
|
restack_view(View *v)
|
2006-03-23 12:36:51 +03:00
|
|
|
{
|
2006-04-10 17:48:27 +04:00
|
|
|
unsigned int i, n = 0;
|
|
|
|
int j;
|
2006-03-23 12:36:51 +03:00
|
|
|
static Window *wins = nil;
|
2006-03-23 17:01:32 +03:00
|
|
|
static unsigned int winssz = 0;
|
2006-03-23 12:36:51 +03:00
|
|
|
|
2006-04-03 00:53:56 +04:00
|
|
|
if(client.size > winssz) {
|
|
|
|
winssz = 2 * client.size;
|
2006-04-10 17:48:27 +04:00
|
|
|
wins = realloc(wins, sizeof(Window) * winssz);
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
|
2006-04-03 00:53:56 +04:00
|
|
|
for(i = 0; i < v->area.size; i++) {
|
|
|
|
Area *a = v->area.data[i];
|
|
|
|
if(a->frame.size) {
|
|
|
|
wins[n++] = a->frame.data[a->sel]->client->framewin;
|
2006-04-10 17:48:27 +04:00
|
|
|
for(j = a->frame.size - 1; j >= 0; j--) {
|
2006-04-06 14:52:20 +04:00
|
|
|
Client *c = a->frame.data[j]->client;
|
2006-04-27 20:32:37 +04:00
|
|
|
update_client_grab(c, (v->sel == i) && (a->sel == j));
|
2006-03-23 12:36:51 +03:00
|
|
|
if(j == a->sel)
|
|
|
|
continue;
|
2006-04-06 14:52:20 +04:00
|
|
|
wins[n++] = c->framewin;
|
2006-03-23 12:36:51 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(n)
|
|
|
|
XRestackWindows(dpy, wins, n);
|
|
|
|
}
|
2006-03-27 09:17:47 +04:00
|
|
|
|
2006-04-24 19:39:58 +04:00
|
|
|
void
|
|
|
|
scale_view(View *v, float w)
|
|
|
|
{
|
2006-05-04 00:25:33 +04:00
|
|
|
unsigned int i, xoff;
|
2006-04-24 19:39:58 +04:00
|
|
|
float scale, dx = 0;
|
2006-05-04 01:11:14 +04:00
|
|
|
int wdiff = 0;
|
2006-04-24 19:39:58 +04:00
|
|
|
|
|
|
|
if(v->area.size == 1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for(i = 1; i < v->area.size; i++)
|
|
|
|
dx += v->area.data[i]->rect.width;
|
|
|
|
scale = w / dx;
|
2006-05-04 00:25:33 +04:00
|
|
|
xoff = 0;
|
2006-04-24 19:39:58 +04:00
|
|
|
for(i = 1; i < v->area.size; i++) {
|
|
|
|
Area *a = v->area.data[i];
|
|
|
|
a->rect.width *= scale;
|
2006-05-04 01:26:21 +04:00
|
|
|
if(i == v->area.size - 1)
|
|
|
|
a->rect.width = w - xoff;
|
|
|
|
xoff += a->rect.width;
|
2006-04-24 19:39:58 +04:00
|
|
|
}
|
2006-05-04 01:11:14 +04:00
|
|
|
|
|
|
|
/* MIN_COLWIDTH can only be respected when there is enough space; the caller should guarantee this */
|
|
|
|
if((v->area.size - 1) * MIN_COLWIDTH > w)
|
|
|
|
return;
|
2006-05-04 01:26:21 +04:00
|
|
|
xoff = 0;
|
2006-05-04 01:11:14 +04:00
|
|
|
for(i = 1; i < v->area.size; i++) {
|
|
|
|
Area *a = v->area.data[i];
|
|
|
|
if(a->rect.width < MIN_COLWIDTH)
|
|
|
|
a->rect.width = MIN_COLWIDTH;
|
|
|
|
else if((wdiff = xoff + a->rect.width - w + (v->area.size - 1 - i) * MIN_COLWIDTH) > 0)
|
|
|
|
a->rect.width -= wdiff;
|
|
|
|
if(i == v->area.size - 1)
|
|
|
|
a->rect.width = w - xoff;
|
|
|
|
xoff += a->rect.width;
|
|
|
|
}
|
2006-04-24 19:39:58 +04:00
|
|
|
}
|
|
|
|
|
2006-03-27 09:17:47 +04:00
|
|
|
void
|
2006-04-24 19:19:50 +04:00
|
|
|
arrange_view(View *v)
|
2006-03-27 09:17:47 +04:00
|
|
|
{
|
2006-04-07 18:50:08 +04:00
|
|
|
unsigned int i, xoff = 0;
|
2006-03-27 09:17:47 +04:00
|
|
|
|
2006-04-03 00:53:56 +04:00
|
|
|
if(v->area.size == 1)
|
2006-03-27 09:17:47 +04:00
|
|
|
return;
|
|
|
|
|
2006-04-24 19:39:58 +04:00
|
|
|
scale_view(v, rect.width);
|
2006-04-03 00:53:56 +04:00
|
|
|
for(i = 1; i < v->area.size; i++) {
|
|
|
|
Area *a = v->area.data[i];
|
2006-04-24 19:19:50 +04:00
|
|
|
a->rect.x = xoff;
|
|
|
|
a->rect.y = 0;
|
|
|
|
a->rect.height = rect.height - brect.height;
|
|
|
|
xoff += a->rect.width;
|
2006-04-06 19:03:12 +04:00
|
|
|
arrange_column(a, False);
|
2006-03-27 09:17:47 +04:00
|
|
|
}
|
|
|
|
}
|
2006-04-10 19:50:39 +04:00
|
|
|
|
2006-04-11 12:16:01 +04:00
|
|
|
static void
|
|
|
|
update_client_views(Client *c)
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
char *toks[16];
|
|
|
|
unsigned int i, n;
|
|
|
|
|
|
|
|
cext_strlcpy(buf, c->tags, sizeof(buf));
|
|
|
|
n = cext_tokenize(toks, 16, buf, '+');
|
|
|
|
|
|
|
|
while(c->view.size)
|
2006-04-13 17:35:10 +04:00
|
|
|
cext_vdetach(vector_of_views(&c->view), c->view.data[0]);
|
2006-04-11 12:16:01 +04:00
|
|
|
|
2006-04-27 16:06:37 +04:00
|
|
|
for(i = 0; i < n; i++)
|
2006-04-13 17:35:10 +04:00
|
|
|
cext_vattach(vector_of_views(&c->view), get_view(toks[i]));
|
2006-04-11 12:16:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2006-04-12 12:44:07 +04:00
|
|
|
is_view_of(Client *c, View *v)
|
2006-04-11 12:16:01 +04:00
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
for(i = 0; i < c->view.size; i++)
|
|
|
|
if(c->view.data[i] == v)
|
|
|
|
return True;
|
|
|
|
return False;
|
|
|
|
}
|
|
|
|
|
2006-05-23 18:56:43 +04:00
|
|
|
static Bool
|
|
|
|
is_empty(View *v)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
for(i = 0; i < v->area.size; i++)
|
|
|
|
if(v->area.data[i]->frame.size)
|
|
|
|
return False;
|
|
|
|
return True;
|
|
|
|
}
|
|
|
|
|
2006-04-11 12:16:01 +04:00
|
|
|
static View *
|
2006-05-23 18:56:43 +04:00
|
|
|
next_empty_view(View *ignore)
|
2006-04-10 19:50:39 +04:00
|
|
|
{
|
|
|
|
unsigned int i;
|
2006-04-11 12:16:01 +04:00
|
|
|
for(i = 0; i < view.size; i++)
|
2006-05-23 18:56:43 +04:00
|
|
|
if((view.data[i] != ignore) && is_empty(view.data[i]))
|
2006-04-11 12:16:01 +04:00
|
|
|
return view.data[i];
|
|
|
|
return nil;
|
|
|
|
}
|
2006-04-10 19:50:39 +04:00
|
|
|
|
2006-04-11 12:16:01 +04:00
|
|
|
void
|
|
|
|
update_views()
|
|
|
|
{
|
|
|
|
unsigned int i, j;
|
2006-05-23 18:56:43 +04:00
|
|
|
View *v, *ign = nil, *old = view.size ? view.data[sel] : nil;
|
2006-04-10 19:50:39 +04:00
|
|
|
|
2006-04-11 12:16:01 +04:00
|
|
|
for(i = 0; i < client.size; i++)
|
|
|
|
update_client_views(client.data[i]);
|
2006-04-10 19:50:39 +04:00
|
|
|
|
2006-04-11 12:16:01 +04:00
|
|
|
for(i = 0; i < client.size; i++) {
|
|
|
|
Client *c = client.data[i];
|
|
|
|
for(j = 0; j < view.size; j++) {
|
2006-04-27 13:54:25 +04:00
|
|
|
View *vw = view.data[j];
|
|
|
|
update_frame_selectors(vw);
|
2006-04-27 16:06:37 +04:00
|
|
|
if(is_view_of(c, vw)) {
|
2006-04-27 13:54:25 +04:00
|
|
|
if(!is_of_view(vw, c))
|
|
|
|
attach_to_view(vw, c);
|
2006-04-11 11:20:19 +04:00
|
|
|
}
|
2006-04-11 12:16:01 +04:00
|
|
|
else {
|
2006-04-27 13:54:25 +04:00
|
|
|
if(is_of_view(vw, c))
|
|
|
|
detach_from_view(vw, c);
|
2006-04-10 19:50:39 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-05-23 18:56:43 +04:00
|
|
|
ign = old;
|
|
|
|
if(old && !strncmp(old->name, "nil", 4))
|
|
|
|
ign = nil;
|
|
|
|
while((v = next_empty_view(ign)))
|
2006-04-11 12:16:01 +04:00
|
|
|
destroy_view(v);
|
2006-04-10 19:50:39 +04:00
|
|
|
|
2006-04-19 18:24:19 +04:00
|
|
|
if(old)
|
|
|
|
focus_view(old);
|
|
|
|
else if(view.size)
|
2006-04-14 11:34:03 +04:00
|
|
|
focus_view(view.data[sel]);
|
2006-04-13 19:41:58 +04:00
|
|
|
else
|
|
|
|
update_view_bars();
|
2006-04-10 19:50:39 +04:00
|
|
|
}
|