*** xemacs-20.3-b8/configure.in.orig	Fri Jun 20 19:48:00 1997
--- xemacs-20.3-b8/configure.in	Sat Jun 21 13:35:06 1997
***************
*** 435,440 ****
--- 435,443 ----
  --x-includes=DIR 	Search for X header files in DIR.
  --x-libraries=DIR	Search for X libraries in DIR.
  --with-toolbars=no	Don't compile with any toolbar support.
+ --with-wm		Compile with Realized leader window for proper
+ 			creation of the ApplicationIcon with the
+ 			WindowMaker windowmanager.
  --with-menubars=TYPE	Use TYPE menubars (lucid, motif, or no).  The Lucid
  			widgets emulate Motif (mostly) but are faster.
  			*WARNING*  The Motif menubar is currently broken.
***************
*** 670,675 ****
--- 673,679 ----
  	with_jpeg	| \
  	with_png	| \
  	with_tiff	| \
+ 	with_wm		| \
  	with_xmu	| \
  	with_quantify	| \
  	with_toolbars	| \
***************
*** 2213,2219 ****
    if test "$with_tty" = "no" ; then
      AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.])
    fi
!   for feature in tooltalk cde offix \
                   menubars scrollbars toolbars dialogs xim xmu \
                   tiff png jpeg gif compface xpm
    do
--- 2217,2223 ----
    if test "$with_tty" = "no" ; then
      AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.])
    fi
!   for feature in tooltalk cde offix wm \
                   menubars scrollbars toolbars dialogs xim xmu \
                   tiff png jpeg gif compface xpm
    do
***************
*** 2239,2244 ****
--- 2243,2254 ----
    test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
  esac
  
+ dnl Check for WindowMaker
+ AC_CHECKING(for WindowMaker option);
+ if test "$with_wm" = "yes"; then
+   AC_DEFINE(HAVE_WINDOWMAKER)
+ fi
+ 
  dnl Autodetect Xauth
  dnl -lXau is only used by gnuclient, so use a special variable for Xauth X libs
  test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
***************
*** 3284,3289 ****
--- 3294,3300 ----
  test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
  test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
  test "$with_energize" = yes && echo "  Compiling in support for Lucid Energize (doesn't currently work)."
+ test "$with_wm"  = yes && echo "  Compiling in support for WindowMaker."
  case  "$with_menubars" in
    lucid ) echo "  Using Lucid menubars." ;;
    motif ) echo "  Using Motif menubars."
*** xemacs-20.3-b8/src/config.h.in.orig	Fri Jun 20 19:47:50 1997
--- xemacs-20.3-b8/src/config.h.in	Sat Jun 21 13:35:06 1997
***************
*** 361,366 ****
--- 361,369 ----
  /* Compile in support for OffiX Drag and Drop?  Requires libdnd. */
  #undef HAVE_OFFIX_DND
  
+ /* Compile in support for WindowMaker Application Icons. */
+ #undef HAVE_WINDOWMAKER
+ 
  /* Define this if you want Mule support (multi-byte character support).
     There may be some performance penalty, although it should be small
     if you're working with ASCII files. */
*** xemacs-20.3-b8/src/frame-x.c.orig	Fri Jun 20 19:48:18 1997
--- xemacs-20.3-b8/src/frame-x.c	Sat Jun 21 13:32:38 1997
***************
*** 359,365 ****
--- 359,369 ----
        if (NILP (rest))
  	return;
        f = XFRAME (XCAR (rest));
+ 
+ #ifndef HAVE_WINDOWMAKER
        x_wm_maybe_store_wm_command (f);
+ #endif /* HAVE_WINDOWMAKER */
+ 
      }
  }
  
***************
*** 1836,1842 ****
--- 1840,1850 ----
        {
  	/* tell the window manager about us. */
  	x_wm_store_class_hints (shell_widget, XtName (frame_widget));
+ 
+ #ifndef HAVE_WINDOWMAKER
  	x_wm_maybe_store_wm_command (f);
+ #endif /* HAVE_WINDOWMAKER */
+ 
  	x_wm_hack_wm_protocols (shell_widget);
        }
  
***************
*** 2412,2419 ****
--- 2420,2429 ----
    Widget w = FRAME_X_SHELL_WIDGET (f);
    Lisp_Object popup, frame;
  
+ #ifndef HAVE_WINDOWMAKER
    if (FRAME_X_TOP_LEVEL_FRAME_P (f))
      x_wm_maybe_move_wm_command (f);
+ #endif /* HAVE_WINDOWMAKER */
  
    /* Frames with the popup property are using other frames as their
       widget parent.  Deleting them are their parent has already been
*** xemacs-20.3-b8/src/device-x.c.orig	Fri Jun 20 19:48:18 1997
--- xemacs-20.3-b8/src/device-x.c	Sat Jun 21 13:31:40 1997
***************
*** 298,303 ****
--- 298,322 ----
    XIM_init_device(d);
  #endif /* HAVE_XIM */
  
+ #ifdef HAVE_WINDOWMAKER
+   XtVaSetValues(DEVICE_XT_APP_SHELL (d),
+                 XtNmappedWhenManaged, False,
+                 XtNwidth, 1,
+                 XtNheight, 1,
+                 NULL);
+   XtRealizeWidget(DEVICE_XT_APP_SHELL (d));
+   {
+     int argc;
+     char **argv;
+ 
+     make_argc_argv (Vcommand_line_args, &argc, &argv);
+     XSetCommand (XtDisplay (DEVICE_XT_APP_SHELL (d)),
+                  XtWindow (DEVICE_XT_APP_SHELL (d)), argv, argc);
+     free_argc_argv (argv);
+
+   }
+ #endif /* HAVE_WINDOWMAKER */
+ 
    Vx_initial_argv_list = make_arg_list (argc, argv);
    free_argc_argv (argv);
  
