HPlogo Using the X Window System > Chapter 3 Preliminary Configuration

Using Custom Screen Configurations

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

The default screen configuration is specified in the X0screens file in /etc/X11. It assumes:

  • There is one display—display 0.

  • There is one screen—screen 0.

  • The screen uses Image mode (for older displays) or Combined mode (for newer displays)

  • The screen is at the address node specified by /dev/crt.

If you use some configuration other than the default, you must edit the default screen file or add additional screen configuration files.

There should be a separate X*screens file for each display, where * is a number that matches the display number used when starting the X server. For example, X0screens is used for hostname:0, X1screens is used for hostname:1, and so on.

Creating a Custom `X*screens' File

X*screens allows you to specify:

  • device independent server options.

  • screen device files.

  • default visuals.

  • monitor size.

  • monitor power-saving level.

  • device dependent screen options.

There are two ways to create a custom screen configuration for a display:

  • You can modify X0screens so that it contains device information for all the screen configurations you may want to use. This is generally the preferred way. Only one configuration is used at a time; the others are commented out. To switch from one screen configuration to another, you uncomment some lines and comment others. For multiple displays, you would have a separate file for each display—for example, X1screens for display 1.

  • You can have a separate X*screens file for each screen configuration on a particular display. Switching between them involves modifying the command that starts the X server.

X0screens Format

Entries in the X0screens file and any X*screens files are in the form:

   [ServerOptions

      server_option

      .

      .

      .

      server_option] 

   Screen device_name 

      [DefaultVisual

         [Class visual_class]

         [Depth depth]

         [Layer layer]

         [Transparent]]

   [MonitorSize diagonal_length units] 

   [ScreenOptions

         screen_options

         .

         .

         .

         screen_options]

where:

ServerOptions

defines a block of options specific to a server

server_option

are X server options allowing the server to make the best use of your display.

Screen

defines a block of options specific to a screen.

device_name

is the name of the device file.

visual_class

describes the kind of grayscale or color to use as the visual.

depth

the number of planes (image mode only)

layer

the operating mode: image or overlay

Transparent

allow transparent windows (overlay mode only)

MonitorSize

use only if you have a non-standard monitor

ScreenOptions

defines a block of options specific to certain hardware.

screen_options

are options specific to different screens.

The Screen device_name line is the only required entry. If no other options are specified, the server will use the default options for that device.

The correct entries for your hardware are provided in the /usr/lib/X11/Xserver/info/screens/hp file (for HP-UX 10.0 and later systems).

The X0screens file, located in the /etc/X11/ directory provides detailed information about how to create your own X*screens file.

Operating Modes (Visual Layers)

Display hardware can have two kinds of display planes, image and overlay.

There are three possible server operating modes using these display planes. Different display hardware allows different modes, so all modes might not be available to you. In general, older devices can use all three modes, while newer ones use Combined.

On HP-UX 10.0 (and later) systems, for information about what modes your display hardware supports, read the /usr/lib/X11/Xserver/info/screen/hp file (HP-UX 10.0 and later systems).

The three screen modes are image, overlay, and combined:

Image Mode

The default screen mode using multiple image planes for a single screen. The number of planes ("depth") determines the variety of colors available to the screen.

An example of specifying image mode is:

   Screen           /dev/crt

      ScreenOptions

         Layer      Image
Overlay Mode

An alternate screen mode using overlay planes for a single screen. You can see what is in the image planes only if you open a "transparent" window in the overlay planes and move the window over what you want to see. Typically, overlay planes are used in conjunction with image planes in combined mode.

An example of specifying overlay mode is:

   Screen           /dev/crt

      ScreenOptions

         Layer      Overlay
Combined Mode

A combination of image and overlay planes in which a single display has a single screen that is a combination of the image and overlay planes.

The X*screens entry for this modes is more complicated. A primary and secondary device are specified, each with their own mode.

An example, with /dev/ocrt as the primary device (running in overlay mode) and /dev/crt as the secondary device (running in image mode):

   Screen                    /dev/ocrt

      ScreenOptions

         VRXSecondaryDevice  /dev/crt

Double Buffering

This feature applies to image planes only. Double buffering is not available on all displays. Refer to /usr/lib/X11/Xserver/info/screen/hp for information about your display.

Double buffering means that half of the color planes of your displays are used to display to the screen, and the other half are used to compute and draw the next screen display. This provides smooth motion for animation, and it is also faster. However, double buffering ususally reduces the number of colors available for displaying on the screen at one time. Some applications require double buffering. If you run a double-buffered application in single buffer mode, the display will flash or flicker rapidly.

If you are using a recent display device, double-buffering required by applications will occur automatically.

Screen Depth

You can specify a screen depth for image planes in the X*screens file. Valid depths for regular (single buffer) mode are 8, 12, and 24. Valid depths for double buffered mode are 8, 16, and 24. The depth of overlay planes is determined by the /dev entry in X*screens.

For information about what depth your display hardware supports, read the /usr/lib/X11/Xserver/info/screen/hp file (HP-UX 10.0 and later systems only).

More planes means more colors can be displayed simultaneously. For computer-generated graphics to look as realistic as photographs, thousands of colors must be shown at the same time. 8 planes means that 28 (256) colors can be shown, while 24 planes means that 224 (16 million) colors can be shown. Note that depth is specified only when you have more than one depth available.

Mouse Tracking with Multiple Screen Devices

If you use a multi-screen configuration, the mouse pointer can move from one screen to another. You can arrange the screens in a vertical, horizontal, or matrix orientation by adding the appropriate lines to the X*pointerkeys configuration file described in chapter 9. The sample X*pointerkeys file in /usr/lib/X11 contains examples that show how to specify the orientation of multiple screens.

NOTE: The sample X*pointerkeys file is placed in /etc/X11 at install time. If you subsequently update your system, the X*pointerkeys file in /etc/X11 is not overwritten, and the sample file is placed in /usr/newconfig.

Moving the mouse pointer off one edge of a screen causes the pointer to move to another screen, depending on the screen orientation you have specified. In the configuration files, the order of entry determines the tracking order of the mouse pointer. The first line in the file is the device on which the pointer appears when you start X11.

Other lines correspond to the screens that appear when the mouse is moved to the right or left side of the current screen. Moving off the right side goes to the next display listed, the left side the to previous display in the list. If you are on the first display listed and move right, you move to the last display listed. If you are on the last display and move left, you move to the first display.

Converting Old X*screens Files

The format of X*screens has changed at HPUX 10.0. Use the convertscr utility to convert an old X*screens file to the new format. Type:

   /usr/bin/X11/convertscr -h

to learn how to use this utility.

Making a Device Driver File

Devices specified in screen configuration files must correspond to device files. If you don't have the appropriate device file, you must create it using the mknod command. For information on mknod see the system administration manual for your operating system.

© 1995 Hewlett-Packard Development Company, L.P.