diff options
Diffstat (limited to 'nx-X11/programs/Xserver/dix')
-rw-r--r-- | nx-X11/programs/Xserver/dix/colormap.c | 77 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dix/window.c | 12 |
2 files changed, 89 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c index 11a353f84..cd5e1dc49 100644 --- a/nx-X11/programs/Xserver/dix/colormap.c +++ b/nx-X11/programs/Xserver/dix/colormap.c @@ -2791,3 +2791,80 @@ IsMapInstalled(Colormap map, WindowPtr pWin) DEALLOCATE_LOCAL(pmaps); return (found); } + +struct colormap_lookup_data { + ScreenPtr pScreen; + VisualPtr visuals; +}; + +static void +_colormap_find_resource(void *value, XID id, void *cdata) +{ + struct colormap_lookup_data *cmap_data = cdata; + VisualPtr visuals = cmap_data->visuals; + ScreenPtr pScreen = cmap_data->pScreen; + ColormapPtr cmap = value; + int j; + + if (pScreen != cmap->pScreen) + return; + + j = cmap->pVisual - pScreen->visuals; + cmap->pVisual = &visuals[j]; +} + +/* something has realloced the visuals, instead of breaking + ABI fix it up here - glx and compsite did this wrong */ +Bool +ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth) +{ + struct colormap_lookup_data cdata; + int numVisuals; + VisualPtr visuals; + XID *vids, vid; + int first_new_vid, first_new_visual, i; + + first_new_vid = depth->numVids; + first_new_visual = pScreen->numVisuals; + +#if 0 /* !defined(NXAGENT_SERVER) */ + vids = reallocarray(depth->vids, depth->numVids + new_visual_count, + sizeof(XID)); +#else + vids = xrealloc(depth->vids, sizeof(XID) * + (depth->numVids + new_visual_count)); +#endif + if (!vids) + return FALSE; + + /* its realloced now no going back if we fail the next one */ + depth->vids = vids; + + numVisuals = pScreen->numVisuals + new_visual_count; +#if 0 /* !defined(NXAGENT_SERVER) */ + visuals = reallocarray(pScreen->visuals, numVisuals, sizeof(VisualRec)); +#else + visuals = xrealloc(pScreen->visuals, sizeof(VisualRec) * numVisuals); +#endif + if (!visuals) { + return FALSE; + } + + cdata.visuals = visuals; + cdata.pScreen = pScreen; + FindClientResourcesByType(serverClient, RT_COLORMAP, + _colormap_find_resource, &cdata); + + pScreen->visuals = visuals; + + for (i = 0; i < new_visual_count; i++) { + vid = FakeClientID(0); + pScreen->visuals[first_new_visual + i].vid = vid; + vids[first_new_vid + i] = vid; + } + + depth->numVids += new_visual_count; + pScreen->numVisuals += new_visual_count; + + return TRUE; +} diff --git a/nx-X11/programs/Xserver/dix/window.c b/nx-X11/programs/Xserver/dix/window.c index 916d7e276..c3d901fb9 100644 --- a/nx-X11/programs/Xserver/dix/window.c +++ b/nx-X11/programs/Xserver/dix/window.c @@ -535,9 +535,21 @@ ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn, RegionIntersect(Rgn, Rgn, &pWin->winSize); } +static RealChildHeadProc realChildHeadProc = NULL; + +void +RegisterRealChildHeadProc (RealChildHeadProc proc) +{ + realChildHeadProc = proc; +} + WindowPtr RealChildHead(register WindowPtr pWin) { + if (realChildHeadProc) { + return realChildHeadProc (pWin); + } + if (!pWin->parent && (screenIsSaved == SCREEN_SAVER_ON) && (HasSaverWindow (pWin->drawable.pScreen->myNum))) |