HPlogo Using the X Window System > Chapter 7 The Window Manager

Frames

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

You can control the general appearance of the window frames in your environment with your personal resources specifications.

Parts of a Window Frame

Three aspects of the general appearance of window frames are under your control.

Color

The color of foreground, background; and top, bottom, and side shadows.

Tile

The mixture of foreground and background color that composes the pattern of the frame surface.

Font

The style (including size) of the text characters in the title bar, menus, and icon labels.

Additionally, you can control what parts of the frame are displayed.

Figure 7-1 Frame Elements

[Frame Elements]

Customizing the Window Frames

You can specify what frame components you want to appear on windows:

  • The clientDecoration resource enables you to choose just how much or how little "decoration" you want to put around each client.

  • The transientDecoration resource enables you to choose just how much or how little decoration you want to put around each transient window. A transient window is a relatively short-lived window, for example, a dialog box.

You can still access the functionality of any decoration you remove by binding its functions to mouse buttons or to key presses, as explained in “Mouse Button Bindings” later in this chapter.

Table 7-1 Valid Window Frame Elements

Frame ElementDescription
allInclude all frame elements (default value).
noneInclude no window frame elements.
±borderWindow border.
±maximizeMaximize button (includes title bar).
±minimizeMinimize button (includes title bar).
±noneInclude no window frame elements.
±resizehResize border handles (includes border).
±menuWindow menu button (includes title bar).
±titleTitle bar.

 

You specify the clientDecoration and transientDecoration resources as a list of the frame elements. If the first element in the list is preceded by a plus (+) sign or has no sign preceding it, the window manager starts with no frame and assumes that the list contains those elements you want added. If the list begins with a minus (-) sign, the window manager starts with a complete frame and assumes that the list contains elements you want removed from the frame.

For example, you may want a border with only a title bar and window menu button around a particular hpterm window started as hpterm -name hp850.

   Mwm*hp850*clientDecoration: +menu

Or you could remove the title bar from all transient windows by adding the following line in your personal resources specification:

   Mwm*transientDecoration:    -title

Coloring Window Frame Elements

You can use any of the standard X11 colors listed in the rgb.txt file in /usr/lib/X11. to color frame elements. In addition, you can create your own colors using hexadecimal values (see "Color Resources" in chapter 5).

The following table lists the individual elements of inactive and active window frames, and the resources that control their color, for mwm.

The default settings provide a 3-D visual effect without you having to specify the exact colors for every frame element.

Table 7-2 Window Frames Resources for a Color Display

To color this...Use this resource...The default value is...
Background of inactive frames.backgroundLightGrey
Left and upper bevel of inactive frames.topShadowColorLightened background color
Right and lower bevel of inactive frames.bottomShadowColorDarkened background color
Foreground (title bar text) of inactive frames.foregroundDarkened bottomShadowColor
Background of the active frame.activeBackgroundCadetBlue
Left and upper bevel of the active frame.activeTopShadowColorLightened activeBackground color
Right and lower bevel of the active frame.activeBottomShadowColorDarkened activeBackground color
Foreground (title bar text) of the active frame.activeForegroundDarkened activeBottomShadowColor

 

For example, the following lines in the .Xdefaults file in your home directory give the window manager frame a maroon foreground and a gray background. The background color is used to generate colors for the top and bottom shadow elements so that a 3-D effect is achieved.

   Mwm*foreground:     Maroon

   Mwm*background:     Gray

Tiling Window Frames With Pixmaps

A pixmap can be used to create shades of colors. Each pixmap is composed of tiles. A tile is a rectangle that provides a surface pattern or a visual texture by "mixing" the foreground and background colors into a color pattern.

Table 7-3 Tiling Window Frames with Window Manager Resources

To tile this...Use this resource...The default for\color displays is...
Background of inactive frames.backgroundPixmapNULL
Right and lower bevels of inactive frames.bottomShadowPixmapNULL
Left and upper bevels of inactive frames.topShadowPixmapNULL
Background of the active frame.activeBackgroundPixmapNULL
Right and lower bevels of the active frame.activeBottomShadowPixmapNULL
Left and upper bevels of the active frame.activeTopShadowPixmapNULL

 

The following table lists the acceptable values for pixmap resources:

Table 7-4 The Values to Use for Tiling Window Frames

To tile an element this color...Use this value...
The foreground color.foreground
The background color.background
A mix of 25% foreground to 75% background.25_foreground
A mix of 50% foreground to 50% background.50_foreground
A mix of 75% foreground to 25% background.75_foreground
In horizontal lines alternating between the foreground and background color. horizontal_tile
In vertical lines alternating between the foreground and background color. vertical_tile
In diagonal lines slanting to the right alternating between the foreground and background color.slant_right
In diagonal lines slanting to the left alternating between the foreground and background color.slant_left

 

The following figure illustrates the valid tile values:

Figure 7-2 Valid Tile Values

[Valid Tile Values]

Matting Clients

A matte is a 3-D border just inside the window between client area and window frame.

The following table lists matte elements and the resources that control their color.

Table 7-5 Coloring Window Frames with Window Manager Resources

To color this...Use this resource...The default value is...
Width of mattematteWidth0 (no matte)
Matte background.matteBackgroundmwm background
Left and upper bevel of matte.matteTopShadowColorLightened matteBackground color.
Right and lower bevel of matte.matteBottomShadowColorDarkened matteBackground color.
Matte foreground.matteForegroundDarkened matteBottonShadowColor.
Matte right and lower bevels.matteBottomShadowPixmapclient bottom shadow color
Matte left and upper bevels.matteTopShadowPixmapclient top shadow color

 

The values to use for tiling mattes are shown in “Tiling Window Frames With Pixmaps”.

For example, you could place a different matte around all instances of hpterm and xterm windows by including the following lines in your personal resources specifications:

   Mwm*HPterm*matteWidth:        10

   Mwm*HPterm*matteBackground:   SkyBlue

   Mwm*XTerm*matteWidth:         10

   Mwm*XTerm*matteBackground:    Tan

Frame Resources For Monochrome Displays

If mwm determines that the monitor is monochrome, and no color resources are specified for frame elements, mwm uses defaults appropriate for monochrome displays. Mwm*background and Mwm*activeBackground are set to White. The following table lists the frame elements, resources, and defaults for monochrome monitors.

Table 7-6 Window Frame Resource Values for Monochrome Monitors

The background is...For this resource...The default value is...
WhitetopShadowColorWhite
WhitebottomShadowColorBlack
WhiteforegroundBlack
WhitetopShadowPixmapforeground
WhiteactiveBackgroundPixmapforeground
WhiteactiveTopShowdowPixmap50_foreground

 

The sys.Xdefaults file contains a set of entries that provides a more attractive window shading for monochrome displays. These entries start with mwm_bw, and require that you start mwm with the name mwm_bw. To do this, edit the following line in .x11start:

   mwm & #Starts the mwm window manager

to read:

   mwm -name mwm_bw & #Starts the mwm window manager

You must restart X11 in order for this change to take effect.

When you start the window manager with a new name, it will no longer see resources of the form mwm*resource. It will see the class resources Mwm*resource.