Common Desktop Environment: Style Guide and Certification Checklist

Chapter 5 Window and Session Control

Your application is presented to the user as a series of windows. Some of these windows present the main portion of the application. Others are dynamic, only appearing to the user when needed to accomplish certain tasks. All of these windows should contain menus, border decorations, and behavior styles appropriate to their function. The following chapter describes the guidelines that should be applied when designing the windows in your application.

Window Control Guidelines

The specifics of the appropriate window borders and decorations are outlined in "Window Decorations", and the different window management behaviors are specified in "Window Management Actions".

The fundamental user-visible characteristic of primary windows is that stacking, workspace placement, and minimization can be independent of other primary windows. Secondary window stacking, workspace placement, and minimization must be tied to the associated primary window.

Required 

aa: 

Application windows should be clearly distinguishable as primary or secondary windows based on appearance and behavior. 

Window Management Actions

Required 

aq: 

Windows should follow Common Desktop Environment window management functionality conventions, as shown in Table 10-2. 

Primary windows should provide Close, Move, Lower, and Minimize as the minimum set of capabilities. They should allow Resize and Maximize as appropriate. Secondary windows should be designed so that resizing and maximizing are neither necessary nor appropriate. Most secondary windows should only include the Close, Move, and Lower capabilities. In extraordinary cases, a secondary window may provide the Resize and Maximize capabilities. Secondary windows do not provide Minimize capability - they are minimized with the associated primary window. 

Required 

as: 

Windows that have form factor constraints need to set Window Manager hints for minimum size, maximum size, aspect ratio, and resize increment as appropriate. 

Required 

at: 

Maximizing a window should show more content (objects or controls) if appropriate (as opposed to scaling up the sizes of objects and controls). 

Required 

au: 

Windows that have Close or Exit functionality need to support the window management protocol for Close if there is a window menu. In the case of dialog boxes, the Close item on the window menu corresponds to the Cancel functionality or dialog box dismissal with no further action taken. 

Window Decorations

Window decorations are the user-visible controls in the frame of an application window. The Figure 5-1shows some sample decorations typically associated with a primary window.

Required 

ab: 

Windows that support particular window management functionality must request the corresponding window decoration (for example, a window that can be minimized should request the minimize button). 

In addition, windows that support any window management functionality (move, resize, minimize, maximize, close, and others) must have a window menu with the appropriate items for that functionality. 

Figure 5-1 Example primary window decorations

Graphic

Required 

ad: 

Follow Common Desktop Environment window decoration conventions, as shown in Table 10-1. 

Primary windows should have the following window decorations: Border, Title, Menu, and Minimize. If appropriate, primary windows should also include Maximize and Resize decorations.

Secondary windows should be designed so that resizing and maximizing are neither necessary nor appropriate. Most secondary windows should only include the Border, Title, and Menu decorations. If your secondary window allows resizing or maximizing, however, it must also include the appropriate decoration. The Figure 5-2shows a typical secondary window decoration.

Figure 5-2 Example secondary window decorations

Graphic

Window Menus

Windows have a menu that allows the user to perform various operations that affect the size and placement of the application window. Developers should use the following standard window menu items in their applications.

Required 

ae: 

Follow Common Desktop Environment window menu conventions. Items should appear in the window menu if they are applicable to the window or its minimized window icon. 

Figure 5-3 Sample window menu

Graphic

The following items are valid English-language choices in the window menu (the mnemonics for each choice are listed in parentheses). They should be added to the menu in the order listed. Unless otherwise noted, the functionality of these menu items is as described in the OSF/Motif Style Guide, Revision 1.2.

Recommended 

at: 

Applications should not add items to the window menu. If an extraordinary requirement has an application add items to the window menu, the items should be appended to the end of the menu with a separator between Close and the application items. 

Optional 

ag: 

Accelerators, aside from Alt+F4 for Close, should not be used in the window menu (to minimize conflict with other uses of the Alt key for application accelerators, localization, and others). 

Window Icons

Applications should use icons to represent themselves to the user when minimized on the desktop.

Optional 

ah: 

Applications should provide unique window icons for their primary windows. The window icon image should have a similar appearance to the associated file or Front Panel icon image. 

Optional 

ai: 

The window icon label should contain the same text as the title of the corresponding primary window, or an abbreviated form of it. Refer to "Layout" on page 240 for window title guidelines. 

Optional 

aj: 

The window icon image should have a similar appearance to the associated file or Front Panel icon image. Refer to "Design Philosophy and Helpful Hints" on page 50. 

Window Placement

Window positioning should be left to the Window Manager or to user control.

Recommended 

ak: 

Applications should not require or force windows or window icons to be positioned at a particular screen location. 

Recommended 

al: 

A secondary window is placed by the application relative to the associated primary window. It should be placed close to, but not obscuring, the component that caused it to be displayed and the information that is necessary to interact with the dialog box. 

Recommended 

an: 

If a secondary window is allowed to be stacked below its associated primary window (not constrained to stay on top of the primary window), it should be placed such that it is not completely covered by the primary window. This recommendation takes precedence over other placement recommendations. 

Recommended 

ao: 

If a menu or dialog box is already on display, reinvoking the command that caused it to be displayed automatically brings that window or menu to the front of the window stack without changing its position on the screen. 

Workspace Management Guidelines

Desktop applications appear in one of several work areas called workspaces. A user may have several workspaces active on the desktop. The application should behave in certain ways in relation to those workspaces.

Recommended 

av: 

When your application creates a new window, it should come up in the user's current workspace and only occupy that single workspace. 

Recommended 

aw: 

Application windows that are related to a particular task should move together between workspaces. 

For example, a spreadsheet application may have one or more secondary windows open that allow the user to change the properties of data cells in the main window. If the user moves the main window to a different workspace, the properties windows should move with it.

On the other hand, a word processor may have several windows open, where each is used to edit a different document. In this case, when a user moves one of the windows to a different workspace, the other windows may remain where they are.

Session Management Support

When you design a desktop application, you must consider the following guidelines for session management.

Required 

ax: 

Applications should support Interclient Communications Conventions Manual (ICCCM) mechanisms for session management of their primary windows and key properties. 

The ICCCM defines important relationships and behaviors between applications and the window manager, including protocols for saving and restoring application state across invocations. 

Required 

ay: 

Applications should support ICCCM mechanisms for session management of all associated windows (that is, secondary windows that may include help windows). 

Associated windows include multiple primary windows and secondary windows, such as online help windows. 

Optional 

az: 

Applications should accept messages from the Common Desktop Environment Session Manager that inform them the user is logging out and should save their state at that time. 

Optional 

ba: 

Applications that have a single primary window that is open at the time the user logs out should restore the primary window, in the workspace last occupied, when the user logs in again. 

Optional 

bb: 

Save user context wherever possible. For example, applications that support the editing of files should save the state of the file at logout and should restore the file in the application window when users log in again. 

Optional 

bc: 

Applications that have multiple primary windows that are open at the time the user logs out should restore all primary windows, in their respective workspaces, when the user logs in again.