---------------------------------------------------------------------------- Some Common Problems For New OpenWindows Users SunFLASH Vol 21 #7 September 1990 ---------------------------------------------------------------------------- Based on the questions that users are asking the US Answer Center, here are the most common problems. ------------------------------------------------------------------------------- Common Questions Or Problems Xlib application doesn't get keyboard focus. "unable to resolve host localhost" "unable to resolve host myhost" mouse scaling location of include files multiple screens error messages when programs exit ------------------------------------------------------------------------------- Problem Definition: Xlib application doesn't get keyboard focus. Recommended Solution: Either : 1) The following can be added to your $HOME/.Xdefaults file: OpenWindows.FocusLenience true This will not enforce the ICCCM requirement that windows must have the input hint set in order to receive the input focus. This option is useful if you run clients that aren't ICCCM-compliant. OR .. 2) The application is probably not ICCCM compliant and is unable to work well with our ICCCM compliant window manager - olwm. To get a keyboard focus the application needs to set the window manager hints as following : XWMHints wmhints; wmhints.input = True; wmhints.flags = InputHint; XSetWMHints(display, window, &wmhints); This information is documented in the Xlib Programming Manual, volume 1 of the O'Reilly manuals, in the Interclient Communication chapter, section 10.2.3 : "Additional Window Manager Hints". The root cause for this problem is that the Xlib application would run fine on the MIT server/wm and other servers/wm's which are not ICCCM compliant, so the customers assume something wrong with our server - which is NOT true. This information applies only to Xlib applications, XView and Xt+ toolkits set this hints by default. If the Xlib application is a 3rd party application, the customer should call the other vendor and ask him to make it ICCCM compliant. ---------------------------------------------------------------------------- Problem Definition: Trying to invoke OW 2.0 you get the error msg : "unable to resolve host localhost" OR "unable to resolve host myhost" and OW exits. OpenWindows is sensitive to host/ip address information. Recommended Solution: The hostname and/or localhost are configured incorrectly. 1. in the file /etc/hosts the localhost line should look like : 127.0.0.1 localhost 2. If the machine runs YP, the hosts map should include the localhost entry. You may use the following command to verify it: ypmatch localhost hosts The YP output should be the same as for your /etc/host file , i.e : 127.0.0.1 localhost 3. "myhost" is the host name as you get from the command : /bin/hostname. The hostname is set in your /etc/rc.boot file. This hostname, "myhost" , should be the FIRST host name for that IP address in your /etc/hosts file. Good example : 129.145.111.222 myhost tiger loghost BAD example : 129.145.111.222 tiger myhost loghost 4. If the machine runs YP, the hosts map should have "myhost" as the FIRST host name for that IP address. to verify it: ypmatch myhost hosts The YP output should have "myhost" as the first name for that IP address. ------------------------------------------------------------------------------- Problem Definition: Customers want to know how to set the scaling of the mouse (MAC terminology) from within OpenWindows. This can be done with the`xset m # #' command which sets the preferences for the mouse parameters `acceleration' and `threshold.' The mouse moves `acceleration' times as fast when the distance is greater than `threshold' pixels. This a a good starting place, although your mileage may vary: xset m 12 10 ------------------------------------------------------------------------------- Problem Definition: When novice users type in and compile sample programs from the O'Reilly book, they don't include the "-I$(OPENWINHOME)/include" option on the compile line and the compile fails. This is not clearly documented in Chapter 3. Recommended Solution: Have Chapter 3 of the O'Reilly book changed to reflect the case that OpenWindows is NOT installed in /usr, rather that is installed in the more common areas of /home/openwin or /usr/openwin. ------------------------------------------------------------------------------- Problem Definition: Customers want to know how to run multiple screens under OpenWindows 2.0. To run a multi-screen server, you need to add instructions to the .xinitrc file in the home directory to start instances of olwm for each screen. If you are going to run SunView applications, you must use the `svenv' command to export the SunView environment prior to starting the window manger for each screen. For example: eval `$OPENWINHOME/bin/svenv -env -display :0.0` $OPENWINHOME/bin/olwm -display :0.0 & eval `$OPENWINHOME/bin/svenv -env -display :0.1` $OPENWINHOME/bin/olwm -display :0.1 & In addition, you can have commands in your .xinitrc file to invoke multiple copies of the same applications, one for each screen. For example: # Screen :0.0 clients clock -display :0.0 -Wp 1047 0 -Ws 90 90 -WP 393 3 +Wi & mailtool -display :0.0 -Mx -Wp 120 120 -Ws 589 252 -WP 799 7 -Wi & shelltool -display :0.0 -Wp 544 268 -Ws 598 600 -WP 81 3 +Wi & # Screen :0.1 clients lock -display :0.1 -Wp 1047 0 -Ws 90 90 -WP 393 3 +Wi & mailtool -display :0.1 -Mx -Wp 120 120 -Ws 589 252 -WP 799 7 -Wi & shelltool -display :0.1 -Wp 544 268 -Ws 598 600 -WP 81 3 +Wi & # Screen :0.0 console xterm -display :0.0 -title "Console" -name "Console" -C -sb +ls -i & # Screen :0.1 console (exec xterm -display :0.1 -title "Console" -name "Console" -C -sb -i) Next, you start the server using the openwin `-dev' command line option to specify the framebuffers for your screens. For example: openwin -dev /dev/bwtwo0 -dev /dev/cgsix0 & or alias ow 'openwin -dev /dev/bwtwo0 -dev /dev/cgsix0 &' The order of the devices is important. The first device corresponds to the left screen. The second device corresponds to the right screen. ------------------------------------------------------------------------------- Problem Definition: When I exit from some of my X11 clients when I am running OpenWindows, I get the following error message: IO: fatal IO error 32 (Broken pipe) on X server "host:0.0" after XXX requests (XXX known processed) with 0 events remaining. The connection was probably broken by a server shutdown or KillClient. Not all X clients are ICCCM-compliant. The OpenWindows Version 2 window manager 'olwm' is ICCCM-compliant, and therefore requires that clients respond to certain protocols sent from the window manager in a ClientMessage event. For example, the protocol WM_DELETE_WINDOW (request to delete top-level window) is sent from the window manager to the client when the user selects `Quit' from the window menu. The client should then take the appropriate action. Atom wm_delete_window; wm_delete_window = XInternAtom(dpy, "WM_DELETE_WINDOW", False); (void) XSetWMProtocols(dpy, win, &wm_delete_window, 1); while (1) { XNextEvent(dpy, &event); if (event.type == ClientMessage && event.xclient.data.l[0] == wm_delete_window) { XFree(foo); XCloseDisplay(dpy); exit(1); } } Customers can refer to Section 5.2.2 in the Inter-Client Communication Conventions Manual. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sunflash is an electronic mail news service from Sun Microsystems, Ft. Lauderdale, Florida, USA. It is targeted at Sun Users and Customers. For additional information about SunFlash send mail to info-sunflash@sunvice.East.Sun.COM SunFlash is distributed via a hierarchy of aliases. Try to address change requests to the owner of the alias that you belong to. If you want to be added to the SunFlash alias, please contact the systems engineers at your local Sun office and/or send mail to sunflash-request@sunvice.East.Sun.COM. Address comments to the SunFlash editor (John McLaughlin) at sun!sunvice!flash or flash@sunvice.East.Sun.COM. (305) 776-7770.