NAME

X11::Protocol::WM -- window manager things for client programs

SYNOPSIS

use X11::Protocol::WM;

DESCRIPTION

This is some window manager related functions for use by client programs. There's a lot a client can get or set, but only a few here yet.

FUNCTIONS

WM Hints

X11::Protocol::WM::set_wm_hints ($X, $window, key=>value, ...)

Set the WM_HINTS property on $window (an XID). For example,

X11::Protocol::WM::set_wm_hints
    ($X, $my_window,
     input         => 1,
     initial_state => 'NormalState',
     icon_pixmap   => $my_pixmap);

The key/value parameters are as follows.

input             integer 0 or 1
initial_state     enum string or number
icon_pixmap       pixmap XID (integer), depth 1
icon_window       window XID (integer)
icon_x            integer coordinate
icon_y            integer coordinate
icon_mask         pixmap XID (integer)
window_group      window XID (integer)
urgency           boolean

input should be 1 if the client wants the window manager to give $window the keyboard input focus using SetInputFocus (or if you ask for WM_TAKE_FOCUS in WM_PROTOCOLS then with a ClientMessage instead). input should be 0 if the window manager should not give the focus, either because $window is output-only, or if you put WM_TAKE_FOCUS in WM_PROTOCOLS then because the client will SetInputFocus to itself on a suitable button press etc.

initial_state can be a string or number. "NormalState" or "IconicState" are allowed by the ICCCM as a desired initial state.

NormalState       1
IconicState       3

icon_pixmap should be a bitmap (depth 1). The window manager will choose suitable contrasting colours. $icon_window can be used for a multi-colour icon, either with a suitable background or drawn on-demand (Expose events etc). The window manager might set a WM_ICON_SIZE property on the root window for good icon sizes but there's nothing in this module to retrieve that yet.

urgency true means the window is important and the window manager should draw the user's attention to it in some way. The client can change this at any time to reflect current importance.

WM Transient For

X11::Protocol::WM::set_wm_transient_for ($X, $window, $transient_for)

Set the WM_TRANSIENT_FOR property on $window (an XID). $transient_for is another window XID, or undef if $window is not transient for anything.

"Transient for" means $window is some sort of dialog or menu related to the $transient_for window. The window manager will generally iconify $window together with its $transient_for, etc.

Net WM Window Type

X11::Protocol::WM::set_net_wm_window_type ($X, $window, $window_type)

Set the _NET_WM_WINDOW_TYPE property on $window (an XID). $window_type can be a type string as follows from the EWMH,

NORMAL
DIALOG
DESKTOP
DOCK
TOOLBAR
MENU
UTILITY
SPLASH

$window_type can also be an integer atom such as $X->atom('_NET_WM_WINDOW_TYPE_DIALOG').

EXPORTS

Nothing is exported by default, but the functions can be requested in usual Exporter style,

use X11::Protocol::WM 'set_wm_hints';
set_wm_hints ($X, $window, input => 1, ...);

Or just called with full package name

use X11::Protocol::WM;
X11::Protocol::WM::set_wm_hints ($X, $window, input => 1, ...);

There's no :all tag since this module is meant as a grab-bag of functions and to import as-yet unknown things would be asking for name clashes.

SEE ALSO

X11::Protocol, X11::Protocol::Other

HOME PAGE

http://user42.tuxfamily.org/x11-protocol-other/index.html

LICENSE

Copyright 2011 Kevin Ryde

X11-Protocol-Other is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

X11-Protocol-Other is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with X11-Protocol-Other. If not, see <http://www.gnu.org/licenses/>.