File euclid-wm.c changed (mode: 100644) (index b2a4989..bda8e0e) |
... |
... |
struct view * make_view() { |
675 |
675 |
return ptr; |
return ptr; |
676 |
676 |
} |
} |
677 |
677 |
|
|
|
678 |
|
struct view * find_view(int i); |
|
679 |
|
|
678 |
680 |
void addscreen(short h, short w, short x, short y, short n) { |
void addscreen(short h, short w, short x, short y, short n) { |
679 |
681 |
|
|
680 |
682 |
struct screen *new = (struct screen * ) malloc (sizeof(struct screen)); |
struct screen *new = (struct screen * ) malloc (sizeof(struct screen)); |
|
... |
... |
void addscreen(short h, short w, short x, short y, short n) { |
686 |
688 |
//set it as first screen |
//set it as first screen |
687 |
689 |
firstscreen = new; |
firstscreen = new; |
688 |
690 |
cs = new; |
cs = new; |
|
691 |
|
new->v = make_view(); |
|
692 |
|
new->v->idx = 1; |
689 |
693 |
} else { |
} else { |
690 |
694 |
struct screen *s = firstscreen; |
struct screen *s = firstscreen; |
691 |
695 |
while (s->next != NULL) { |
while (s->next != NULL) { |
692 |
696 |
s = s->next; |
s = s->next; |
693 |
697 |
}; |
}; |
694 |
698 |
s->next = new; |
s->next = new; |
|
699 |
|
new->v = find_view(n + 1); |
695 |
700 |
} |
} |
696 |
701 |
//define its geomentry |
//define its geomentry |
697 |
702 |
new->h = h; |
new->h = h; |
698 |
703 |
new->w = w; |
new->w = w; |
699 |
704 |
new->x = x; |
new->x = x; |
700 |
705 |
new->y = y; |
new->y = y; |
701 |
|
//make it a view |
|
702 |
|
new->v = make_view(); |
|
703 |
|
//set view idx |
|
704 |
|
new->v->idx = n; |
|
705 |
706 |
//make it a stack window |
//make it a stack window |
706 |
707 |
new->stackid = XCreateSimpleWindow(dpy,root,0,((h - 15) + y),(w + x),15,1,stack_unfocus_pix,stack_background_pix); |
new->stackid = XCreateSimpleWindow(dpy,root,0,((h - 15) + y),(w + x),15,1,stack_unfocus_pix,stack_background_pix); |
707 |
708 |
XSetWindowAttributes att; |
XSetWindowAttributes att; |
|
... |
... |
void addscreen(short h, short w, short x, short y, short n) { |
709 |
710 |
XChangeWindowAttributes(dpy,cs->stackid,CWOverrideRedirect,&att); |
XChangeWindowAttributes(dpy,cs->stackid,CWOverrideRedirect,&att); |
710 |
711 |
XMapWindow(dpy,new->stackid); |
XMapWindow(dpy,new->stackid); |
711 |
712 |
XSync(dpy,False); |
XSync(dpy,False); |
712 |
|
}; |
|
|
713 |
|
} |
713 |
714 |
|
|
714 |
715 |
void remove_cont(struct cont *c) { |
void remove_cont(struct cont *c) { |
715 |
716 |
//reset focus if necessary |
//reset focus if necessary |