A couple of people have been trying to compile lemacs-19.4 with
motif1.2.1 (including me).  After talking with Jamie about itm this is
what I have.

  o  I replaced the athena Paned widget with a motif PanedWindow.
  o  I commented out the XmProcessTraversal (Caused a core dump) in xm_set_keyboard_focus()
  o  I Added support for Tear-off menus (That's what started this whole thing)

This is by no means a complete patch.. I just thought  I would share
what I have with others because I'm stuck..

I have observed the following not to work..

  o The geometry of the main window gets messed up when any 
    screen is mapped.
  o If you cause a pulldown to stay mapped, then click outside of the
    menu to make it go away, it won't, and you can never get rid of it.
    But you can still type into the emacs window...
  o The following function I have bound to Button3 displays the above
    behavior, and it will not switch to the buffer selected:

(defun buffer-list-on-three (e)
  (interactive "e")
 (let ((buffer-menu (car (find-menu-item current-menubar '("Buffers"))))
	name
	buffers)
    (if (not buffer-menu)
	nil
      (setq buffers (buffer-list))
      (setq buffers
	    (mapcar (function
		     (lambda (buffer)
		       (if (setq name (format-buffers-menu-line buffer))
			   (vector name
			     (list 'switch-to-buffer (buffer-name buffer))
			     t))))
		    buffers))
      (setcdr buffer-menu buffers))
  (popup-menu buffer-menu)
  ))

(define-key global-map 'button3 'buffer-list-on-three)

  o When running packages that put a menu entry into the menubar,
    like Gnus and Vm, the following happens...

Program received signal 11, Segmentation fault
0x11160c in _XmGetActiveTopLevelMenu ()
(gdb) where
#0  0x11160c in _XmGetActiveTopLevelMenu ()
#1  0x11177c in _XmGetActiveTopLevelMenu ()
#2  0x119f60 in _XmCallRowColumnUnmapCallback ()
#3  0xdb344 in _XmCascadingPopup ()
#4  0x1a9468 in XtCreateApplicationShell ()
#5  0x1a9360 in XtCreateApplicationShell ()
#6  0x1a977c in XtCreateApplicationShell ()
#7  0x1a98b8 in _XtDoPhase2Destroy ()
#8  0x1a9a44 in XtDestroyWidget ()
#9  0xd4698 in destroy_all_children (widget=0x308800) at lwlib-Xm.c:154
#10 0xd54e8 in xm_update_menu (instance=0x373e80, widget=0x308800,
    val=0x378a00, deep_p=0 '\000') at lwlib-Xm.c:457
#11 0xd59dc in xm_update_one_widget (instance=0x373e80, widget=0x308800,
    val=0x378a00, deep_p=0 '\000') at lwlib-Xm.c:563
#12 0xd2d88 in set_one_value (instance=0x373e80, val=0x378a00, deep_p=0 '\000')
    at lwlib.c:489
#13 0xd2e08 in update_one_widget_instance (instance=0x373e80, deep_p=0 '\000')
    at lwlib.c:510
#14 0xd2e64 in update_all_widget_values (info=0x378a40, deep_p=0 '\000')
    at lwlib.c:519
#15 0xd30e8 in lw_modify_all_widgets (id=3197952, val=0x2fb240,
    deep_p=0 '\000') at lwlib.c:571
#16 0x4b004 in set_screen_menubar (s=0x30cc00, deep_p=0) at menubar.c:518
#17 0x4c444 in update_screen_menubars () at menubar.c:975
#18 0xf0ec in redisplay () at xdisp.c:729
.....

But lemacs will come up, and the Tear-off menus do work.. 

Any other sugestions?

Bob

---------------------%<---------------------------------------------------------

diff -r -c src/lwlib/lwlib-Xm.c my-src/lwlib/lwlib-Xm.c
*** src/lwlib/lwlib-Xm.c	Wed Jan 20 04:44:29 1993
--- my-src/lwlib/lwlib-Xm.c	Tue Jan 26 09:36:40 1993
***************
*** 364,369 ****
--- 364,370 ----
        else
  	{
  	  menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0);
+ 	  XtVaSetValues(menu, XmNtearOffModel, XmTEAR_OFF_ENABLED, NULL);
  	  make_menu_in_widget (instance, menu, cur->contents);
  	  XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
  	  button = XmCreateCascadeButton (widget, cur->name, al, ac);
***************
*** 427,432 ****
--- 428,434 ----
        if (contents)
  	{
  	  menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0);
+ 	  XtVaSetValues(menu, XmNtearOffModel, XmTEAR_OFF_ENABLED, NULL);
  	  make_menu_in_widget (instance, menu, contents);
  	  ac = 0;
  	  XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
***************
*** 1428,1433 ****
  void
  xm_set_keyboard_focus (Widget parent, Widget w)
  {
!   XmProcessTraversal (w, 0);
    XtSetKeyboardFocus (parent, w);
  }
--- 1430,1435 ----
  void
  xm_set_keyboard_focus (Widget parent, Widget w)
  {
!  /*  XmProcessTraversal (w, XmTRAVERSE_CURRENT);*/
    XtSetKeyboardFocus (parent, w);
  }
diff -r -c src/menubar.c my-src/menubar.c
*** src/menubar.c	Wed Jan 20 05:31:16 1993
--- my-src/menubar.c	Wed Jan 27 13:32:21 1993
***************
*** 25,31 ****
--- 25,37 ----
  
  #include <X11/Intrinsic.h>
  #include <X11/StringDefs.h>
+ #ifdef LWLIB_USES_MOTIF
+ #include <Xm/PanedW.h>
+ #include <Xm/SashP.h>
+ 
+ #else
  #include <X11/Xaw/Paned.h>
+ #endif
  
  #include "lwlib.h"
  
***************
*** 472,477 ****
--- 478,486 ----
  set_screen_menubar (struct screen *s, int deep_p)
  {
    widget_value *data;
+   Widget *children;
+   XtWidgetGeometry size;
+   int num_children;
    Lisp_Object obuf = Fcurrent_buffer ();
    Lisp_Object menubar;
  
***************
*** 525,535 ****
--- 534,558 ----
  			    0, pre_activate_callback,
  			    menubar_selection_callback, 0);
  	s->display.x->menubar_widget = menubar_widget;
+ 
+ 	size.request_mode = CWHeight;
+ 	XtQueryGeometry(menubar_widget, NULL, &size);
+ 	
  	XtVaSetValues (menubar_widget,
+ #ifdef LWLIB_USES_MOTIF
+ 		       XmNseparatorOn, False,
+ 		       XmNallowResize, True,
+ 		       /* Set these equal to make the "Slider" go away  */
+ 		       XmNpaneMinimum, size.height,
+ 		       XmNpaneMaximum, size.height,
+ 		       XmNpositionIndex, XmFIRST_POSITION,
+ #else
  		       XtNshowGrip, 0,
  		       XtNresizeToPreferred, 1,
  		       XtNallowResize, 1,
+ #endif
  		       0);
+ 	
        }
      UNBLOCK_INPUT;
    }
***************
*** 996,1002 ****
--- 1019,1027 ----
      return;
  
    BLOCK_INPUT;
+ #ifndef LWLIB_USES_MOTIF
    XawPanedSetRefigureMode (x->column_widget, 0);
+ #endif
    
    /* the order in which children are managed is the top to
       bottom order in which they are displayed in the paned window.
***************
*** 1089,1095 ****
--- 1114,1122 ----
    XtManageChild (x->edit_widget);
  
    /* and now thrash the sizes */
+ #ifndef LWLIB_USES_MOTIF
    XawPanedSetRefigureMode (x->column_widget, 1);
+ #endif
    UNBLOCK_INPUT;
  }
  
diff -r -c src/xfns.c my-src/xfns.c
*** src/xfns.c	Sun Jan 17 17:39:46 1993
--- my-src/xfns.c	Tue Jan 26 11:07:52 1993
***************
*** 32,38 ****
--- 32,42 ----
  #include <X11/Xresource.h>
  #include <X11/Shell.h>
  
+ #ifdef LWLIB_USES_MOTIF
+ #include <Xm/PanedW.h>
+ #else
  #include <X11/Xaw/Paned.h>
+ #endif
  #include <X11/Xaw/Label.h>
  
  #include <X11/Xos.h>
***************
*** 375,382 ****
    Widget w;
  {
    BLOCK_INPUT;
!   XtVaSetValues (w, XtNshowGrip, 0, XtNresizeToPreferred, 1,
! 		 XtNallowResize, 1, 0);
    UNBLOCK_INPUT;
  }
  
--- 379,394 ----
    Widget w;
  {
    BLOCK_INPUT;
!   XtVaSetValues (w,
! #ifdef LWLIB_USES_MOTIF
! 		 XmNallowResize, True,
! 		 XmNseparatorOn, False,
! #else
! 		 XtNshowGrip, 0,
! 		 XtNresizeToPreferred, 1,
! 		 XtNallowResize, 1,
! #endif
! 		 0);
    UNBLOCK_INPUT;
  }
  
***************
*** 690,711 ****
--- 702,740 ----
    maybe_set_screen_title_format (shell_widget);
  
    ac = 0;
+ #ifdef LWLIB_USES_MOTIF 
+   XtSetArg (al[ac], XmNborderWidth, 0); ac++;
+   XtSetArg (al[ac], XmNmarginHeight, 0); ac++;
+   XtSetArg (al[ac], XmNmarginWidth, 0); ac++;
+   pane_widget = XtCreateWidget ("pane", xmPanedWindowWidgetClass, shell_widget, al,
+ 				ac);
+ #else
    XtSetArg (al[ac], XtNborderWidth, 0); ac++;
    pane_widget = XtCreateWidget ("pane", panedWidgetClass, shell_widget, al,
  				ac);
+ #endif
  
    /* mappedWhenManaged to false tells to the paned window to not map/unmap 
     * the emacs screen when changing menubar.  This reduces flickering a lot.
     */
    ac = 0;
+ #ifdef LWLIB_USES_MOTIF
+   XtSetArg (al[ac], XmNmappedWhenManaged, 0); ac++;
+   XtSetArg (al[ac], XmNallowResize, True); ac++;
+   XtSetArg (al[ac], XmNseparatorOn, False); ac++;
+   XtSetArg (al[ac], XmNpositionIndex, XmLAST_POSITION); ac++;
+   
+ #else
    XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++;
    XtSetArg (al[ac], XtNshowGrip, 0); ac++;
    XtSetArg (al[ac], XtNallowResize, 1); ac++;
    XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++;
+ #endif
    XtSetArg (al[ac], XtNemacsScreen, s); ac++;
    screen_widget = XtCreateWidget ("screen", emacsScreenWidgetClass,
  				  pane_widget, al, ac);
  
+ 
    s->display.x->widget = shell_widget;
    s->display.x->column_widget = pane_widget;
    s->display.x->edit_widget = screen_widget;
***************
*** 939,945 ****
--- 968,976 ----
  #ifdef LINE_INFO_WIDGET
    
    BLOCK_INPUT;
+ #ifndef LWLIB_USES_MOTIF
    XawPanedSetRefigureMode (x->row_widget, 0);
+ #endif
    
    /* the order in which children are managed is the top to
       bottom order in which they are displayed in the paned window. */
***************
*** 965,971 ****
--- 996,1004 ----
    if (just_created)
      XStoreName (x_current_display, XtWindow(x->lineinfo_widget), "lineinfo_widget");
  
+ #ifndef LWLIB_USES_MOTIF
    XawPanedSetRefigureMode (x->row_widget, 1);
+ #endif
  
    UNBLOCK_INPUT;
x-gateway: rodan.UU.NET from bug-lucid-emacs to alt.lucid-emacs.bug; Thu, 21 Jan 1993 11:40:35 EST
From: shigeya%foretune.co.jp@lucid.com (Shigeya Suzuki)
Return-Path: <shigeya@foretune.co.jp>
Subject: Lucid Emacs 19.4: alternative FTP site in Japan
Date: Thu, 21 Jan 1993 16:40:35 GMT
Newsgroups: alt.lucid-emacs.bug