XEmacs 21.2-b2
[chise/xemacs-chise.git.1] / lwlib / xlwmenu.c
index 87f7543..12dca51 100644 (file)
@@ -444,6 +444,7 @@ string_width_u (XlwMenuWidget mw,
   newstring = XmStringLtoRCreate (newchars, XmFONTLIST_DEFAULT_TAG);
   XmStringExtent (mw->menu.font_list, newstring, &width, &height);
   XmStringFree (newstring);
+  XtFree (chars);
   return width;
 #else
 # ifdef USE_XFONTSET
@@ -891,6 +892,9 @@ char *chars;
       }
   }
   x += string_draw_range (mw, window, x, y, gc, chars, s, i);
+#ifdef NEED_MOTIF
+  XtFree (chars);
+#endif
 }
 
 static void
@@ -2803,13 +2807,31 @@ make_shadow_gcs (XlwMenuWidget mw)
   xgcv.fill_style = FillOpaqueStippled;
   xgcv.foreground = mw->menu.top_shadow_color;
   xgcv.background = mw->core.background_pixel;
+/*  xgcv.stipple = mw->menu.top_shadow_pixmap; gtb */
+#ifdef NEED_MOTIF
+  if (mw->menu.top_shadow_pixmap &&
+      mw->menu.top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)
+     xgcv.stipple = mw->menu.top_shadow_pixmap;
+  else
+     xgcv.stipple = 0;
+#else
   xgcv.stipple = mw->menu.top_shadow_pixmap;
+#endif /* NEED_MOTIF */
   pm = (xgcv.stipple ? GCStipple|GCFillStyle : 0);
   mw->menu.shadow_top_gc =
     XtGetGC((Widget)mw, GCForeground|GCBackground|pm, &xgcv);
 
   xgcv.foreground = mw->menu.bottom_shadow_color;
+/*  xgcv.stipple = mw->menu.bottom_shadow_pixmap; gtb */
+#ifdef NEED_MOTIF
+  if (mw->menu.top_shadow_pixmap &&
+      mw->menu.top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)
+     xgcv.stipple = mw->menu.bottom_shadow_pixmap;
+  else
+     xgcv.stipple = 0;
+#else
   xgcv.stipple = mw->menu.bottom_shadow_pixmap;
+#endif /* NEED_MOTIF */
   pm = (xgcv.stipple ? GCStipple|GCFillStyle : 0);
   mw->menu.shadow_bottom_gc =
     XtGetGC ((Widget)mw, GCForeground|GCBackground|pm, &xgcv);