[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 User's Guide



Setting up mwm's Virtual Desktop Panning

This section describes an example of how you can modify your .Xdefaults file and .mwmrc file 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 .mwmrc for Virtual Desktop Panning

Add the following to your .mwmrc file to use virtual panning.

Ensure that the name of your 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
 
}

Ensure that the name of your key bindings match the name given for the resource value Mwm*keyBindings in your .Xdefaults file.

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, code it as follows. You can then restart your mwm application.

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 .Xdefaults for Virtual Desktop Panning

You can 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:

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

To ensure consistency with the .mwmrc file, you can add the following lines:

Mwm*buttonBindings:     MyButtonBindings
 
Mwm*keyBindings:        MyKeyBindings

To prevent the client and icon windows from moving, you can use the following lines:

Mwm*wsm.iconPinned:     True
 
Mwm*wsm.clientPinned:   True
 
Mwm*iconPinned:         True

Where wsm is the workspace manager, which controls aspects of the desktop beyond the confines of the windows actually visible on the screen.


[ Previous | Next | Contents | Glossary | Home | Search ]