NAME
WMShell widget class − fundamental shell widget class that interacts with an ICCCM-compliant window manager.
SYNOPSIS
Public Headers:<X11/StringDefs.h>
<X11/Shell.h>
Private Header:<X11/ShellP.h>
Class Name:WMShell
Class Hierarchy:Core → Composite → Shell → WMShell
Class Pointer:wmShellWidgetClass
Instantiation:WMShell is an Intrinsics meta-class, and is not normally instantiated.
Functions/Macros:XtIsWMShell()
DESCRIPTION
WMShell is a direct subclass of Shell that provides basic window manager interaction. It should not be instantiated itself; its subclasses TransientShell, TopLevelShell, and ApplicationShell provide additional functionality suitable for particular types of top-level windows.
NEW RESOURCES
WMShell defines the following resources:
| Name | Class | Type | Default | Access |
| XtNbaseHeight | XtCBaseHeight | int | XtUnspecifiedShellInt | CSG |
| XtNbaseWidth | XtCBaseWidth | int | XtUnspecifiedShellInt | CSG |
| XtNheightInc | XtCHeightInc | int | XtUnspecifiedShellInt | CSG |
| XtNiconMask | XtCIconMask | Pixmap | NULL | CSG |
| XtNiconPixmap | XtCIconPixmap | Pixmap | NULL | CSG |
| XtNiconWindow | XtCIconWindow | Window | NULL | CSG |
| XtNiconX | XtCIconX | int | −1 | CSG |
| XtNiconY | XtCIconY | int | −1 | CSG |
| XtNinitialState | XtCInitialState | int | NormalState | CSG |
| XtNinput | XtCInput | Boolean | False | CSG |
| XtNmaxAspectX | XtCMaxAspectX | int | XtUnspecifiedShellInt | CSG |
| XtNmaxAspectY | XtCMaxAspectY | int | XtUnspecifiedShellInt | CSG |
| XtNmaxHeight | XtCMaxHeight | int | XtUnspecifiedShellInt | CSG |
| XtNmaxWidth | XtCMaxWidth | int | XtUnspecifiedShellInt | CSG |
| XtNminAspectX | XtCMinAspectX | int | XtUnspecifiedShellInt | CSG |
| XtNminAspectY | XtCMinAspectY | int | XtUnspecifiedShellInt | CSG |
| XtNminHeight | XtCMinHeight | int | XtUnspecifiedShellInt | CSG |
| XtNminWidth | XtCMinWidth | int | XtUnspecifiedShellInt | CSG |
| XtNtitle | XtCTitle | String | dynamic | CSG |
| XtNtitleEncoding | XtCTitleEncoding | Atom | XA_STRING | CSG |
| XtNtransient | XtCTransient | Boolean | False | CSG |
| XtNwaitForWm | XtCWaitForWm | Boolean | True | CSG |
| XtNwidthInc | XtCWidthInc | int | XtUnspecifiedShellInt | CSG |
| XtNwindowGroup | XtCWindowGroup | Window | dynamic | CSG |
| XtNwinGravity | XtCWinGravity | int | dynamic | CSG |
| XtNwmTimeout | XtCWmTimeout | int | 5000 ms | CSG |
Many of these resources are hints to the window manager which can be set with the Xlib function XSetWMProperties(). The default value for these resources is XtUnspecifiedShellInt for integer resources, or None for the pixmaps and windows. If any of these resources is not changed from its default value, then WMShell will not set the corresponding flag bit in the hints structure when it sets the appropriate properties, and that particular hint will be unspecified. See the Shell XtNgeometry resource for more information on size hints for a shell widget. See XSetWMProperties() and the ICCCM for more information on the window properties that are used to convey hints to window managers.
XtNbaseHeight
XtNbaseWidth
The base dimensions from which the preferred height and width can be stepped up or down (as specified by XtNheightInc or XtNwidthInc).
XtNheightInc
The step size by which the widget’s height may be adjusted. An application that displays lines of text might set this to the font height, so that it can always display a whole number of lines. The base height is XtNbaseHeight, and the height can decrement to the value of XtNminHeight or increment to the value of XtNmaxHeight. See also XtNwidthInc.
XtNiconMask
A bitmap that the window manager can use in order to clip the application’s icon into a nonrectangular shape.
XtNiconPixmap
A pixmap that the window manager is requested to display as the application’s icon.
XtNiconWindow
The ID of a window that the window manager is requested to use as the application’s icon. The application is responsible for drawing in this window and handling Expose events on it.
XtNiconX
XtNiconY
Window manager hints for the initial root window coordinates of the application’s icon.
XtNinitialState
The initial appearance of the widget instance. Possible values are defined in <X11/Xutil.h>: NormalState /∗ application starts as a window ∗/ IconicState /∗ application starts as an icon ∗/
XtNinput
A Boolean that, in conjunction with the WM_TAKE_FOCUS atom in the WM_PROTOCOLS property, determines the application’s keyboard focus model. The result is determined by the value of XtNinput and the existence of the atom, as described below:
| Value of | WM_TAKE_FOCUS | Keyboard Focus |
| XtNinput Resource | Atom | Model |
| False | Does not exist. | No input allowed. |
| True | Does not exist. | Passive. |
| True | Exists. | Locally active. |
| False | Exists. | Globally active. |
See the Inter-Client Communications Conventions Manual, Section 4.1.17 (in Appendix L of Volume Zero), for more information on these models of keyboard focus.
XtNmaxAspectX
XtNmaxAspectY
The numerator and denominator, respectively, of the maximum aspect ratio requested for this widget.
XtNmaxHeight
XtNmaxWidth
The maximum dimensions for the widget’s preferred height or width.
XtNminAspectX
XtNminAspectY
The numerator and denominator, respectively, of the minimum aspect ratio requested for this widget.
XtNminHeight
XtNminWidth
The minimum dimensions for the widget’s preferred height or width.
XtNtitle
The string that the window manager displays as the application’s name. The default is the icon name, or if that isn’t specified, the name of the application.
XtNtitleEncoding
An Atom which specifies the encoding of the XtNtitle resource.
XtNtransient
If True, this indicates a popup window or some other transient widget which should have its WM_TRANSIENT_FOR property set (see the XtNwindowGroup resource below, and also the XtNtransientFor resource of the TransientShell class). Different window managers will interpret this property differently, and may provide fewer decorations (no iconify button, for example) than they would for a non-transient window.
XtNwaitForWm
If True (default), the shell waits for a response from the window manager before changing the size of a widget. The timeout interval is specified by the XtNwmTimeout resource. If the window manager does not respond within this time, this resource will be set to False, though it may be reset to its original value later. When this resource is False, the shell relies on asynchronous notification from the window manager and does not wait for a response.
XtNwidthInc
The step size by which the widget’s width may be adjusted. The base width is XtNbaseWidth, and the width can decrement to the value of XtNminWidth or increment to the value of XtNmaxWidth. See also XtNheightInc.
XtNwindowGroup
This is a hint to the window manager that this shell is associated with the main window or "group leader" window specified by this resource. Some window managers may allow groups of related windows to be manipulated together. If the shell widget is not the root of the widget hierarchy, then WMShell sets the default value of this resource to the window ID of the root widget if that widget is realized. This resource can be set to the special value XtUnspecifiedWindowGroup to indicate that the window group hint should not be set. If XtNtransient is True, and if the shell is not a subclass of TransientShell, and if this resource is not XtUnspecifiedWindowGroup, then it will be set as the value of the WM_TRANSIENT_FOR property. See also the XtNtransientFor resource of the TransientShell class.
XtNwinGravity
The window gravity used in positioning the widget. Unless an initial value is given, this resource will be set when the widget is realized. The default value is NorthWestGravity (if the Shell resource XtNgeometry is NULL); otherwise, XtNwinGravity assumes the value returned by the XWMGeometry() routine.
XtNwmTimeout
The number of milliseconds that the X Toolkit waits for a response from the window manager. This resource is meaningful when the XtNwaitForWm resource is set to True. If the window manager does not respond to a geometry request within this time, the shell assumes that the window manager is not functioning properly and sets XtNwaitForWm to False.
INHERITED RESOURCES
WMShell inherits the following resources. The resources are listed alphabetically, along with the superclass that defines them.
| Resource | Inherited From | Resource | Inherited From |
| XtNaccelerators | Core | XtNinitialResources- | Core |
| Persistent | |||
| XtNallowShellResize | Shell | XtNinsertPosition | Composite |
| XtNancestorSensitive | Core | XtNmappedWhenManaged | Core |
| XtNbackground | Core | XtNnumChildren | Composite |
| XtNbackgroundPixmap | Core | XtNoverrideRedirect | Shell |
| XtNborderColor | Core | XtNpopdownCallback | Shell |
| XtNborderPixmap | Core | XtNpopupCallback | Shell |
| XtNborderWidth | Core | XtNsaveUnder | Shell |
| XtNchildren | Composite | XtNscreen | Core |
| XtNcolormap | Core | XtNsensitive | Core |
| XtNcreatePopupChild- | Shell | XtNtranslations | Core |
| Proc | |||
| XtNdepth | Core | XtNvisual | Shell |
| XtNdestroyCallback | Core | XtNwidth | Core |
| XtNgeometry | Shell | XtNx | Core |
| XtNheight | Core | XtNy | Core |
CLASS STRUCTURE
The WMShell class structure contains only an extension field: typedef struct { XtPointer extension; /∗ pointer to extension record ∗/ } WMShellClassPart;
typedef struct { CorePart core; CompositePart composite; ShellPart shell; WMShellPart wm; } WMShellRec, ∗WMShellWidget;
INSTANCE STRUCTURE
The WMShell instance structure contains at least the following fields (which need not be in this order): typedef struct { String title; int wm_timeout; Boolean wait_for_wm; Boolean transient; struct _OldXSizeHints { long flags; int x, y; int width, height; int min_width, min_height; int max_width, max_height; int width_inc, height_inc; struct { int x; int y; } min_aspect, max_aspect; } size_hints; XWMHints wm_hints; int base_width, base_height, win_gravity; Atom title_encoding; } WMShellPart;
typedef struct { CorePart core; CompositePart composite; ShellPart shell; WMShellPart wm; } WMShellRec, ∗WMShellWidget; The XWMHints type is defined (in <X11/Xutil.h>) as follows: typedef struct { long flags; /∗ marks which fields in this structure are defined ∗/ Bool input; /∗ does this application rely on the window manager to get keyboard input? ∗/ int initial_state; /∗ see below ∗/ Pixmap icon_pixmap; /∗ pixmap to be used as icon ∗/ Window icon_window; /∗ window to be used as icon ∗/ int icon_x, icon_y; /∗ initial position of icon ∗/ Pixmap icon_mask; /∗ icon mask bitmap ∗/ XID window_group; /∗ id of related window group ∗/ /∗ this structure may be extended in the future ∗/ } XWMHints;
SEE ALSO
ShellUNIX SYSTEM V/68 and V/88 Release 4.