File euclid-wm.c changed (mode: 100644) (index 214b72d..3241333) |
... |
... |
struct win * add_win(Window id) { |
916 |
916 |
return p; |
return p; |
917 |
917 |
} |
} |
918 |
918 |
|
|
919 |
|
void forget_win (Window id) { |
|
920 |
|
//first see whether we have a record of it |
|
921 |
|
if (first_win == NULL) { |
|
922 |
|
fprintf(stderr,"euclid-wm: cannot remove window %6.0lx, internal data structure is corrpupt or there are not windows being managed (no first_win defined)\n",id); |
|
923 |
|
return; |
|
924 |
|
}; |
|
925 |
|
struct win * w = first_win; |
|
926 |
|
struct win * w2 = first_win; |
|
927 |
|
if (w->id != id) { |
|
928 |
|
while (w->next != NULL && w->next->id != id) { |
|
929 |
|
w = w->next; |
|
930 |
|
}; |
|
931 |
|
w2 = w; //this should be the win struct before the one we are deleting |
|
932 |
|
w = w->next; |
|
933 |
|
}; |
|
934 |
|
|
|
935 |
|
if (w == NULL) { |
|
936 |
|
return; |
|
937 |
|
}; |
|
938 |
|
//we have the win struct stored in w; |
|
|
919 |
|
// finds window in layout and removes it (possibly removing its parent track) |
|
920 |
|
void erase_win (struct win * w) { |
939 |
921 |
struct view *v = fv; |
struct view *v = fv; |
940 |
922 |
struct track *t; |
struct track *t; |
941 |
923 |
struct cont *c; |
struct cont *c; |
|
... |
... |
void forget_win (Window id) { |
1003 |
985 |
}; |
}; |
1004 |
986 |
free(c); |
free(c); |
1005 |
987 |
}; |
}; |
|
988 |
|
|
|
989 |
|
return; |
1006 |
990 |
}; |
}; |
1007 |
991 |
c = c->next; |
c = c->next; |
1008 |
992 |
}; |
}; |
|
... |
... |
void forget_win (Window id) { |
1010 |
994 |
}; |
}; |
1011 |
995 |
v = v->next; |
v = v->next; |
1012 |
996 |
}; |
}; |
|
997 |
|
} |
|
998 |
|
|
|
999 |
|
void forget_win (Window id) { |
|
1000 |
|
//first see whether we have a record of it |
|
1001 |
|
if (first_win == NULL) { |
|
1002 |
|
fprintf(stderr,"euclid-wm: cannot remove window %6.0lx, internal data structure is corrpupt or there are not windows being managed (no first_win defined)\n",id); |
|
1003 |
|
return; |
|
1004 |
|
}; |
|
1005 |
|
struct win * w = first_win; |
|
1006 |
|
struct win * w2 = first_win; |
|
1007 |
|
if (w->id != id) { |
|
1008 |
|
while (w->next != NULL && w->next->id != id) { |
|
1009 |
|
w = w->next; |
|
1010 |
|
}; |
|
1011 |
|
w2 = w; //this should be the win struct before the one we are deleting |
|
1012 |
|
w = w->next; |
|
1013 |
|
}; |
|
1014 |
|
|
|
1015 |
|
if (w == NULL) { |
|
1016 |
|
return; |
|
1017 |
|
}; |
|
1018 |
|
|
|
1019 |
|
erase_win(w); |
1013 |
1020 |
//we also need to check the stacks: |
//we also need to check the stacks: |
1014 |
|
v = fv; |
|
|
1021 |
|
struct view *v = fv; |
1015 |
1022 |
struct stack_item *s = NULL; |
struct stack_item *s = NULL; |
1016 |
1023 |
while (v != NULL) { |
while (v != NULL) { |
1017 |
1024 |
s = v->stack; |
s = v->stack; |