[comp.windows.x] Emacs and X server locking up under OpenWindows

bergquis@nms.gdc.portal.com (Brett Bergquist) (02/13/91)

I've built GNU Emacs to run on SunOS 4.1.1 under X11 (OpenWindows).  It
works fine.  The problem that I am having is with its interaction with
the olwm window manager.  Whenever I grab the corner of the screen with
the middle mouse button, Emacs hangs the X11 server.  If I login from
another machine and kill Emacs, then everthing comes back to life.  If I grab
the corner using either the left or right mouse buttons, it works correctly.

BTW, I've just build Epoch 3.2 for this same environment, and the exact
same thing happens.

Any ideas on what is wrong will be greatly appreciated.

Thanks.
-- 
Brett M. Bergquist, Principal Engineer | "Remind me" ... "to write an
General DataComm, Inc.,                | "article on the compulsive reading
Middlebury, CT 06762                   | of news." - Stranger in a Strange Land
Email: bergquis@nms.gdc.portal.com  or ...!portal!gdc!nms!bergquis

cflatter@zia.aoc.nrao.EDU (Chris Flatters) (02/14/91)

> Whenever I grab the corner of the screen with the middle mouse button, 
> Emacs hangs the X11 server.

Hanging the server by pressing ADJUST over a resize corner is a well known
bug (in olwm?).  I'm a little surprised that killing the client unfreezes
things but stranger things have happened.

			Chris

smarks@eng.sun.COM (Stuart Marks) (02/15/91)

| Hanging the server by pressing ADJUST over a resize corner is a well known
| bug (in olwm?).  I'm a little surprised that killing the client unfreezes
| things but stranger things have happened.

Yes, this is a bug in olwm.  The problem is that olwm has a synchronous
grab on the button, but fails to issue an AllowEvents request in certain
cases.  If you have only the binary, your only workaround is to avoid
pressing ADJUST (middle mouse button) over the resize corner, or to switch
to follow-mouse focus mode.  Killing the client unmaps the grab window,
which releases the grab.

If you have the source and you're willing to hack a bit, you can apply the
following diffs.  (Sorry, no warranty.)  Pressing ADJUST over a resize
corner or window button will do something a bit weird (i.e.  you might get
the rubber-band rectangle on the root) but at least it won't hang your
system any more.

Enjoy,

s'marks

Stuart W. Marks			ARPA: smarks@eng.sun.com
Windows & Graphics Software	UUCP: sun!smarks
Sun Microsystems, Inc.

*** winresize.c-	Thu Feb 14 15:56:15 1991
--- winresize.c	Thu Feb 14 16:38:56 1991
***************
*** 51,58 ****
  XEvent	*event;
  WinResize	*winInfo;
  {
!         if (MouseButton(dpy, event) != MB_SELECT)
                  return;
  
  	/* draw depressed corner */
  	winInfo->depressed = True;
--- 51,60 ----
  XEvent	*event;
  WinResize	*winInfo;
  {
!         if (MouseButton(dpy, event) != MB_SELECT) {
! 		XAllowEvents(dpy, AsyncBoth, CurrentTime);
                  return;
+ 	}
  
  	/* draw depressed corner */
  	winInfo->depressed = True;
*** winbutton.c-	Thu Feb 14 15:56:11 1991
--- winbutton.c	Thu Feb 14 16:40:45 1991
***************
*** 60,65 ****
--- 60,66 ----
          switch (MouseButton(dpy, event))
          {
          case MB_ADJUST:
+ 		XAllowEvents(dpy, AsyncBoth, CurrentTime);
                  return;
  
          case MB_MENU: