[comp.windows.x] xgif mods for xstdcmap servers

alan@APPLE.COM (Alan Mimms) (04/10/90)

Below are the (trivial) modifications to the xgif.c file in the xgif
that I've changed to work with servers that have the standard colormaps
installed (either by xstdcmap or by other means).  This also assures that
other clients' mucking with the colormap won't hose xgif's display...

*** xgif.c      Tue Mar 20 19:32:46 1990
--- xgif.c.orig Tue Mar 20 19:21:44 1990
***************
*** 92,103 ****
          }

      theScreen = DefaultScreen(theDisp);
      rootW     = RootWindow(theDisp,theScreen);
      theGC     = DefaultGC(theDisp,theScreen);
      fcol      = WhitePixel(theDisp,theScreen);
      bcol      = BlackPixel(theDisp,theScreen);
      theVisual = DefaultVisual(theDisp,theScreen);
-     theCmap   = XCreateColormap (theDisp, rootW, theVisual, AllocNone);

      dispcells = DisplayCells(theDisp, theScreen);
      if (dispcells<=2)
--- 92,103 ----
          }

      theScreen = DefaultScreen(theDisp);
+     theCmap   = DefaultColormap(theDisp, theScreen);
      rootW     = RootWindow(theDisp,theScreen);
      theGC     = DefaultGC(theDisp,theScreen);
      fcol      = WhitePixel(theDisp,theScreen);
      bcol      = BlackPixel(theDisp,theScreen);
      theVisual = DefaultVisual(theDisp,theScreen);

      dispcells = DisplayCells(theDisp, theScreen);
      if (dispcells<=2)
***************
*** 124,130 ****

      CreateMainWindow(cmd,geom,argc,argv);
      Resize(eWIDE,eHIGH);
-     XSetWindowColormap (theDisp, mainW, theCmap);

      XSelectInput(theDisp, mainW, ExposureMask | KeyPressMask
                                 | StructureNotifyMask);
--- 124,129 ----