Put your logo here!

TOC PREV NEXT INDEX



5

Window Managers


This chapter describes the local window managers available on the network computer. These window managers are: Motif Window Manager (MWM) and XP Window Manager (XPWM).

Setting Up Local MWM

Starting local Motif Window Manager (MWM) from your host allows MWM to access the configuration and resource files in a standard location, for example, the %HOMEDRIVE%%HOMEPATH% directory. It also allows you to customize the window manager menus and to define menu selections that include host commands. For detailed information about MWM configuration, refer to the MWM man page located in the C:\NCBridge\tekxp\man\nt directory by default.

Starting Local MWM

Enter the following command in the user's session start up file.

xpsh  -display displayname:0.0 mwm

This assumes that xpsh is in your search path. The default search path is /tekxp/bin/<host>. You need not specify -display displayname:0.0 if you have set the DISPLAY environment variable.

Note: You can also start local MWM using the remote configuration file or the Client Launcher. However, these methods do not allow MWM access to the system-level and user-level customization files on your host.
Starting MWM with the xp.cnf File

The start and preload commands in the xp.cnf file can be used to start MWM. For details about these commands, refer to Chapter 2, Remote Configuration in the NCBridge Reference Manual.

Starting MWM with the Client Launcher

You can customize the Client Launcher to include those clients that you use most often. If authorized, MWM is listed on the Client Launcher by default as part of the Window Managers submenu. To start MWM, move the mouse pointer to MWM and click the mouse button. For information about the Client Launcher, refer to the Client Launcher section in Chapter 4, Local Clients.

Accessing MWM Configuration Files

When starting local MWM using xpsh, using the -access xpsh command-line option enables local MWM to access full resource and file access as if it were started from a host. For example, the following line starts local MWM and accesses system-level and user-level customization files on the host:

xpsh -access xpsh mwm

Accessing the MWM Resource Description File

MWM searches for a resource description file in this order:

    1. The value of the MWM configFile resource
    2. %HOMEDRIVE%%HOMEPATH%/.mwmrc
    3. /usr/lib/X11/system.mwmrc
    4. /usr/lib/X11/system.mwmrc

If MWM does not find a resource description file in one of the above locations, it defaults to a language-specific defaults file under the boot directory, typically, C:\NCBridge\tekxp\boot\<language>\system.mwmrc. The <language> variable is determined by the language command in the remote configuration file, or in Setup. To see the current language setting, enter Setup and look at the Language option. A sample system.mwmrc file is located in \tekxp\examples\mwm.

Creating a Local MWM Resource Description File

You can copy the system.mwmrc file to your home directory and then modify the file to customize your Motif environment. Table 5-1 shows the functions you can add to the file.
Table 5-1 MWM Functions 
Function
Description
f.beep
Causes a beep.
f.cci
Controls the placement and naming of client-command interface (CCI) commands generated by applications.
f.circle_down
Moves the top window to the bottom of the window stack.
f.circle_up
Moves the bottom window to the top of the window stack.
f.exec or !
Executes the following shell command.
f.focus_color
Sets the colormap focus to a window.
f.focus_key
Sets the keyboard input focus to a window.
f.goto
Moves the root window to a specified location.
f.kill
Kills an application and its window.
f.lower
Moves a window to the bottom of the window stack.
f.maximize
Maximizes a window.
f.menu
Activates the named menu. This function can be used to create cascading and Popup Menus.
f.minimize
Iconifies a window.
f.move
Starts an interactive move for a window.
f.next_cmap
Installs the next colormap.
f.next_key
Moves the keyboard input focus to the next window in the window stack.
f.nop
Does nothing.
f.normalize
Causes an icon or a maximized window to be displayed at its normal size.
f.normalize_and_raise
Causes an icon or a maximized window to be displayed at its normal size and raised to the top of the window stack.
f.pack_icons
Reorganizes the icons according to the current icon placement policy.
f.pan
Moves the root window a specified amount.
f.pass_keys
Toggles the use of special key bindings.
f.post_wmenu
Posts the Window Menu.
f.prev_cmap
Installs the previous colormap in the list of colormaps for the window with the colormap focus.
f.prev_key
Moves the keyboard input focus to the previous window in the window stack.
f.quit_mwm
Exits the window manager without exiting the X Window System.
f.raise
Raises a window to the top of the window stack.
f.raise_lower
If obscured, raises a window to the top of the window stack; otherwise, lowers it to the bottom of the window stack.
f.refresh
Redraws all the windows on the screen.
f.refresh_win
Redraws a single window.
f.resize
Starts an interactive resize for a window.
f.restart
Stops and restarts the window manager.
f.restore
Restores an iconified window to its previous state.
f.restore_and_raise
Restores an iconified window to its previous state and raises it to the top of its stack.
f.screen
Moves a pointer to a specific screen.
f.send_msg
Sends a client message to the application.
f.separator
Draws a separator in a menu pane.
f.set_behavior
Restarts the window manager with the default behavior or reverts to any custom behavior.
f.title
Inserts a title in a menu pane.
f.track_pan
Continuously moves the root window in the direction of the mouse.

Accessing the MWM Defaults File

MWM is configured from its resource database. This database is built from the following sources, listed in the order that MWM accesses them.

    1. MWM command-line options.
    2. File specified by the XENVIRONMENT environment variable, if it is set, otherwise:
      %HOMEDRIVE%%HOMEPATH%/.Xdefaults-terminal_name, if it exists.
      These values do not override the existing values in the database.
    3. RESOURCE_MANAGER root window property, if it is set, otherwise:
      %HOMEDRIVE%%HOMEPATH%/.Xdefaults, if it exists.
      The RESOURCE_MANAGER is typically set with the xrdb command. These values do not override the existing values in the database. An example .Xdefaults file is shown in Example 5-1.
    4. The user's application specific app-defaults file:
      %HOMEDRIVE%%HOMEPATH%/Mwm, if it exists, otherwise:
      %HOMEDRIVE%%HOMEPATH%/Mwm
      The actual location of this file depends on the XUSERFILESEARCHPATH and XAPPLRESDIR environmental variables. These values do not override the existing values in the database.
    5. The application's specific app-defaults file:
      /usr/lib/X11/app-defaults/Mwm, if it exists, otherwise:
      /usr/lib/X11/app-defaults/Mwm
      The actual location of this file depends on the XFILESEARCHPATH environmental variable. These values do not override the existing values in the database.
      If none of the above application specific app-defaults files are found, MWM defaults to a language-specific defaults file from the boot configuration directory, typically, /tekxp/boot. The language is specified by the Language command in the remote configuration file (xp.cnf), or in Setup. To see the current language setting, enter Setup and look at the Language option.
    Example 5-1 Example .Xdefaults File
    ! For the monochrome (or 4 bit plane=16 color/grey) device,
    ! decorations are shaded with pixmaps.The window title is
    ! reverse video to improve visibility.
    #if PLANES > 4
    Mwm*menu*background #d4d8e8
    Mwm*menu*foreground: Black
    Mwm*background: #7c8498
    Mwm*foreground: #fce089
    Mwm*activeForeground: #ffff00
    Mwm*activeBackground: #9db5cd
    #else
    Mwm*bitmapDirectory: /usr/include/X11/bitmaps
    Mwm*bottomShadowColor: Black
    Mwm*topShadowColor: White
    Mwm*activeBottomShadowColor: Black
    Mwm*activeTopShadowColor: White
    Mwm*background: Black
    Mwm*client*backgroundPixmap: flipped_gray
    Mwm*activeBackground: White
    Mwm*activeBackgroundPixmap: gray
    Mwm*foreground: White
    Mwm*client*foregroundPixmap: flipped_gray
    Mwm*activeForeground: Black
    Mwm*activeForegroundPixmap: gray
    Mwm*iconImageBackground: Black
    Mwm*iconImageForeground: White
    Mwm*iconImageBottomShadowPixmap: flipped_gray
    Mwm*iconImageTopShadowPixmap: flipped_gray
    #endif
    Mwm*buttonBindings: DefaultButtonBindings
    Mwm*clientDecoration: all
    Mwm*clientAutoPlace: True
    Mwm*frameBorderWidth: 5
    Mwm*iconAutoPlace: True
    Mwm*iconClick: False
    Mwm*iconBoxGeometry: 6x1+0-0
    Mwm*iconDecoration: image label
    Mwm*iconFrameBorderWidth: 20
    Mwm*iconPlacement: bottom left
    Mwm*iconPlacementMargin: 10
    Mwm*interactivePlacement: False
    Mwm*keyBindings: DefaultKeyBindings
    Mwm*passSelectButton: True
    Mwm*resizeBorderWidth: 8
    Mwm*showFeedback: all
    Mwm*systemButtonClick: False
    Mwm*systemMenu: DefaultRootMenu
    Mwm*useIconBox: True
    Mwm*windowMenu: DefaultWindowMenu
    Mwm*cleanText: True
    Mwm*saveUnder: True

Accessing Bitmap Files

The MWM iconImage and bitmapDirectory resources are used to specify paths to bitmap files. The default value for bitmapDirectory is the /usr/include/X11/bitmaps directory. To access a bitmap file star in your %HOMEDRIVE%%HOMEPATH% directory, the iconImage resource can be set in your %HOMEDRIVE%%HOMEPATH%/.Xdefaults file as follows:

Mwm*program_name*iconImage: ~/star

Specifying Virtual Key Bindings

MWM reads the %HOMEDRIVE%%HOMEPATH%/.motifbind file, if it exists, to install a virtual key bindings property on the root window. Example motif bindings files are installed in the /tekxp/examples/mwm directory by default.

Setting Up Virtual Desktop Panning

The Virtual Desktop Panning feature is available with MWM 2.0. This section provides an example of how you can modify your .Xdefaults and .mwmrc files to activate virtual panning in MWM. The MWM functions f.pan, f.goto, and f.track_pan need to be bound either to keys or to mouse buttons.

Editing the  .mwmrc File for Virtual Desktop Panning

Add the following to your .mwmrc file to use virtual panning. Make sure that the name of the button bindings match the name given for the resource value Mwm*buttonBindings in your .Xdefaults file.

Buttons MyButtonBindings
{
<Btn2Down> root f.menu GotoMenu
Meta<Btn1Down> root f.track_pan
}
Keys MyKeyBindings
{
Meta<Key>Up window|root f.pan 0,-100
Meta<Key>Down window|root f.pan 0,100
Meta<Key>Left window|root f.pan -100,0
Meta<Key>Right window|root f.pan 100,0
}

To set up a menu that lets you quickly switch to different locations on the virtual desktop, enter the following. Then restart MWM.

Menu GotoMenu
{
Up-Left f.goto 1500,1100
Up f.goto 0,1100
Up-Right f.goto -1500,1100
Left f.goto 1500,0
Home f.goto 0,0
Right f.goto -1500,0
Down-Left f.goto 1500,-1100
Down f.goto 0,-1100
Down-Right f.goto -1500,-1100
}
Editing the  .Xdefaults File for Virtual Desktop Panning

Add the following to your .Xdefaults file to keep MWM from moving all your windows back to the visible part of the screen at startup:

Mwm*positionOnScreen: False

Note that it is important to set the positionOnScreen resource to False because MWM automatically repositions all off-screen windows back to the display screen on restart.

To set up a menu to go to preset positions on the virtual canvas, add the following lines:

Mwm*GotoMenu*numColumns: 3
Mwm*GotoMenu*packing: PACK_COLUMN
Mwm*GotoMenu*orientation: HORIZONTAL
Mwm*GotoMenu*alignment: ALIGNMENT_CENTER

For consistency with the .mwmrc file, add the following lines:

Mwm*buttonBindings: MyButtonBindings
Mwm*keyBindings: MyKeyBindings

To prevent the client and icon windows from moving, add the following lines:

Mwm*XBiff*iconPinned: True
Mwm*XBiff*clientPinned: True
Mwm*iconPinned: True

Troubleshooting MWM

This section contains some information on possible solutions to correct some common MWM problems:

Setting Up XP Window Manager

XP Window Manager (XPWM) is a local window manager available with the network computer. XPWM provides a basic window manager that uses a minimum amount of network computer memory.

Accessing the XPWM Defaults File

XPWM is configured from its resource database. This database is built from the following sources, listed in the order that XPWM accesses them (the last setting takes precedence over the first).

    1. RESOURCE_MANAGER root window property, if it is set.
      The RESOURCE_MANAGER is typically set with the xrdb command. These values do not override the existing values in the database.
    2. The application's specific app-defaults file:
      /usr/lib/X11/<language>/app-defaults/xpwm
    3. XPWM default values.

Starting the XP Window Manager

XPWM can be started with xpsh, from the remote configuration file (xp.cnf), or from the Client Launcher.

Starting XPWM with xpsh

Enter the following command in the user's session start-up file.

xpsh  -display displayname:0.0 xpwm

This assumes that xpsh is in your search path. The default search path is /tekxp/bin/<host>.

Note: You need not specify -display displayname:0.0 if you have set the DISPLAY environment variable.
Starting XPWM with the xp.cnf File

The start and preload commands in the xp.cnf file can be used to start XPWM. For details about these commands, refer to Chapter 2, Remote Configuration, in the NCBridge Reference Manual.

Starting XPWM with the Client Launcher

The Client Launcher can be customized to include those clients that you use most often. The XPWM is listed on the Client Launcher by default as part of the Window Managers submenu. To start XPWM, move the mouse pointer to XPWM and click the mouse button. For information about the Client Launcher, refer to the Client Launcher topic in Chapter 4, Local Clients.

Using XPWM

You use XPWM much like any other window manager. The windows have many of the same elements as the Motif Window Manager. Figure 5-1 shows a sample XPWM window and its elements.


Figure 5-1 Elements of an XPWM Window

You can move and resize windows using either the mouse alone, or the commands located on the XPWM menu. Table 5-2 shows the mouse interface.
Table 5-2 Working With XPWM Windows
To
Do This
Move a window
Position the mouse pointer on the title bar, click and drag the window to the new position.
Resize a window
Click on the Resize button and drag the window to the new size.
Make a window active
Position the mouse pointer on the title bar and click.
Iconify a window
Click on the Iconify button.
De-iconify a window
Click on the window's icon.
Raise a window to the top
Position the mouse pointer in the window and click.

To access the XPWM menu, position the mouse pointer outside of a window, and click. First select a command, and then move the mouse pointer to the window you want the command to affect. Table 5-3 shows the commands available on the XPWM menu.
Table 5-3 XPWM Menu Commands
Command
Description
Iconify
Iconify a window.
Resize
Resize a window.
Move
Move a window.
Raise
Move a window to the top of other windows.
Lower
Move a window behind other windows.
Icon Manager
Open the icon manager, which lists the open windows and applications on the screen.
Kill
Close a window and any processes running in the window.
Delete
Close a secondary window, such as a dialog box for an application.
Restart XPWM
Exit and restart the XpressWare Window Manager. Open windows and processes will remain while the window manager restarts.
Exit XPWM
Exit the XpressWare Window Manager.

Customizing XPWM

You can change the appearance of XPWM using the resource settings listed in Table 5-4. XPWM does not allow user-defined bindings or user-defined menus.
Table 5-4 XPWM Resource Settings
Resource
Description
xpwm.IconForeground <color>
Specifies foreground color of icons.
xpwm.IconBackground <color>
Specifies background color of icons.
xpwm.IconFont <font>
Specifies the font used with icon names.
xpwm.TitleForeground <color>
Specifies the foreground color of the title bar.
xpwm.TitleBackground <color>
Specifies the background color of the title bar.
xpwm.TitleFont <font>
Specifies the font used in the title bar.
xpwm.MenuForeground <color>
Specifies the foreground color of the XPWM menu.
xpwm.MenuBackground <color>
Specifies the background color of the XPWM menu.
xpwm.MenuFont <font>
Specifies the font used in the XPWM menu.
xpwm.BorderWidth <integer>
Specifies the width of the border around the windows.
xpwm.BorderColor <color>
Specifies the color of the borders around the windows.
xpwm.BorderHighlightColor <color>
Specifies the border highlight color.
xpwm.IconPosition <position>
Specifies the icon position.
xpwm.InteractivePlacement <state>
Specifies whether placement is interactive or static (true/false).
xpwm.InputFocus <method>
Specifies the method used by the mouse to activate a window. Enter either click or point.


TOC PREV NEXT INDEX