--- /dev/null
+--- doomlegacy-1.40/doomlegacy_src/linux_x/i_video_xshm.c.orig Fri Mar 7 22:22:56 2003
++++ doomlegacy-1.40/doomlegacy_src/linux_x/i_video_xshm.c Fri Mar 7 22:51:25 2003
+@@ -1619,14 +1619,14 @@
+ if(rendermode==render_soft) {
+ // setup attributes for main window
+ if (vidmode_active) {
+- attribmask = CWColormap | CWSaveUnder | CWBackingStore |
++ attribmask = CWSaveUnder | CWBackingStore |
+ CWEventMask | CWOverrideRedirect;
+
+ attribs.override_redirect = True;
+ attribs.backing_store = NotUseful;
+ attribs.save_under = False;
+ } else
+- attribmask = CWBorderPixel | CWColormap | CWEventMask;
++ attribmask = CWBorderPixel | CWEventMask;
+
+ attribs.event_mask = KeyPressMask | KeyReleaseMask
+ #ifndef POLL_POINTER
+@@ -1634,7 +1634,10 @@
+ #endif
+ | ExposureMask | StructureNotifyMask;
+
++ if( x_pseudo ) {
++ attribmask |= CWColormap;
+ attribs.colormap = X_cmap;
++ }
+ attribs.border_pixel = 0;
+
+ // create the main window
--- /dev/null
+--- doomlegacy-1.40/doomlegacy_src/linux_x/i_video_xshm.c~ Fri Mar 14 03:11:35 2003
++++ doomlegacy-1.40/doomlegacy_src/linux_x/i_video_xshm.c Fri Mar 14 03:11:35 2003
+@@ -182,7 +182,9 @@
+ // resolution threshold for hires mode
+ #define HIRES_HORIZ (640)
+ #define HIRES_VERT (400)
+-
++
++#define MAX_NUM_VIDMODES (100)
++
+ static boolean haveVoodoo = false;
+
+ extern consvar_t cv_fullscreen; // for fullscreen support under X and GLX
+@@ -197,8 +199,8 @@
+ static int lowest_vidmode;
+
+ static XF86VidModeModeInfo **vidmodes;
+-static char vidModeName[33][32]; // allow 33 different modes
+-static int vidmap[33];
++static char vidModeName[MAX_NUM_VIDMODES][32]; // allow MAX_NUM_VIDMODES different modes
++static int vidmap[MAX_NUM_VIDMODES];
+
+ // added for 1.27 19990220 by Kin
+ rendermode_t rendermode=render_soft;
+@@ -283,7 +285,8 @@
+ if(vidmode_ext) {
+ // get fullscreen modes
+ XF86VidModeGetAllModeLines(X_display, X_screen, &num_fullvidmodes, &vidmodes);
+- num_vidmodes = num_fullvidmodes;
++ num_vidmodes = (num_fullvidmodes > MAX_NUM_VIDMODES)
++ ? MAX_NUM_VIDMODES : num_fullvidmodes;
+
+ // initialize mapping
+ for(i=0; i<num_vidmodes; i++)
+@@ -1824,7 +1827,8 @@
+ if(haveVoodoo) // nothing to do
+ return;
+ if(vidmode_ext && cv_fullscreen.value) {
+- num_vidmodes = num_fullvidmodes;
++ num_vidmodes = (num_fullvidmodes > MAX_NUM_VIDMODES)
++ ? MAX_NUM_VIDMODES : num_fullvidmodes;
+
+ // initialize mapping
+ for(i=0; i<num_vidmodes; i++)