Index: openmotif-2.3.1/lib/Xm/Xm.c
===================================================================
--- openmotif-2.3.1.orig/lib/Xm/Xm.c	2007-09-14 18:29:53.000000000 +0200
+++ openmotif-2.3.1/lib/Xm/Xm.c	2013-03-11 17:30:35.000000000 +0100
@@ -427,7 +427,6 @@
     return return_wid;
 }
 
-#ifdef FIX_1381
 /************************************************************************
  *
  *  _XmAssignInsensitiveColor
@@ -475,4 +474,20 @@
 
 	return p;
 }
-#endif
+
+extern char *getenv(char*);
+
+int
+_XmIsStippleEnabled()
+{
+	static int stipple = -1;
+	char *envvar;
+
+	if (stipple == -1) {
+		envvar = getenv("SUSE_OPENMOTIF_ENABLE_STIPPLE");
+		if (envvar && !strcmp(envvar, "1")) stipple = 1;
+		else stipple = 0;
+	}
+
+	return stipple;
+}
Index: openmotif-2.3.1/lib/Xm/XmI.h
===================================================================
--- openmotif-2.3.1.orig/lib/Xm/XmI.h	2008-08-20 15:24:32.000000000 +0200
+++ openmotif-2.3.1/lib/Xm/XmI.h	2013-03-08 17:07:57.000000000 +0100
@@ -276,14 +276,18 @@
 }  /* Close scope of 'extern "C"' declaration which encloses file. */
 #endif
 
-#define FIX_1381
+/* #define FIX_1381
+ * compile-time ifdef replaced by run-time checks on _XmIsStippleEnabled
+ */
+
 #define FIX_1396
 
-#ifdef FIX_1381
+/* #ifdef FIX_1381 */
 #define RGB_GREY_VALUE 128
 #define RGB_GREY_PRESISE 50
 extern Pixel _XmAssignInsensitiveColor(Widget w);
-#endif
+extern int _XmIsStippleEnabled();
+/* #endif */
 
 #define FIX_1375
 #define FIX_1395 1
Index: openmotif-2.3.1/lib/Xm/I18List.c
===================================================================
--- openmotif-2.3.1.orig/lib/Xm/I18List.c	2007-09-14 18:29:52.000000000 +0200
+++ openmotif-2.3.1/lib/Xm/I18List.c	2013-03-08 17:16:24.000000000 +0100
@@ -2087,11 +2087,11 @@
 
     mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
 
-#ifdef FIX_1381
-	smask = mask | GCFillStyle;
-#else
-    smask = mask | GCStipple | GCFillStyle;
-#endif
+    if (!_XmIsStippleEnabled()) {
+    	smask = mask | GCFillStyle;
+    } else {
+        smask = mask | GCStipple | GCFillStyle;
+    }
     
     XmI18List_gc(ilist) = XtGetGC(w, mask, &values);
 
@@ -2122,10 +2122,10 @@
     	XmI18List_entry_background_gc(ilist) = XtGetGC(w, mask, &values);
     }
 
-#ifdef FIX_1381
-	/*added for gray insensitive foreground (instead stipple)*/
-    values.foreground=_XmAssignInsensitiveColor(w);
-#endif
+    if (!_XmIsStippleEnabled()) {
+	    /*added for gray insensitive foreground (instead stipple)*/
+        values.foreground=_XmAssignInsensitiveColor(w);
+    }
 
     XmI18List_stippled_gc(ilist) = XtGetGC(w, smask, &values);
 
Index: openmotif-2.3.1/lib/Xm/IconButton.c
===================================================================
--- openmotif-2.3.1.orig/lib/Xm/IconButton.c	2007-09-14 18:29:52.000000000 +0200
+++ openmotif-2.3.1/lib/Xm/IconButton.c	2013-03-08 17:17:46.000000000 +0100
@@ -1836,11 +1836,11 @@
     values.fill_style = FillStippled;
 
     mask = GCForeground | GCBackground | GCGraphicsExposures;
-#ifdef FIX_1381
-	smask = mask | GCFillStyle;
-#else
-    smask = mask | GCStipple | GCFillStyle;
-#endif
+    if (!_XmIsStippleEnabled()) {
+    	smask = mask | GCFillStyle;
+    } else {
+        smask = mask | GCStipple | GCFillStyle;
+    }
 
     if (fs) {
         values.font = fs->fid;
@@ -1849,10 +1849,10 @@
 
     XmIconButton_gc(iw) = XtGetGC(w, mask, &values);
 
-#ifdef FIX_1381
-	/*added for gray insensitive foreground (instead stipple)*/
-    values.foreground = _XmAssignInsensitiveColor(w);
-#endif
+    if (!_XmIsStippleEnabled()) {
+    	/*added for gray insensitive foreground (instead stipple)*/
+        values.foreground = _XmAssignInsensitiveColor(w);
+    }
 
     XmIconButton_stippled_text_gc(iw) = XtGetGC(w, smask, &values);
 
Index: openmotif-2.3.1/lib/Xm/IconG.c
===================================================================
--- openmotif-2.3.1.orig/lib/Xm/IconG.c	2007-09-14 18:29:52.000000000 +0200
+++ openmotif-2.3.1/lib/Xm/IconG.c	2013-03-08 17:21:24.000000000 +0100
@@ -3134,20 +3134,16 @@
 
 
     /** insensitive gc **/
+    values.background = IG_Background(wid) ; 
 
-#ifdef FIX_1381
+    if (!_XmIsStippleEnabled()) {
 	/*added for gray insensitive foreground (instead stipple)*/
-	values.foreground = _XmAssignInsensitiveColor( XtParent(wid));
-#else
-    values.foreground = IG_Foreground(wid) ;
-#endif
-
-    values.background = IG_Background(wid) ; 
-#ifdef FIX_1381
-    valueMask |= GCFillStyle;
-#else
-    valueMask |= GCFillStyle | GCStipple;
-#endif
+    	values.foreground = _XmAssignInsensitiveColor( XtParent(wid));
+        valueMask |= GCFillStyle;
+    } else {
+        values.foreground = IG_Foreground(wid) ;
+        valueMask |= GCFillStyle | GCStipple;
+    }
 
     values.fill_style = FillOpaqueStippled;
     values.stipple = _XmGetInsensitiveStippleBitmap(wid);
Index: openmotif-2.3.1/lib/Xm/Label.c
===================================================================
--- openmotif-2.3.1.orig/lib/Xm/Label.c	2008-08-05 17:56:00.000000000 +0200
+++ openmotif-2.3.1/lib/Xm/Label.c	2013-03-08 17:20:33.000000000 +0100
@@ -149,10 +149,9 @@
 static KeySym GetLabelMnemonic(Widget);
 static XtPointer ConvertToEncoding(Widget, char*, Atom, unsigned long *, 
 				 Boolean *);
-#ifdef FIX_1381
+
 static Pixmap ConvertToBW(Widget w, Pixmap pm);
 static unsigned int FromColorToBlackAndWhite(char *col);
-#endif
 /********    End Static Function Declarations    ********/
 
 
@@ -696,17 +695,17 @@
   lw->label.normal_GC = XtAllocateGC((Widget) lw, 0, valueMask, &values,
 				     dynamicMask, 0);
   
-#ifdef FIX_1381
-/*added for gray insensitive foreground (instead stipple)*/
-  values.foreground =  _XmAssignInsensitiveColor((Widget)lw);
-  values.background = lw->core.background_pixel;
-#else
-  valueMask |= GCFillStyle | GCStipple;
-  values.foreground = lw->core.background_pixel;
-  values.background = lw->primitive.foreground;
-  values.fill_style = FillOpaqueStippled;
-  values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw);
-#endif
+  if (!_XmIsStippleEnabled()) {
+    /*added for gray insensitive foreground (instead stipple)*/
+      values.foreground =  _XmAssignInsensitiveColor((Widget)lw);
+      values.background = lw->core.background_pixel;
+  } else {
+      valueMask |= GCFillStyle | GCStipple;
+      values.foreground = lw->core.background_pixel;
+      values.background = lw->primitive.foreground;
+      values.fill_style = FillOpaqueStippled;
+      values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw);
+  }
   
   lw->label.insensitive_GC = XtAllocateGC((Widget) lw, 0, valueMask, &values,
 					  dynamicMask, 0);
@@ -1382,7 +1381,6 @@
   XtReleaseGC ((Widget) lw, lw->label.insensitive_GC);
 }
 
-#ifdef FIX_1381
 static
 unsigned int
 FromColorToBlackAndWhite (char *col)
@@ -1457,7 +1455,6 @@
     XpmFreeXpmImage(&im);
     return(bw_pixmap);
 }
-#endif
 
 /************************************************************************
  *
@@ -1573,12 +1570,13 @@
 	{
 	  Pixmap pix_use = Pix_insen (lw) ;
 
-	  if (pix_use == XmUNSPECIFIED_PIXMAP)
-#ifdef FIX_1381
-		Pix_insen(lw) = pix_use = ConvertToBW(wid, Pix(lw));
-#else
-		pix_use = Pix(lw);
-#endif
+	  if (pix_use == XmUNSPECIFIED_PIXMAP) {
+          if (!_XmIsStippleEnabled()) {
+    		Pix_insen(lw) = pix_use = ConvertToBW(wid, Pix(lw));
+          } else {
+	    	pix_use = Pix(lw);
+          }
+      }
 	  if (pix_use != XmUNSPECIFIED_PIXMAP) 
 	    {
 	      gc = lp->insensitive_GC;
@@ -1602,7 +1600,7 @@
 			    lp->TextRect.y + lp->PixmapRect.y,
 			    1); 
 
-#ifndef FIX_1381
+        if (_XmIsStippleEnabled()) {
 	      /* if no insensitive pixmap but a regular one, we need
  		 to do the stipple manually, since copyarea doesn't */
  	      if (pix_use == Pix(lw)) {
@@ -1616,7 +1614,7 @@
  		  XSetFillStyle(XtDisplay(lw), gc, FillOpaqueStippled);
 
  	      }
-#endif
+        }
 	    }
 	}
     }
@@ -1655,8 +1653,7 @@
 		       lp->alignment,
 		       XmPrim_layout_direction(lw), NULL);
 
-#ifdef FIX_1381
-#else
+    if (_XmIsStippleEnabled()) {
 #ifdef USE_XFT
       if (!XtIsSensitive(wid))
         {
@@ -1668,7 +1665,7 @@
 			lp->StringRect.height);
           XSetFillStyle(XtDisplay(lw), lp->insensitive_GC, FillOpaqueStippled);
         }
-#endif
+    }
 #endif
 
     }
Index: openmotif-2.3.1/lib/Xm/LabelG.c
===================================================================
--- openmotif-2.3.1.orig/lib/Xm/LabelG.c	2008-02-29 10:49:25.000000000 +0100
+++ openmotif-2.3.1/lib/Xm/LabelG.c	2013-03-08 17:24:55.000000000 +0100
@@ -176,10 +176,9 @@
 static char* GetLabelGadgetAccelerator(Widget);
 static KeySym GetLabelGadgetMnemonic(Widget);
 static void GetColors(Widget widget, XmAccessColorData color_data);
-#ifdef FIX_1381
+
 static Pixmap ConvertToBW(Widget w, Pixmap pm);
 static unsigned int FromColorToBlackAndWhite(char *col);
-#endif
 /********    End Static Function Declarations    ********/
 
 void _XmLabelConvert(Widget w, XtPointer ignore, XmConvertCallbackStruct*);
@@ -1252,17 +1251,17 @@
     LabG_NormalGC(lw) = XtAllocateGC((Widget) mw, 0, valueMask, &values,
         dynamicMask, 0);
 
-#ifdef FIX_1381
-/*added for gray insensitive foreground (instead stipple)*/
-	values.foreground = _XmAssignInsensitiveColor((Widget)mw);
-    values.background = LabG_Background(lw);
-#else
-    valueMask |= GCFillStyle | GCStipple;
-    values.foreground = LabG_Background(lw); 
-    values.background = LabG_Foreground(lw);
-    values.fill_style = FillOpaqueStippled;
-    values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw);
-#endif
+    if (!_XmIsStippleEnabled()) {
+    /*added for gray insensitive foreground (instead stipple)*/
+        values.foreground = _XmAssignInsensitiveColor((Widget)mw);
+        values.background = LabG_Background(lw);
+    } else {
+        valueMask |= GCFillStyle | GCStipple;
+        values.foreground = LabG_Background(lw); 
+        values.background = LabG_Foreground(lw);
+        values.fill_style = FillOpaqueStippled;
+        values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw);
+    }
 
     LabG_InsensitiveGC(lw) = XtAllocateGC((Widget) mw, 0, valueMask, &values,
         dynamicMask, 0);
@@ -2261,7 +2260,6 @@
     _XmRedisplayLabG(wid, event, region, &background_box);
 }
 
-#ifdef FIX_1381
 static
 unsigned int
 FromColorToBlackAndWhite(char *col)
@@ -2337,7 +2335,6 @@
     XpmFreeXpmImage(&im);
     return bw_pixmap;
 }
-#endif
 
 void
 _XmRedisplayLabG(Widget wid,
@@ -2445,11 +2442,11 @@
             Pixmap pix_use = Pix_insen (lw) ;
 
             if (pix_use == XmUNSPECIFIED_PIXMAP)
-#ifdef FIX_1381
-		Pix_insen(lw) = pix_use = ConvertToBW(wid, Pix(lw));
-#else
-		pix_use = Pix(lw);				
-#endif
+        if (!_XmIsStippleEnabled()) {
+    		Pix_insen(lw) = pix_use = ConvertToBW(wid, Pix(lw));
+        } else {
+    		pix_use = Pix(lw);				
+        }
             if (pix_use != XmUNSPECIFIED_PIXMAP)
             {
                 gc = LabG_InsensitiveGC(lw);
@@ -2472,7 +2469,7 @@
                             lw->rectangle.y + LabG_TextRect(lw).y + LabG_PixmapRect(lw).y,
 			    1);
 
-#ifndef FIX_1381
+        if (!_XmIsStippleEnabled()) {
                 /* if no insensitive pixmap but a regular one, we need
                 to do the stipple manually, since copyarea doesn't */
 				if (pix_use == Pix(lw))		{
@@ -2488,7 +2485,7 @@
                         LabG_PixmapRect(lw).height);
                     XSetFillStyle(XtDisplay(lw), gc, FillOpaqueStippled);
                 }
-#endif
+        }
             }
         }
     }
@@ -2526,8 +2523,7 @@
             lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y,
             LabG_StringRect(lw).width,
             LabG_Alignment(lw), LayoutG(lw), NULL);
-#ifdef FIX_1381
-#else
+        if (_XmIsStippleEnabled()) {
 #ifdef USE_XFT
         if (!XtIsSensitive(wid)) {
           XSetFillStyle(XtDisplay(lw), LabG_InsensitiveGC(lw), FillStippled);
@@ -2541,7 +2537,7 @@
           XSetFillStyle(XtDisplay(lw), LabG_InsensitiveGC(lw), FillOpaqueStippled);
         }
 #endif
-#endif
+        }
     }
 
     if (LabG__acceleratorText(lw) != NULL)
Index: openmotif-2.3.1/lib/Xm/List.c
===================================================================
--- openmotif-2.3.1.orig/lib/Xm/List.c	2008-04-22 11:03:41.000000000 +0200
+++ openmotif-2.3.1/lib/Xm/List.c	2013-03-08 17:17:13.000000000 +0100
@@ -2768,14 +2768,14 @@
 				    valueMask, &values, modifyMask, 0);
 
   values.background = lw->core.background_pixel;
-#ifdef FIX_1381
-/*added for gray insensitive foreground (instead stipple)*/
-  values.foreground = _XmAssignInsensitiveColor(lw);
-  valueMask |=  GCFillStyle;
-#else
-  values.foreground = lw->primitive.foreground;
-  valueMask |= GCStipple | GCFillStyle;
-#endif
+  if (!_XmIsStippleEnabled()) {
+    /*added for gray insensitive foreground (instead stipple)*/
+      values.foreground = _XmAssignInsensitiveColor(lw);
+      valueMask |=  GCFillStyle;
+  } else {
+      values.foreground = lw->primitive.foreground;
+      valueMask |= GCStipple | GCFillStyle;
+  }
 
   values.fill_style = FillOpaqueStippled;
   values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw);
Index: openmotif-2.3.1/lib/Xm/TextF.c
===================================================================
--- openmotif-2.3.1.orig/lib/Xm/TextF.c	2013-03-08 16:59:53.000000000 +0100
+++ openmotif-2.3.1/lib/Xm/TextF.c	2013-03-08 17:15:41.000000000 +0100
@@ -1959,18 +1959,18 @@
   
   if (change_stipple) {
     valueMask |= GCFillStyle;
-#ifdef FIX_1381
-    values.fill_style = FillStippled;
-#endif
+    if (!_XmIsStippleEnabled()) {
+      values.fill_style = FillStippled;
+    }
     if (stipple) {
-#ifdef FIX_1381
+        if (!_XmIsStippleEnabled()) {
 		  /*added for gray insensitive foreground (instead stipple)*/
 		  values.foreground = _XmAssignInsensitiveColor((Widget)tf);
-#else
-      values.fill_style = FillStippled;
-      valueMask |= GCStipple;
-      values.stipple = tf->text.stipple_tile;
-#endif
+        } else {
+          values.fill_style = FillStippled;
+          valueMask |= GCStipple;
+          values.stipple = tf->text.stipple_tile;
+        }
     } else 
       values.fill_style = FillSolid;
   }
Index: openmotif-2.3.1/lib/Xm/TextOut.c
===================================================================
--- openmotif-2.3.1.orig/lib/Xm/TextOut.c	2008-08-29 17:42:58.000000000 +0200
+++ openmotif-2.3.1/lib/Xm/TextOut.c	2013-03-08 17:22:58.000000000 +0100
@@ -623,18 +623,18 @@
   values.background = tw->core.background_pixel;
   if (change_stipple) {
     valueMask |= GCFillStyle;
-#ifdef FIX_1381    
-    values.fill_style = FillStippled;
-#endif    
+    if (!_XmIsStippleEnabled()) {
+        values.fill_style = FillStippled;
+    }
     if (stipple) {
-#ifdef FIX_1381
-		/*added for gray insensitive foreground (instead stipple)*/
-		values.foreground = _XmAssignInsensitiveColor((Widget)tw);
-#else
-      values.fill_style = FillStippled;
-      valueMask |= GCStipple;
-      values.stipple = data->stipple_tile;
-#endif
+        if (!_XmIsStippleEnabled()) {
+            /*added for gray insensitive foreground (instead stipple)*/
+            values.foreground = _XmAssignInsensitiveColor((Widget)tw);
+        } else {
+          values.fill_style = FillStippled;
+          valueMask |= GCStipple;
+          values.stipple = data->stipple_tile;
+        }
 
     } else 
       values.fill_style = FillSolid;
