home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Linux in a NutshellLinux in a NutshellSearch this book

19.5. The WinList: Switching the Focus

FvwmWinList is an fvwm2 module that lets you keep track of all the application windows on your many screen pages. Generally the WinList is configured to let you switch the focus to whatever window you want, but you can set it up to perform other operations.

In a typical environment, you can start the WinList from the Fvwm Modules menu on the Root menu. If you prefer to configure fvwm2 to start the WinList automatically, see Section 19.5.2. (You might also configure a keyboard shortcut to start the WinList module; see Section 19.3 for details.)

Some of WinList's appearance and behavior can be customized. We'll see some example module definition lines later. If you are using that example configuration, WinList performs the following operations:

First mouse button click
Switch the focus to the window in question. If the window is iconified, de-iconify. Switch the screen view so that the page with the window is displayed.

Second mouse button click
Iconify/deiconify window; the page displayed does not change.

Third mouse button click
Display a pop-up box containing information about the window in question (e.g., dimensions in pixels, whether it is sticky, permanent, or transient, etc.). Pop down the box by clicking any mouse button on it.

One of the interesting features of the WinList is that none of these commands moves the pointer to the focus window. Instead, the pointer stays on the entry in the WinList that corresponds to the focus window.

In theory, you could simply keep the pointer on the WinList and do all your navigation from there—except when you want to work with the FvwmButtons module or another of the windows that don't normally appear in the WinList.

19.5.1. Distinguishing Multiple Instances of Windows in WinList

The primary limitation of the WinList is that it can be difficult to tell which window in the list is which. Each entry in the WinList gives the text that appears in the corresponding window's titlebar. (If the titlebar is suppressed, it gives the text that would normally appear.) If you tend to run the same program many times simultaneously—e.g., multiple xterms—they all look alike in the WinList. (The one difference is that iconified windows have entries surrounded by parentheses.)

If you get attached to using the WinList, you should probably specify different titles for multiple instances of the same window. The standard X options -title or -name will do the trick. Note, however, that while -title changes only the text in the titlebar, -name literally changes the name of the application. Thus it affects how resources and configuration file parameters are assigned.

19.5.2. Making the WinList Part of Your Default Environment

If you want to make the WinList part of your default environment, edit your configuration file to have the FvwmWinList module run at both initialization and restart of the window manager. In the following example, we've added the third and sixth lines for these purposes:

AddToFunc InitFunction    "I" Module FvwmButtons
+           "I" exec xsetroot -mod 2 2 -fg \#554055 -bg \#705070
+           "I" Module FvwmWinList

AddToFunc RestartFunction "I" Module FvwmButtons
+           "I" exec xsetroot -mod 2 2 -fg \#554055 -bg \#705070
+           "I" Module FvwmWinList

These lines specify that the FvwmWinList module is run whenever you start or restart the window manager. The WinList window appears in the bottom left corner of the screen.

As an alternative, you might make the WinList appear as a pop-up menu. The following definition binds the module to the third pointer button when it is held down on the root window (this may not be as handy as having the module present all the time):

Mouse 3         R       A       Module FvwmWinList Transient

But running a module is different from specifying how it looks and behaves. Like a number of other modules (FvwmButtonBox, FvwmPager, etc.), the various characteristics of the FvwmWinList module are defined elsewhere in the configuration file. Here are some typical definition lines:

#########################FvwmWinList#########################
*FvwmWinListBack #908090
*FvwmWinListFore Black
*FvwmWinListFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
*FvwmWinListAction Click1 Iconify -1,Focus
*FvwmWinListAction Click2 Iconify
*FvwmWinListAction Click3 Module "FvwmIdent" FvwmIdent
*FvwmWinListUseSkipList
*FvwmWinListGeometry +0-1

The first three lines specify the background color, foreground color, and text font used for the application. The next three define the actions that first, second, and third mouse button clicks invoke when they occur within the WinList. UseSkipList tells the WinList not to list any windows that are assigned the Style classification WindowListSkip elsewhere in the configuration file. (Generally all module windows are classified thus and do not appear in the WinList.) The final line specifies the location at which the window should appear (bottom left corner).

The WinList is also a sticky window; it appears on every page on every desktop. But the configuration file can be confusing. This characteristic is specified elsewhere in the file, using the Style option:

Style "Fvwm*"       NoTitle, Sticky, WindowListSkip

This line specifies that all modules (including the WinList) have no titlebars, are sticky, and do not appear on the WinList. In the case of the FvwmWinList module, having it appear as an entry on itself would be more than a little confusing.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.