diff options
Diffstat (limited to 'Xbit.c')
-rw-r--r-- | Xbit.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -333,6 +333,12 @@ void SetCurrentWin(Window w) } +int GetVisualDepth(void) +{ + return vinfo.depth; +} + + Window OpenWin (int argc, char **argv, char *title, @@ -583,7 +589,7 @@ Pixmap GetBitmap(const char *fn, int *w, int *h, int *hx, int *hy) return(0); } - ret=XCreatePixmap(display,current->w,*w,*h,DefaultDepth(display,0)); + ret=XCreatePixmap(display,current->w,*w,*h,vinfo.depth); XCopyPlane(display,bm,ret,current->gc,0,0,*w,*h,0,0,1L); @@ -638,8 +644,7 @@ void Resize(int w,int h) for(f=0;f<current->multino;f++) { XFreePixmap(display,current->pm[f]); - current->pm[f]=XCreatePixmap(display,current->w,w,h, - DefaultDepth(display,0)); + current->pm[f]=XCreatePixmap(display,current->w,w,h,vinfo.depth); XFillRectangle(display,current->pm[f], current->gc,0,0,current->pw,current->ph); } @@ -657,12 +662,10 @@ void Resize(int w,int h) current->pmi=0; - current->pm[0]=XCreatePixmap(display,current->w,w,h, - DefaultDepth(display,0)); + current->pm[0]=XCreatePixmap(display,current->w,w,h,vinfo.depth); if (current->buffer) - current->pm[1]=XCreatePixmap(display,current->w,w,h, - DefaultDepth(display,0)); + current->pm[1]=XCreatePixmap(display,current->w,w,h,vinfo.depth); } @@ -778,7 +781,7 @@ void EnableBuffers(int no, ulong clscol) for(f=0;f<current->multino;f++) { current->pm[f]=XCreatePixmap(display,current->w,current->ww,current->wh, - DefaultDepth(display,0)); + vinfo.depth); XFillRectangle(display,current->pm[f], current->gc,0,0,current->pw,current->ph); } |