[comp.sys.isis] OpenWindows and ISIS demo programs

tclark@honir.cs.cornell.edu (Timothy Clark) (10/19/90)

To those of you running under the olwm of OpenWindows and experiencing problems
with the Magic Lantern program (same problem as ISIS demo "spread" - keyboard 
input not going to the application), the patch below should take care of the 
problem (in win.c):

*** win.c	Wed Jun 20 14:28:40 1990
--- /usr/u/isis/tcisis/DEVEL/win.c	Thu Oct 18 11:37:51 1990
***************
*** 473,478 ****
--- 473,479 ----
  	char *window, *rec, buf[64], *descr;
  	int x, y, width, height;
  	struct window *w = &win_windows[win];
+         XWMHints wmhints;
  
  	/* Find the width and the height of the window.
  	 */
***************
*** 495,500 ****
--- 496,507 ----
  	db_retrieve(window, "descr", &descr);
  	sprintf(buf, "%s (%s)", mag_me, descr);
  	MAG_FREE(descr);
+ 
+         /* added so ML will work under olwm of OpenWindows */
+         wmhints.flags = InputHint;
+         wmhints.input = TRUE;
+         XSetWMHints(x_dpy, w->w_win, &wmhints);
+ 
  	XStoreName(x_dpy, w->w_win, buf);
  	xsh.flags = USPosition | USSize;
  	xsh.x = x;


If "patch" wouldn't work with the patch which was previously posted here, try this one:
(The change is identical, but the diff'ed line numbers may have been off).

*** spread.c	Thu Oct 18 15:28:10 1990
--- /usr/u/isis/isisv2.1/demos/spread.c	Mon Sep 17 11:23:44 1990
***************
*** 626,631 ****
--- 626,632 ----
    char displayname[32], fontname[32];
    int x, y;
  {
+     XWMHints wmhints;
  
      gethostname (name, 19);
      for (namelen = 0; name[namelen] && name[namelen] != '.' && namelen < 18; namelen++)
***************
*** 651,656 ****
--- 652,661 ----
      twidth = leftx + numbcols*colwidth + rtwidth + rtmargin;
      win = XCreateSimpleWindow (dpy, RootWindow(dpy, screen),
                                 x, y, twidth, theight, bdrwidth, black, white);
+     wmhints.flags = InputHint;
+     wmhints.input = TRUE;
+     XSetWMHints(dpy, win, &wmhints);
+ 
      XStoreName(dpy, win, name);
      XMapRaised (dpy, win);
      if (x != 0 && y != 0) { 


Thanks to David Forslund for coming up with this bug fix (I can claim no credit!)

--Tim