![cinap_lenrek](/assets/img/avatar_default.png)
sort the window array by w->topped before reshaping all windows. this preserves the window z-order. remove implicit focus change on reshape/move. it called wcurrent() in wtcl thread which might send a wctl message to itself, bad... also we might not want to change focus on reshape, like for the rio resize. so we set the input window explicitely in all call sites. window deletion was racy. wclosewin() destroys w->i, but it is called outside the wctl thread so it might just free the image under libframe doing some text selection. this is fixed the following: add wclunk() function, which basically just marks the window as deleted and removes the reference from the window[] and hidden[] arrays. (called on wclose() when refcount drops to zero). wclosewin() now just frees the image and is only called from the wctl thread on exit or when handing the Deleted message. get a reference to the window when doing sweeping or moving as the filesystem might just clunk it under us and we might end up sending wctl messages to a Exited window. wctl resize message has to fail if the window is not current as it might be hidden... would also be annoying.
36 lines
1 KiB
C
36 lines
1 KiB
C
void keyboardsend(char*, int);
|
|
int whide(Window*);
|
|
int wunhide(Window*);
|
|
void freescrtemps(void);
|
|
int parsewctl(char**, Rectangle, Rectangle*, int*, int*, int*, int*, char**, char*, char*);
|
|
int writewctl(Xfid*, char*);
|
|
Window *new(Image*, int, int, int, char*, char*, char**);
|
|
void riosetcursor(Cursor*, int);
|
|
int min(int, int);
|
|
int max(int, int);
|
|
Rune* strrune(Rune*, Rune);
|
|
int isalnum(Rune);
|
|
void timerstop(Timer*);
|
|
void timercancel(Timer*);
|
|
Timer* timerstart(int);
|
|
void error(char*);
|
|
void killprocs(void);
|
|
int shutdown(void*, char*);
|
|
void iconinit(void);
|
|
void *erealloc(void*, uint);
|
|
void *emalloc(uint);
|
|
char *estrdup(char*);
|
|
void button3menu(void);
|
|
void button2menu(Window*);
|
|
void cvttorunes(char*, int, Rune*, int*, int*, int*);
|
|
/* was (byte*,int) runetobyte(Rune*, int); */
|
|
char* runetobyte(Rune*, int, int*);
|
|
void putsnarf(void);
|
|
void getsnarf(void);
|
|
void timerinit(void);
|
|
int goodrect(Rectangle);
|
|
|
|
#define runemalloc(n) malloc((n)*sizeof(Rune))
|
|
#define runerealloc(a, n) realloc(a, (n)*sizeof(Rune))
|
|
#define runemove(a, b, n) memmove(a, b, (n)*sizeof(Rune))
|