[comp.sys.hp] OLWM NOW WORKING for HP9000/300 series

cnbr10@vaxa.strath.ac.uk (12/21/90)

I now have a fully working olwm running under HPUX7.0 on our HP9000/300
series system. Special thanks to Andy Arvai (arvai@scripps.edu) for the
comments and patches he sent me to fix the problems with the olwm
code.

Andy's comments follow:

>We have ported XView and olwm to several Stardent machines. We also had
>the problem with .openwin-menu crashing olwm. This is a known bug in
>olwm. It tries to "free" static memory and core dumps. Look in
>clients/olwm/usermenu.c. You can get a copy of our XView and olwm port
>for the Stardent from:
>	
>	riscfs2.scripps.edu (192.42.82.8)
>
>Here are the diffs for the olwm stuff between the generic source and
>our modified source. Some of these patches are due to bugs in the
>Stardent X-Server. Also there is a lot of System V stuff put in.

I include the patches he sent me below. Note that the patch is a "Reverse"
patch...so when using patch to apply it, the -R switch is needed.

For those who want a quick fix to the coredumping problem, the only
change to the code required is to alter the lines in the buildFromSpec()
routine in usermenu.c from:

	MenuCreate(dby,m);
        MemFree(menu);
        return(m);

to:

        MenuCreate(dpy,m);
        /* This was modified for the titan and stellar since
         * freeing static memory would cause a bus error
         */
        if (menu != &userroot)
                MemFree(menu);
        return(m);

Thanks again to Andy.

David J.Young

Full patch follows:
-----------------
clients/olwm/InitGraphics.c
411,412c411
< 	if (vis != NULL)
< 		XFree( vis );
---
> 	XFree( vis );
493,496d491
< #ifdef titan
< 	/*xcs = (GRV.GlyphFontInfo)->per_char[UL_RESIZE_OUTLINE-((GRV.GlyphFontInfo)->min_char_or_byte2)];*/
< 	XTextExtents_titan(GRV.GlyphFontInfo,s,1,&i1,&i2,&i3,&xcs);
< #else
498d492
< #endif

clients/olwm/atom.c
88,89c88
< 	    if (prop != NULL)
< 	    	XFree(prop);
---
> 	    XFree(prop);

clients/olwm/defaults.c
13d12
< #ifndef SYSV
16,20d14
< #else
< #ifdef titan
< #include <unistd.h>
< #endif titan
< #endif SYSV

clients/olwm/events.c
19,24d18
< #ifdef SYSV
< #ifdef titan
< #include <rpc/types.h>
< #endif titan
< #endif SYSV
< 

clients/olwm/list.c
166d165
< 	return(len);

clients/olwm/olwm.c
15d14
< #ifndef stellar
17d15
< #endif
21d18
< #ifndef stellar
23d19
< #endif
25a22,25
> #include <sys/resource.h>
> #include <sys/stat.h>
> #include <sys/wait.h>
> 
32,35d31
< #include <sys/resource.h>
< #include <sys/stat.h>
< #include <sys/wait.h>
< 
617,620c613
< #ifndef titan
< static
< #endif
< void
---
> static void
636d628
< #ifndef SYSV
638d629
< #endif
654d644
< #ifndef SYSV
656d645
< #endif

clients/olwm/resources.c
14d13
< #ifndef SYSV
16d14
< #endif

clients/olwm/services.c
12d11
< #ifndef stellar
14d12
< #endif
16d13
< #ifndef stellar
18d14
< #endif
1017,1019d1012
< #ifdef titan
< 	extern ClientKill();
< #endif

clients/olwm/states.c
578,581d577
< 
< #ifdef stellar
< 		memcpy(temp, normalHints,
< #else
583d578
< #endif
585d579
< 

clients/olwm/usermenu.c
88d87
< #ifndef SYSV
91,95d89
< #else
< #ifdef titan
< #include <unistd.h>
< #endif titan
< #endif SYSV
728,732c722
< 	/* This was modified for the titan and stellar since
< 	 * freeing static memory would cause a bus error
< 	 */
<         if (menu != &userroot)
< 		MemFree(menu);
---
> 	MemFree(menu);

clients/olwm/usleep.c
19,23c19
< #ifdef SYSV
< #       include <sys/signal.h>
< #else
< #       include <signal.h>
< #endif
---
> #include <signal.h>
34d29
<         int (*old_handler)();
39,48c34
< #ifdef SYSV
<         old_handler = signal(SIGALRM, olwm_do_nothing);
<         setitimer(ITIMER_REAL, &new, &old);
<  
<         /* wait until we receive a signal */
<         pause();
<  
<         /* restore previous values for SIGALRM handler and the real itimer */
<         signal(SIGALRM, old_handler);
< #else
---
> 
61d46
< #endif

clients/olwm/winframe.c
883,888c883,885
< 	if (winInfo->fcore.name != NULL)
< 		XFree(winInfo->fcore.name);
< 	if (winInfo->leftfooter != NULL)
< 		XFree(winInfo->leftfooter);
< 	if (winInfo->rightfooter != NULL)
< 		XFree(winInfo->rightfooter);
---
> 	XFree(winInfo->fcore.name);
> 	XFree(winInfo->leftfooter);
> 	XFree(winInfo->rightfooter);
892,893c889
< 	if (winInfo != NULL)
< 		MemFree(winInfo);
---
> 	MemFree(winInfo);
990,993c986
< #ifndef titan
< 		(WinPushPin *)
< #endif
< 		(wf->winDeco) = 
---
> 		(WinPushPin *)(wf->winDeco) = 
1002,1005c995
< #ifndef titan
< 		(WinButton *)
< #endif
< 		(wf->winDeco) = 
---
> 		(WinButton *)(wf->winDeco) = 
1567,1571d1556
< 
< #ifdef titan
< 	/* Needed to fix titan X-server win_gravity bug */
< 	titan_resize_corner(cli->dpy, paneInfo->core);
< #endif
1598,1601d1582
< #ifdef titan
< 	/* Needed to fix titan X-server win_gravity bug */
< 	titan_resize_corner(cli->dpy, paneInfo->core);
< #endif

clients/olwm/winicon.c
357,358c357
<       if (winInfo->fcore.name != NULL)
< 	XFree(winInfo->fcore.name);
---
>       XFree(winInfo->fcore.name);

clients/olwm/winipane.c
54d53
< 
56,59c55
< #ifndef titan 
< static 
< #endif
< Pixmap   pixIcon;
---
> static Pixmap   pixIcon;

clients/olwm/winresize.c
64,68d63
< #ifdef titan
< 	/* Needed to fix titan X-server win_gravity bug */
< 	titan_resize_corner(dpy, winInfo->core);
< #endif
< 
268,313d262
< #ifdef titan
< 
< /* This is needed because of a bug in the Titan X-Server. It does not handle
<  * win_gravity correctly (except for NorthWestGravity) after window resizing.
<  * Hence the resize corners are explicitly placed in their correct positions.
<  */
< titan_resize_corner(dpy, wincore)
< Display *dpy;
< WinCore wincore;
< {
< 	int i;
< 	XWindowAttributes xwa;
< 	XWindowChanges xwc;
< 	WinResize *wr;
< 	List *list;
< 
< 	/* Get the size of the parent window */
< 	XGetWindowAttributes(dpy, (wincore.parent)->core.self, &xwa);
< 	list = (wincore.parent)->core.children;
< 	for(i=ListCount(list);i--;) {
< 		wr = ListEnum(&list);
< 		if(wr->core.kind != WIN_RESIZE)
< 			continue;
< 		switch(wr->which)
< 		{
< 		case lowright:
< 			xwc.x = xwa.width -  Resize_width;
< 			xwc.y = xwa.height - Resize_width;
< 			XConfigureWindow(dpy, wr->core.self, CWX | CWY, &xwc);
< 			break;
< 		case lowleft:
< 			xwc.x = 0;
< 			xwc.y = xwa.height - Resize_width;
< 			XConfigureWindow(dpy, wr->core.self, CWX | CWY, &xwc);
< 			break;
< 		case upright:
< 			xwc.x = xwa.width - Resize_width;
< 			xwc.y = 0;
< 			XConfigureWindow(dpy, wr->core.self, CWX | CWY, &xwc);
< 			break;
< 		case upleft:
< 			break;
< 		}
< 	}
< }
< #endif titan
-- 
_______________________________________________________________________________
  /~\           Never Trust An  |  CNBR10 Corp., VAX/VMS and UNIX Consultants
 /@@-\____---   Elephant In     |  "Pay up or we send the boys round to wipe
 / / /       \  Dark Glasses.   |   your system disk"
 l/'\  /__\  /\,                |
 \l lll   lll                   |          Service with a smile. :-)
__~_"""___"""__________________________________________________________________