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

Controlling Focus Policies

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

The focus policies determine what happens when a window becomes the active window. The active window is the window that has the focus of the keyboard and any extended input devices. When a window is active, the following are true:

  • What you type appears in that window.

  • The color of the window frame changes to indicate the active focus.

  • Input from extended input devices goes to that window.

Each focus policy is controlled by a specific focus policy resource. The focus policy resources are as follows:

Table 7-8 Controlling Focus Policies with Window Manager Resources

To control this...Use this resource...The default value is...
Which client window has the colormap focus.colormapFocusPolicykeyboard
Which client window has the keyboard and mouse focus.keyboardFocusPolicyexplicit

 

The following focus policies are valid for the colormapFocusPolicy resource:

keyboard

The window manager tracks keyboard input and installs a client's colormap when the client window gets the keyboard input focus.

pointer

The window manager tracks the pointer and installs a client's colormap when the pointer moves into the client window or the window frame around the client.

explicit

The window manager tracks a specific focus-selection operation and installs a client's color map when the focus-selection operation is done in the client window.

The following focus policies are valid for the keyboardFocusPolicy resource:

pointer

The window manager tracks the pointer and sets the keyboard focus to a client window when the pointer moves into that window or the window frame around the client.

explicit

The window manager tracks a specific focus-selection operation and sets the keyboard focus to a client window when the focus-selection operation is done in that client window.

When the keyboard focus policy is explicit, you can use the passSelectButton resource to specify the consequence of the focus-selection operation. If you give passSelectButton a value of "True" (the default value), the focus-selection operation is passed to the client or used by the window manager to perform some action. If you give passSelectButton a value of "False," the focus-selection operation will be used only to select the focus and will not be passed.

For example, you could change the keyboard focus policy so that moving the pointer into a window moved the focus there by adding the following line in your .Xdefaults file:

   Mwm*keyboardFocusPolicy:    pointer
© 1995 Hewlett-Packard Development Company, L.P.