HPlogo Using the X Window System > Chapter 4 Using the X Window System

What to Expect When X Starts

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

Whether you start the X Window System from the command line or automatically from a login file, x11start always executes the same sequence of steps.

  1. If necessary, it adds the system directory, /usr/lib/X11, to your PATH variable.

  2. It looks in your home directory for a .x11start command file to read. If it doesn't find one, it reads sys.x11start in /usr/lib/X11 instead.

  3. It starts xinit, which starts the server and any clients specified in the .x11start command file.

  4. It looks in your home directory for a .Xdefaults configuration file to read. If it doesn't find one, it reads sys.Xdefaults in /usr/lib/X11 instead.

  5. It reads the configuration file named by the $ENVIRONMENT variable, .Xdefaults-hostname if the variable doesn't exist.

You won't notice any effect from issuing the command until the X display server starts.

The Server Creates the Root Window

When x11start starts the server (the program that controls the operation of your keyboard, mouse, and display), your screen will turn gray. This means that the screen has now become the root window, the backdrop or "desktop" on which the windows and icons of your environment appear. Although you can completely cover the root window with clients, you can never cover a client with the root window. The root window is always the backdrop of your window environment; nothing gets behind it.

In the center of the root window is an hourglass. This is the pointer and marks the current screen location of the mouse.

A Terminal Window Appears on the Root Window

A short time later the pointer changes to an ×, and a terminal window appears at the top of your display (if you're using the default .x11start file). This window is under the control of a window manager. If you use the OSF/Motif Window Manager (mwm), your window has a three-dimensional frame. This frame contains window manager controls.

Figure 4-1 The Default X Environment: `mwm' and One Window

[The Default X Environment: `mwm' and One Window]

The window contains a command-line prompt and behaves exactly like the screen of a terminal. You can think of this window as "a terminal in a window." There are several terminal emulation clients: inclusing hpterm, dtterm, and xterm. The examples in this book use hpterm. Refer to the man page for your terminal emulator for specific details about it.

Move the mouse. The pointer moves on the screen. When the pointer is in the root window, it has an × shape. However, when you move the pointer to a terminal window, the pointer changes to an arrowhead (when on the window frame) or an I (when in the interior of the window).

With the OSF/Motif Window Manager (operating in "explicit focus" mode), when you press and release button 1 while the pointer is in a terminal window, the window becomes the active window. When a window is active, its frame changes color. You'll discover that you can't type in a terminal window unless the window is active.

The active window is the terminal window where what you type on the keyboard appears. Your input always goes to the active window.

If there is no active window, what you type is lost.

The program running in the active window decides what to do with your typed input. Frequently the program will use a text cursor to show where your typed input will be displayed.

What to Do If X11 Doesn't Start

Table 4-1 Possible X Window System Start Problems

If this happens...You should do this...
The message command not found appears.Check your spelling and reenter the start command.
The root window displays for a moment, but then goes blank.Press the Return key to bring back your original command-line prompt and see the text following this table.
The root window displays, but no pointer appears.Press CTRLLeft ShiftReset all at the same time. (CTRLLeft ShiftPause on PC-style keyboards.) This brings your original command-line prompt back. Read the text following this table.
The root window and pointer display, but no terminal window appears.Press and hold button 3. If a menu appears, open a window. Otherwise, press CTRLLeft ShiftReset (CTRLLeft ShiftPause on PC-style keyboards.) Try restarting X, then read the text following this table if there's still a problem.
The terminal window displays, but what you type doesn't appear after the window's command prompt.Move the pointer into the window and click (press and release) button 1, then type.

 

If you encounter problems starting X11 for the first time, check the following areas:

  • Check the X11 start log in your home directory for clues by typing

       more .x11startlog Return
    

  • Check that the correct directory is in your PATH statement. If you do not have an entry for the system directory, /usr/lib/X11, then x11start will add that entry to the path. You can be sure that the entry is always there by adding it to the path yourself. To check the PATH variable, type

       env Return
    

  • Check that the DISPLAY environment variable is set correctly. If you do not already have an entry for either local:0.0 or host:0.0 (where host is the hostname of your system), X11 will add it for you when X11 starts. You can add the entry yourself. To check the DISPLAY environment variable, type:

       env Return
    

  • Check that you have the correct permissions for the .x11start file in your home directory. Type:

       ll .x11start Return
    
    The resulting permission should be at least:
       -rwx------
    

  • Check the .x11start file in your home directory for errors. Compare it with the sys.x11start file in /usr/lib/X11.

If none of the above seems to help, or you're not sure how to proceed, see your system administrator.