home " subscribe " advertise " customer service " back issues " " contacts

 
Sections
  Newbies
  Reviews
  How To
    Best Defense
    Guru Guidance
    On The Desktop
  Developer's Den
    Gearheads Only
    Compile Time
    Perl of Wisdom
  Who's Who
 
Indexes
  Issue Archive
  Author Index
 
Linux Magazine
  Subscribe
  Advertise
  Customer Service
  Back Issues
  
  Contacts
 
On Stands Now Click to view Table of Contents for Linux Magazine March 2000 Issue
Newsletter
  Enter email address:
   
Subscribe to Linux Magazine

Linux Magazine / August 1999 / FEATURES
Multiple Choice
 
<< prev   page 01 02 03   next >>

X Clients

As I've already mentioned, X clients are applications that communicate with the X server. When any application that requires graphics starts up, it immediately establishes a connection with the X server and tells it what windows should be created to support it. It tells the X server what size and shape they should be, and what they should display. The client also informs the X server what events (mouse-clicks or keystrokes, for example) it wants to know about.

Though they are not common, there are some X clients that don't create any windows at all. For example, the program xdpyinfo simply provides a command-line printout of the capabilities of the X server it's talking to.

Following the client's instructions, the X server tells the client when a relevant event occurs. A wide variety of things can qualify as events. One can occur when a window gets moved, if a key is pressed, if the mouse gets moved, or if a window gets dismissed. It's up to the person who writes the client application to define which events the client cares about. Some clients -- for example a program that displays a clock on the screen -- may not care about keystrokes. But the clock program may well care to know when another window has been placed over top of it. That way it could suspend itself until it heard from the X server that it was visible again (another event).

Toolkits

While every X client uses a library of functions known as Xlib to communicate with the X server, most don't directly call the functions in Xlib. To draw a simple 3D button using Xlib directly, a client must draw a couple of rectangular windows, shade them to give the appearance of beveled edges, monitor mouse events, be able change the button's appearance if it gets pressed, and so on.

To make this job easier, there are additional libraries of functions, known as toolkits, that include oft-used combinations of the Xlib functions. These combinations are called widgets. A developer can pluck a widget from one of these toolkits to, say, create a button that displays "Okay" when pressed. The toolkit takes care of all the little Xlib details.

In addition to simplifying the work of the programmer, toolkits give applications consistency. Applications made from the same toolkit simply look like they belong together. By tweaking the individual toolkit widgets, developers can change the look and feel of all the applications that use that particular toolkit. Some popular toolkits include Qt, GTK+, Motif, XForms, Tk, and XView.

Widget sets are not normally inter-changeable because they usually have different interfaces to the programs that use them. However, sometimes it is possible to replace a widget set.

You can do this with Xaw, the Athena Widget Set. The original Xaw widget set has a simplistic 2D look, but its later developers have created new widget sets for Xaw that look different from the original. These usually retain its programming interface. So if you want, it's possible to put a replacement Xaw library on your system and still have all your Xaw applications run. They'll look different, but with the same programming interfaces, everything will still work.

The first of these modified Xaw widget sets, Xaw3d, takes the standard Xaw look and makes it three dimensional. Other Xaw replacements attempt to simulate the look of other windowing systems. Xaw95 looks like the widgets in Windows 95 and neXtaw looks like those of NeXTSTEP.

Windowman Variations
Variations On A Theme: These images show just how customizable the look can be with some window managers. In all of these images, the window manager is kwm, with different themes loaded. Note that these are screen captures of rectangular regions, but not all of the window frames shown here are rectangular in shape. In the Leaf theme, for example, the frame is actually shaped like leaves, vines, and flowers. The dark background is merely the desktop background showing through.

The Window Manager

X's window managers do a lot of work. The layout of windows on your desktop is controlled by the window manager. Frames around the windows are drawn by the window manager. The particular icon a window can take when shrunk depends on the window manager. Some window managers let you switch between multiple desktops. Some provide a virtual desktop. If you want to change the size of a window, you need to talk with the window manager. In short, the whole look and feel of your computer is completely influenced by your window manager.

So which window manager is best for you? Maybe you'd like one that feels like Windows 98 or the Macintosh? Perhaps you have an older system and want to use as little memory as possible? Maybe you're looking for a compact window manager for your notebook? Ease of configuration may be your top priority. Or perhaps you work with different systems from different vendors and would like a consistent look and feel when you switch between them? In the rest of this article, I'll outline the five major categories of window managers, as I see them, and tell you about all of the most common choices. Ultimately you'll want to try on a window manager or two for size before you decide which is best for you.

The Tab Window Managers

Tab window managers get their name from the way they can configure their title bars to only extend part way along the top of the window. This creates a look reminiscent of a file folder tab.

twm: The only window manager actually distributed with X is the Tab Window Manager. This window manager has a plain appearance by today's standards, but it was advanced for its time. It allows you to configure title bars, and supports shaped windows and selectable focus policies (see the Glossary at right for an explanation of focus policies and other window manager terminology). You can configure the title bar buttons and menus to execute macros of your choice. Twm was the starting point for several other window managers, but it has not been developed recently.

vtwm:This twm derivative adds a virtual desktop. Recently, it has added a 3D option to its window frames and title bars; it supports color pixmaps for the title bar buttons and icons.

ctwm:With a 3D appearance and animated icons and title-bar buttons, ctwm adds some flash to twm's plain look. It also supports multiple desktops, each with their own look and pinnable menus.

The Bottom Line

Window Manager Glossary

Focus Policies

Focus policies determine where your keystrokes go. If you are using a focus-follows-mouse policy, then your keystrokes will always be sent to whatever window the mouse cursor is currently pointing to. With a click-to-focus or click-to-type policy, you need to actually click on the window in question before you can type inside it.

Virtual Desktops

Virtual desktops (sometimes called virtual screens) allow you to pretend you've got more screen real estate than you really do. A virtual desktop pretends that your screen is only a small corner of a much larger "virtual" desktop. This comes in handy when you have more windows than you can fit on your screen. Instead of opening windows on top of each other, you can move them to the right or the left or above or below your display. You don't see them on your monitor, but you can use a small navigation tool to move your display to whatever part of the virtual desktop you choose.

Multiple Desktops

Window managers that support multiple desktops let you switch from one screen display to another as if you were switching computers. Windows that appear on one desktop, disappear when you move to another, only to reappear when you switch back. Usually, each desktop can have a different background.

X Pixmap

Early window managers used only one color for the foreground and a second for things like title bars and icons. But modern window managers let you have multicolored icons, using a format called X Pixmap. This is called XPM (X Pixmap) support. Some window managers support other graphics file formats too.

Shape

X originally supported only rectangular windows. Eventually it was extended so that windows could take any shape. Window managers with Shape break through the rectangular-only restriction.

Pinnable Menus

Menus normally disappear from the screen once you have made your selection. Some window managers let you "pin" menus so they stay on the screen. This can make things easier if you need to choose many options from the same menu.

Hints

Hints are instructions for the window manager that client applications can attach to their windows. They let the client tell the window manager things like "this window should not be resized" or "please do not place a title bar above this window". Exactly what messages are recognized varies between window managers. Often you can configure the window manager with values that override the hints the client supplies. Open Look, Motif, GNOME, and KDE all support hints.

Configuration

Configuration methods vary between window managers. Most have one or more configuration files that can be edited to change the window manager's look or behavior. Others are configured interactively with a GUI configuration tool. Almost any modern window manager will have some sort of configuration tool, whether it comes with the window manager itself or from a third party.

Themes

By changing themes, you can alter the look of things like title bars, menus, or the background all in keeping with a particular style. See the themes.org Web site for sample screen shots and all the info you need to use themes on your desktop.


<< prev   page 01 02 03   next >>
 
Linux Magazine / August 1999 / FEATURES
Multiple Choice

home " subscribe " advertise " customer service " back issues " " contacts