4 The so-called ``winprops''\index{Winprops} can be used to change how
5 specific windows are handled and to set up some kludges to deal with
6 badly behaving applications. They are defined by calling the function
7 \code{defwinprop} with a table containing the properties to set and the
8 necessary information to identify a window. The currently supported
9 winprops are listed below, and the subsequent subsections explain the
10 usual method of identifying windows, and how to obtain this information.
14 %\docode % latex2html kludge
16 %\caption{Supported winprops}
19 \newenvironment{winprop}[2]{
21 % Sigh. (La)TeX is a mess.
25 % @\expandafter\var{#2}}
26 \item[Winprop:] \var{#1} (#2)
34 \begin{winprop}{acrobatic}{boolean}
35 \index{acrobatic@\var{acrobatic}}
36 Set this to \code{true} for Acrobat Reader. It has an annoying
37 habit of trying to manage its dialogs instead of setting them as
38 transients and letting the window manager do its job, causing
39 Ion and acrobat go a window-switching loop when a dialog is
44 \begin{winprop}{float}{boolean}
45 \index{float@\var{float}}
46 Set this to open the window in a floating frame, when
51 \begin{winprop}{fullscreen}{boolean}
52 \index{fullscreen@\var{fullscreen}}
53 Should the window be initially in full screen mode?
57 \begin{winprop}{ignore_cfgrq}{boolean}
58 \index{ignore-cfgrq@\var{ignore_cfgrq}}
59 Should configure requests on the window be ignored?
60 Only has effect on floating windows.
64 \begin{winprop}{ignore_net_active_window}{boolean}
65 \index{ignore-net-active-window@\var{ignore_net_active_window}}
66 Ignore extended WM hints \code{_NET_ACTIVE_WINDOW} request.
70 \begin{winprop}{jumpto}{boolean}
71 \index{jumpto@\var{jumpto}}
72 Should a newly created client window always be made
73 active, even if the allocated frame isn't.
77 \begin{winprop}{new_group}{string}
78 \index{new-group@\var{new_group}}
79 If the region specified by \code{target} winprop does not exist
80 (or that winprop is not set), create a new workspace using the
81 previously stored layout (see \fnref{ioncore.deflayout}) named by
82 this property. After creating the workspace, \code{target} is
83 attempted to be found again. (If that still fails, the newly
84 created workspace is still asked to manage the client window.)
88 \begin{winprop}{oneshot}{boolean}
89 \index{oneshot@\var{oneshot}}
90 Discard this winprop after first use.
94 \begin{winprop}{statusbar}{string}
95 \index{statusbar@\var{statusbar}}
96 Put the window in the statusbar, in the named tray component,
97 (The default tray component is called simply \codestr{systray},
98 and others you give names to in your custom template, always
99 prefixed by \codestr{systray\_}.
103 \begin{winprop}{switchto}{boolean}
104 \index{switchto@\var{switchto}}
105 Should a newly mapped client window be switched to within
110 \begin{winprop}{target}{string}
111 \index{target@\var{target}}
112 The name of an object (workspace, frame) that should manage
113 windows of this type. See also \code{new_group}.
117 \begin{winprop}{transient_mode}{string}
118 \index{transient-mode@\var{transient_mode}}
119 \codestr{normal}: No change in behaviour. \codestr{current}:
120 The window should be thought of as a transient for the current
121 active client window (if any) even if it is not marked as a
122 transient by the application. \codestr{off}: The window should
123 be handled as a normal window even if it is marked as a
124 transient by the application.
128 \begin{winprop}{transparent}{boolean}
129 \index{transparent@\var{transparent}}
130 Should frames be made transparent when this window is selected? \\
134 \subsection{Sizehint winprops}
136 Additionally, the winprops
137 \code{max_size}\index{max-size@\var{max_size}},
138 \code{min_size}\index{min-size@\var{min_size}},
139 \code{aspect}\index{aspect@\var{aspect}},
140 \code{resizeinc}\index{aspect@\var{resizeinc}},
142 \code{ignore_max_size}\index{ignore-max-size@\var{ignore_max_size}},
143 \code{ignore_min_size}\index{ignore-min-size@\var{ignore_min_size}},
144 \code{ignore_aspect}\index{ignore-aspect@\var{ignore_aspect}},
145 \code{ignore_resizeinc}\index{ignore-aspect@\var{ignore_resizeinc}},
146 may be used to override application-supplied size hints. The four
147 first ones are tables with the fields \var{w} and \var{h}, indicating
148 the width and height size hints in pixels, and the latter ignore
149 winprop is a boolean.
152 \code{userpos}\index{userpos@\var{userpos}} option may be used to
153 override the \code{USPosition} flag of the size hints. Normally,
154 when this flag is set, Ion tries to respect the supplied window
155 position more than when it is not set. Obviously, this makes sense
156 only for floating windows.
159 \subsection{Classes, roles and instances}
160 \label{sec:classesrolesinstances}
162 The identification information supported are
163 \var{class}\index{class@\var{class}!winprop},
164 \var{role}\index{role@\var{role}!winprop},
165 \var{instance}\index{instance@\var{instance}!winprop},
166 \var{name}\index{name@\var{name}!winprop},
167 \var{is_transient}\index{is-transient@\var{is_transient}!winprop}, and
168 \var{is_dockapp}\index{is-dockapp@\var{is_dockapp}!winprop}.
169 It is not necessary to specify all of these fields.
170 The first three are strings, and must exactly match the
171 corresponding information obtained from the window's properties.
172 The \var{name} field is a Lua-style regular expression matched against
173 the window's title. The \var{is_transient} field is a boolean that can
174 be used to include or exclude transients only, while the \var{is_dockapp}
175 field is set by Ion for the dock windows of Window Maker dockapp protocol
176 dockapps. Usually this is the only information available for these
179 Ion looks for a matching winprop in the order listed by the following
180 table. An 'E' indicates that the field must be set in the winprop
181 and it must match the window's corresponding property exactly or, in
182 case of \var{name}, the regular expression must match the window
183 title. An asterisk '*' indicates that a winprop where the field is
184 not specified (or is itself an asterisk in case of the first three
188 \begin{tabular}{llll}
189 \tabhead{\var{class} & \var{role} & \var{instance} & other}
197 \vdots & \vdots & \vdots & etc. \\
201 If there are multiple matching winprops with the same
202 \var{class}, \var{role} and \var{instance}, but other information
203 different, the most recently defined one is used.
206 \subsection{Finding window identification}
208 The 'Window info' context menu entry (\key{Mod1+M} or \key{Button3} on a tab)
209 can be used to list the identification information required to set winprops
210 for a window and all the transient windows managed within it.
213 Another way to get the identification information is to use \command{xprop}.
214 Simply run To get class and instance, simply run \command{xprop WM_CLASS}
215 and click on the particular window of interest. The class is the latter of
216 the strings while the instance is the former. To get the role -- few
217 windows have this property -- use the command \command{xprop WM_ROLE}.
218 This method, however, will not work on transients.
221 So-called ``transient windows'' are usually short-lived dialogs (although
222 some programs abuse this property) that have a parent window that they are
223 ``transient for''. On tiled workspaces Ion displays these windows
224 simultaneously with the parent window at the bottom of the same frame.
225 Unfortunately \command{xprop} is stupid and can't cope with this situation,
226 returning the parent window's properties when the transient is clicked on.
227 For this reason you'll have to do a little extra work to get the properties
228 for that window.\footnote{There's a patch to \command{xprop} to
229 fix this, but nothing seems to be happening with respect to including it in
232 Finally, it should be mentioned that too many authors these days
233 ``forget'' to set this vital identification to anything meaningful:
234 everything except name is the same for all of the program's
235 windows, for example. Some other programs only set this information
236 after the window has been mapped, i.e. the window manager has been
237 told to start managing it, which is obviously too late.
238 Gtk applications in particular are often guilty on both counts.
241 \subsection{Some common examples}
243 \subsubsection{Acrobat Reader}
245 The following is absolutely necessary for Acrobat reader:
250 instance = "documentShell",
255 \subsubsection{Forcing newly created windows in named frames}
257 The following winprop should place xterm started with command-line parameter
258 \mbox{\code{-name sysmon}} and running a system monitoring program in a
264 target = "sysmonframe",
268 For this example to work, we have to somehow create a frame named
269 \codestr{sysmonframe}. One way to do this is to make the following
270 call in the \key{Mod1+F3} Lua code query:
273 mod_query.query_renameframe(_)
276 Recall that \code{_} points to the multiplexer (frame or screen) in which
277 the query was opened. Running this code should open a new query prefilled
278 with the current name of the frame. In our example we would change the
279 name to \codestr{sysmonframe}, but we could just as well have used the
280 default name formed from the frame's class name and an instance number.