[comp.lang.eiffel] OpenWindows and Eiffel

tom@eds.com (Tom H. Meyer) (12/28/90)

Hello

I've recently tracked down a problem with running the graphics classes under
OpenWindows.

SUN claims that their OpenWindows server complies with the ICCCM standard
and this may well be so. The MIT X11 server which we at EDS are running 
differs from this standard in at least one very significant way.

KeyPress events are automatically routed to the window with the focus
under our MIT X11 server. This is not the case with OpenWindows. In order
to get KeyPress events from the server you must include the following
code in the C driver after your windows have been created:

XWMHints	wmhints;

wmhints.input = True;
wmhints.flags = InputHint;
XSetWMHints (display, window, &wmhints);


After making this change, my C code ran under both servers. It looks like
it might be correct to change:

Eiffel/library/graphics/Clib/window_x.c: c_createwindow ()

--- old code ---

shint.flags = PPosition | PSize;
shint.x = x;
shint.y = y;
shint.width = width;
shint.height = height;

XSetStandardProperties(X_display, win, "Application",
	 "application", None, argv, argc, &shint);
}
return((int) win);
}

---new code ---

shint.flags = PPosition | PSize;
shint.x = x;
shint.y = y;
shint.width = width;
shint.height = height;

XSetStandardProperties(X_display, win, "Application",
         "application", None, argv, argc, &shint);
}
  /**\
   **  N.B. This code goes outside of the previous if-test
  \**/
  {
    XWMHints	wmhints;
    wmhints.input = True;
    wmhints.flags = InputHint;
    XSetWMHints (X_display, win, &wmhints);
  }

return((int) win);
}

---end new code ---

I am not an X guru at all and I have no real idea what the overall 
ramifications of this change would be. However, it does seem that
this works. Someone at ISE who is intimately familiar with their
C-X interface should verify this.

btw, The O'Reilly book specifies that this call is recommended but not
necessary. This seems to be something new as specified by the ICCCM
document. SUN claims "everyone" is going to adhere to this standard
at some point. Does anyone know if that's true?

While I'm here, might not the title of the window have been a variable
instead of hardwired to 'Application'? Was there some reason for this?


tom meyer, EDS Research               | If I don't see you in the future
...uunet!tantalum!tom                 | I'll see you in the pasture