From xemacs-m  Fri Jul 25 10:30:14 1997
Received: from newman.aventail.com (root@newman.aventail.com [199.238.236.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id KAA11541
	for <xemacs-beta@xemacs.org>; Fri, 25 Jul 1997 10:30:13 -0500 (CDT)
Received: from kramer.in.aventail.com (wmperry@kramer.in.aventail.com [192.168.1.12])
	by newman.aventail.com (8.8.5/8.8.5) with ESMTP id IAA04770
	for <xemacs-beta@xemacs.org>; Fri, 25 Jul 1997 08:30:13 -0700 (PDT)
Received: (from wmperry@localhost)
	by kramer.in.aventail.com (8.8.5/8.8.5) id IAA09865;
	Fri, 25 Jul 1997 08:30:03 -0700
Date: Fri, 25 Jul 1997 08:30:03 -0700
Message-Id: <199707251530.IAA09865@kramer.in.aventail.com>
From: "William M. Perry" <wmperry@aventail.com>
To: xemacs-beta@xemacs.org
Subject: [PATCH] XEmacs and WindowMaker...
Errors-to: wmperry@aventail.com
Reply-to: wmperry@aventail.com
X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7</SYF`{vYQ(&RI1&EiH[FvT;J}@f!4kfz
 x_!Y#=y{Uuj9GvUi=cPuajQ(Z42R[wE@{G,sn$qGr5g/wnb*"*ktI+,CD}1Z'wxrM2ag-r0p5I6\nA
 [WJopW_J.WY;

Here's a patch that makes XEmacs play nicely with WindowMaker's session
management.  This does not conditionalize it on HAVE_WINDOWMAKER like the
old patch that was posted. I don't pretend to understand all the
ramifications of not setting WM_COMMAND on an actual XEmacs frame instead
of the small unmapped window that is used here.  But we don't need to move
it around when frames get deleted, which is a good thing I'd imagine.

-Bill P.

*** frame-x.c	1997/07/25 14:41:14	1.1
--- frame-x.c	1997/07/25 14:44:05
***************
*** 365,372 ****
        if (NILP (rest))
  	return;
        f = XFRAME (XCAR (rest));
!       x_wm_maybe_store_wm_command (f);
!     }
  }
  
  static int
--- 365,375 ----
        if (NILP (rest))
  	return;
        f = XFRAME (XCAR (rest));
! #if 0
! 	  /* Don't do this here - it screws up windowmaker */
! 	  x_wm_maybe_store_wm_command (f);
! #endif
!    }
  }
  
  static int
***************
*** 1865,1871 ****
--- 1868,1877 ----
        {
  	/* tell the window manager about us. */
  	x_wm_store_class_hints (shell_widget, XtName (frame_widget));
+ #if 0
+ 	/* WindowMaker change */
  	x_wm_maybe_store_wm_command (f);
+ #endif
  	x_wm_hack_wm_protocols (shell_widget);
        }
  
***************
*** 2439,2446 ****
--- 2445,2455 ----
    Widget w = FRAME_X_SHELL_WIDGET (f);
    Lisp_Object popup, frame;
  
+ #if 0
+   /* WindowMaker change */
    if (FRAME_X_TOP_LEVEL_FRAME_P (f))
      x_wm_maybe_move_wm_command (f);
+ #endif
  
    /* Frames with the popup property are using other frames as their
       widget parent.  Deleting them are their parent has already been

*** device-x.c	1997/07/25 14:41:14	1.1
--- device-x.c	1997/07/25 14:46:17
***************
*** 303,308 ****
--- 303,328 ----
    XIM_init_device(d);
  #endif /* HAVE_XIM */
  
+ #if 1
+   /* WindowMaker change */
+   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
+ 
    Vx_initial_argv_list = make_arg_list (argc, argv);
    free_argc_argv (argv);
  

