alpha
This commit is contained in:
parent
9831c033fb
commit
ef81be7efe
1 changed files with 28 additions and 8 deletions
|
|
@ -134,10 +134,12 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
|
||||||
MwLL r;
|
MwLL r;
|
||||||
Window p;
|
Window p;
|
||||||
XVisualInfo* xvi;
|
XVisualInfo* xvi;
|
||||||
|
XVisualInfo visualinfo;
|
||||||
unsigned long n = 1;
|
unsigned long n = 1;
|
||||||
int i;
|
int i;
|
||||||
int px = x, py = y;
|
int px = x, py = y;
|
||||||
XSizeHints sh;
|
XSizeHints sh;
|
||||||
|
XSetWindowAttributes attr;
|
||||||
|
|
||||||
r = malloc(sizeof(*r));
|
r = malloc(sizeof(*r));
|
||||||
|
|
||||||
|
|
@ -157,7 +159,25 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
|
||||||
p = parent->x11.window;
|
p = parent->x11.window;
|
||||||
r->x11.top = 0;
|
r->x11.top = 0;
|
||||||
}
|
}
|
||||||
|
/* If we have a 32-bit capable screen, use XCreateWindow to select it with a proper colormap.*/
|
||||||
|
if(XMatchVisualInfo(r->x11.display, DefaultScreen(r->x11.display), 32, TrueColor, &visualinfo)) {
|
||||||
|
attr.colormap = XCreateColormap(r->x11.display, p, visualinfo.visual, AllocNone);
|
||||||
|
attr.event_mask = mask;
|
||||||
|
attr.background_pixmap = None;
|
||||||
|
attr.border_pixel = 0;
|
||||||
|
|
||||||
|
r->x11.window = XCreateWindow(
|
||||||
|
r->x11.display, p,
|
||||||
|
px, py, width, height,
|
||||||
|
0,
|
||||||
|
visualinfo.depth,
|
||||||
|
InputOutput,
|
||||||
|
visualinfo.visual,
|
||||||
|
CWColormap | CWEventMask | CWBackPixmap | CWBorderPixel,
|
||||||
|
&attr);
|
||||||
|
} else {
|
||||||
r->x11.window = XCreateSimpleWindow(r->x11.display, p, px, py, width, height, 0, 0, WhitePixel(r->x11.display, DefaultScreen(r->x11.display)));
|
r->x11.window = XCreateSimpleWindow(r->x11.display, p, px, py, width, height, 0, 0, WhitePixel(r->x11.display, DefaultScreen(r->x11.display)));
|
||||||
|
}
|
||||||
sh.flags = PWinGravity;
|
sh.flags = PWinGravity;
|
||||||
sh.win_gravity = StaticGravity;
|
sh.win_gravity = StaticGravity;
|
||||||
XSetWMNormalHints(r->x11.display, r->x11.window, &sh);
|
XSetWMNormalHints(r->x11.display, r->x11.window, &sh);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue