Fixed segfault, got a single xterm window to show up.

- Can't interact with xterm
 - Default background is wrong color
 - Extremely extremely slow opening windows.
Why?
This commit is contained in:
Ori Bernstein 2006-06-15 18:34:23 -05:00 committed by Ori Bernstein
parent 2a17338c61
commit e940747528
5 changed files with 24 additions and 18 deletions

View file

@ -43,6 +43,8 @@ static ColormapPtr InstalledMaps[MAXSCREENS];
Bool xnestCreateColormap(ColormapPtr pCmap)
{
VisualPtr pVisual;
XCBVISUALID vid;
XCBSCREEN *screen;
XCBGenericError *e;
XCBRGB *colors;
int i, ncolors;
@ -56,13 +58,15 @@ Bool xnestCreateColormap(ColormapPtr pCmap)
ncolors = pVisual->ColormapEntries;
pCmap->devPriv = (pointer)xalloc(sizeof(xnestPrivColormap));
screen = XCBSetupRootsIter (XCBGetSetup (xnestConnection)).data;
xnestColormapPriv(pCmap)->colormap = XCBCOLORMAPNew(xnestConnection);
vid = screen->root_visual;//pCmap->pScreen->rootVisual.id;
XCBCreateColormap(xnestConnection,
(pVisual->class & DynamicClass) ? AllocAll : AllocNone,
xnestColormapPriv(pCmap)->colormap,
xnestDefaultWindows[pCmap->pScreen->myNum],
xnestVisual(pVisual)->visual_id);
vid);
switch (pVisual->class) {

View file

@ -257,7 +257,7 @@ void xnestCollectEvents()
while ((e = XCBPollForEvent(xnestConnection, NULL)) != NULL) {
if (!e->response_type) {
err = (XCBGenericError *)e;
ErrorF("File: %s Error: %d\n", __FILE__, err->error_code);
ErrorF("File: %s Error: %d, Sequence %d\n", __FILE__, err->error_code, err->sequence);
switch(err->error_code){
case XCBMatch:
re = (XCBRequestError *)err;

View file

@ -389,10 +389,11 @@ Bool xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
XCBCWEventMask,
&xnestEventMask);
} else {
vid.id = pScreen->rootVisual;
//vid.id = pScreen->rootVisual;
vid = screen->root_visual;
xnestDefaultWindows[pScreen->myNum] = XCBWINDOWNew(xnestConnection);
XCBAuxCreateWindow(xnestConnection,
pScreen->rootDepth,
xnestDefaultDepth,
xnestDefaultWindows[pScreen->myNum],
screen->root,
xnestX + POSITION_OFFSET,

View file

@ -38,7 +38,7 @@ XCBVISUALTYPE *xnestVisual(VisualPtr pVisual)
if (pVisual->class == xnestVisuals[i]->_class &&
pVisual->bitsPerRGBValue == xnestVisuals[i]->bits_per_rgb_value &&
pVisual->ColormapEntries == xnestVisuals[i]->colormap_entries &&
/*pVisual->nplanes == xnestVisuals[i]->depth && er. help*/
pVisual->nplanes == xnestDepths[i] &&
pVisual->redMask == xnestVisuals[i]->red_mask &&
pVisual->greenMask == xnestVisuals[i]->green_mask &&
pVisual->blueMask == xnestVisuals[i]->blue_mask)

View file

@ -107,28 +107,29 @@ Bool xnestCreateWindow(WindowPtr pWin)
vid.id = XCBCopyFromParent;
}
else { /* root windows have their own colormaps at creation time */
vid.id = wVisual(pWin);
vid.id = wVisual(pWin);
visual = xnestVisualFromID(pWin->drawable.pScreen, vid);
pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), RT_COLORMAP);
mask |= CWColormap;
param.colormap = xnestColormap(pCmap).xid;
vid = visual->visual_id;
}
}
xnestWindowPriv(pWin)->window = XCBWINDOWNew(xnestConnection);
XCBAuxCreateWindow(xnestConnection,
pWin->drawable.depth,
xnestWindowPriv(pWin)->window,
xnestWindowParent(pWin),
pWin->origin.x - wBorderWidth(pWin),
pWin->origin.y - wBorderWidth(pWin),
pWin->drawable.width,
pWin->drawable.height,
pWin->borderWidth,
pWin->drawable.class,
vid,
mask,
&param);
pWin->drawable.depth,
xnestWindowPriv(pWin)->window,
xnestWindowParent(pWin),
pWin->origin.x - wBorderWidth(pWin),
pWin->origin.y - wBorderWidth(pWin),
pWin->drawable.width,
pWin->drawable.height,
pWin->borderWidth,
pWin->drawable.class,
vid,
mask,
&param);
xnestWindowPriv(pWin)->parent = xnestWindowParent(pWin);
xnestWindowPriv(pWin)->x = pWin->origin.x - wBorderWidth(pWin);
xnestWindowPriv(pWin)->y = pWin->origin.y - wBorderWidth(pWin);