[go: up one dir, main page]

Menu

[12172e]: / src / WinMgr.h  Maximize  Restore  History

Download this file

309 lines (279 with data), 11.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
#ifndef __WINMGR_H
#define __WINMGR_H
/* all of this is still experimental -- feedback welcome */
/* 0.5
* - added WIN_LAYER_MENU
*/
/* 0.4
* - added WIN_WORKSPACES for windows appearing on multiple workspaces
* at the same time.
* - added WinStateDocked
* - added WinStateSticky for possible virtual desktops
* - changed WIN_ICONS format to be extensible and more complete
*/
/* 0.3
* - renamed WinStateSticky -> WinStateAllWorkspaces
*/
/* 0.2
* - added separate flags for horizonal/vertical maximized state
*/
/* 0.1 */
/* TODO:
* - packed properties for STATE and HINTS (WIN_ALL_STATE and WIN_ALL_HINTS)
* currently planned to look like this:
* CARD32 nhints
* for each hint:
* CARD32 atom (hint type)
* CARD32 count (data length)
* CARD32 data[count]
* ...
* this has the advantage of being slightly faster, but
* demands that all hints are handled at one place. WM ignores
* other hints of the same type if these two are present.
* - check out WMaker and KDE hints to make a superset of all
* - virtual desktop, handling of virtual (>screen) scrolling
* desktops and pages (fvwm like?)
* - vroot.h?
* - MOZILLA_ZORDER (it should be possible to do the same thing
* with WIN_* hints)
* - there should be a way to coordinate corner/edge points of the frames
* (for placement). ICCCM is vague on this issue. icewm prefers to treat
* windows as client-area and titlebar when doing the placement (ignoring
* the frame)
* - hint limit wm key/mouse bindings on a window
* possible
* - what does MOTIF_WM_INFO do?
* - WIN_MAXIMIZED_GEOMETRY
* - WIN_RESIZE (protocol that allows applications to start sizing the frame)
* - WIN_FOCUS (protocol for focusing a window)
*/
#define XA_WIN_PROTOCOLS "_WIN_PROTOCOLS"
/* Type: array of Atom
* set on Root window by the window manager.
*
* This property contains all of the protocols/hints supported by
* the window manager (WM_HINTS, MWM_HINTS, WIN_*, etc.
*/
#define XA_WIN_SUPPORTING_WM_CHECK "_WIN_SUPPORTING_WM_CHECK"
/* XID of window created by WM, used to check */
#define XA_WIN_ICONS "_WIN_ICONS"
/* Type: array of CARD32
* first item is icon count (n)
* second item is icon record length (in CARD32s)
* this is followed by (n) icon records as follows
* pixmap (XID)
* mask (XID)
* width (CARD32)
* height (CARD32)
* depth (of pixmap, mask is assumed to be of depth 1) (CARD32)
* drawable (screen root drawable of pixmap) (XID)
* ... additional fields can be added at the end of this list
*
* This property contains additional icons for the application.
* if this property is set, the WM will ignore default X icon hints
* and KWM_WIN_ICON hint.
*
* Icon Mask can be None if transparency is not required.
*
* Icewm currenty needs/uses icons of size 16x16 and 32x32 with default
* depth. Applications are recommended to set several icons sizes
* (recommended 16x16,32x32,48x48 at least)
*
* TODO: WM should present a wishlist of desired icons somehow. (standard
* WM_ICON_SIZES property is only a partial solution). 16x16 icons can be
* quite small on large resolutions.
*/
/* workspace */
#define XA_WIN_WORKSPACE "_WIN_WORKSPACE"
/* Type: CARD32
* Root Window: current workspace, set by the window manager
*
* Application Window: current workspace. The default workspace
* can be set by applications, but they must use ClientMessages to
* change them. When window is mapped, the propery should only be
* updated by the window manager.
*
* Applications wanting to change the current workspace should send
* a ClientMessage to the Root window like this:
* xev.type = ClientMessage;
* xev.window = root_window or toplevel_window;
* xev.message_type = _XA_WIN_WORKSPACE;
* xev.format = 32;
* xev.data.l[0] = workspace;
* xev.data.l[1] = timeStamp;
* XSendEvent(display, root, False, SubstructureNotifyMask, (XEvent *) &xev);
*
*/
#define XA_WIN_WORKSPACE_COUNT "_WIN_WORKSPACE_COUNT"
/* Type: CARD32
* workspace count, set by window manager
*
* NOT FINALIZED/IMPLEMENTED YET
*/
#define XA_WIN_WORKSPACE_NAMES "_WIN_WORKSPACE_NAMES"
/* Type: StringList (TextPropery)
*
*
* IMPLEMENTED but not FINALIZED.
* perhaps the name should be separate for each workspace (like KDE).
* this where WIN_WORKSPACE_COUNT comes into play.
*/
#define WinWorkspaceInvalid 0xFFFFFFFFL
/* workspaces */
#define XA_WIN_WORKSPACES "_WIN_WORKSPACES"
/* Type: array of CARD32
* bitmask of workspaces that application appears on
*
* Applications must still set WIN_WORKPACE property to define
* the default window (if the WM has to switch workspaces) and
* specify the workspace for WMs that do not support this property.
*
* The same policy applies as for WIN_WORKSPACE: default can be set by
* applications, but is only changed by the window manager after the
* window is mapped.
*
* Applications wanting to change the current workspace should send
* a ClientMessage to the Root window like this:
* xev.type = ClientMessage;
* xev.window = root_window or toplevel_window;
* xev.message_type = _XA_WIN_WORKSPACES_ADD; // or _REMOVE
* xev.format = 32;
* xev.data.l[0] = index; // index of item
* xev.data.l[1] = bitmask; // to assign, or, or reset
* xev.data.l[2] = timestamp; // of event that caused operation
* XSendEvent(display, root, False, SubstructureNotifyMask, (XEvent *) &xev);
*/
#define XA_WIN_WORKSPACES_ADD "_WIN_WORKSPACES_ADD"
#define XA_WIN_WORKSPACES_REMOVE "_WIN_WORKSPACES_REMOVE"
/* layer */
#define XA_WIN_LAYER "_WIN_LAYER"
/* Type: CARD32
* window layer
*
* Window layer.
* Windows with LAYER=WinLayerDock determine size of the Work Area
* (WIN_WORKAREA). Windows below dock layer are resized to the size
* of the work area when maximized. Windows above dock layer are
* maximized to the entire screen space.
*
* The default can be set by application, but when window is mapped
* only window manager can change this. If an application wants to change
* the window layer it should send the ClientMessage to the root window
* like this:
* xev.type = ClientMessage;
* xev.window = toplevel_window;
* xev.message_type = _XA_WIN_LAYER;
* xev.format = 32;
* xev.data.l[0] = layer;
* xev.data.l[1] = timeStamp;
* XSendEvent(display, root, False, SubstructureNotifyMask, (XEvent *) &xev);
*
* TODO: A few available layers could be used for WMaker menus/submenus
* (comments?)
*
* Partially implemented. Currently requires all docked windows to be
* sticky (only one workarea for all workspaces). Otherwise non-docked sticky
* windows could (?) move when switching workspaces (annoying).
*/
#define WinLayerCount 16
#define WinLayerInvalid 0xFFFFFFFFL
#define WinLayerDesktop 0L
#define WinLayerBelow 2L
#define WinLayerNormal 4L
#define WinLayerOnTop 6L
#define WinLayerDock 8L
#define WinLayerAboveDock 10L
#define WinLayerMenu 12L
/* state */
#define XA_WIN_STATE "_WIN_STATE"
/* Type CARD32[2]
* window state. First CARD32 is the mask of set/supported states,
* the second one is the state.
*
* The default value for this property can be set by applications.
* When window is mapped, the property is updated by the window manager
* as necessary. Applications can request the state change by sending
* the client message to the root window like this:
*
* xev.type = ClientMessage;
* xev.window = toplevel_window;
* xev.message_type = _XA_WIN_WORKSPACE;
* xev.format = 32;
* xev.data.l[0] = mask; // mask of the states to change
* xev.data.l[1] = state; // new state values
* xev.data.l[2] = timeStamp;
* XSendEvent(display, root, False, SubstructureNotifyMask, (XEvent *) &xev);
*/
#define WinStateAllWorkspaces (1 << 0) /* appears on all workspaces */
#define WinStateMinimized (1 << 1) /* to iconbox,taskbar,... */
#define WinStateMaximizedVert (1 << 2) /* maximized vertically */
#define WinStateMaximizedHoriz (1 << 3) /* maximized horizontally */
#define WinStateHidden (1 << 4) /* not on taskbar if any, but still accessible */
#define WinStateRollup (1 << 5) /* only titlebar visible */
#define WinStateFixedPosition (1 << 10) /* fixed position on virtual desktop*/
#define WinStateArrangeIgnore (1 << 11) /* ignore for auto arranging */
//#define WinStateDocked (1 << 9) /* docked, ignore my area for maximizing */
#define WinStateWasHidden (1 << 29) /* was hidden when parent was minimized/hidden */
#define WinStateWasMinimized (1 << 30) /* was minimized when parent was minimized/hidden */
#define WinStateWithdrawn (1 << 31) /* managed, but not available to user */
#define WIN_STATE_ALL (WinStateAllWorkspaces | WinStateMinimized | WinStateMaximizedVert | WinStateMaximizedHoriz | WinStateHidden | WinStateRollup)
/* hints */
#define XA_WIN_HINTS "_WIN_HINTS"
#define WinHintsSkipFocus (1 << 0)
#define WinHintsSkipWindowMenu (1 << 1)
#define WinHintsSkipTaskBar (1 << 2)
#define WinHintsGroupTransient (1 << 3)
#define WinHintsFocusOnClick (1 << 4) /* app only accepts focus when clicked */
#define WinHintsDoNotCover (1 << 5) /* attempt to not cover this window */
#define WinHintsDockHorizontal (1 << 6) /* docked horizontally */
/* Type CARD32[2]
* additional window hints
*
* Handling of this propery is very similiar to WIN_STATE.
*
* NOT IMPLEMENTED YET.
*/
/* WinHintsDockHorizontal -- not used
* This state is necessary for correct WORKAREA negotiation when
* a window is positioned in a screen corner. If set, it determines how
* the place where window is subtracted from workare.
*
* Imagine a square docklet in the corner of the screen (several WMaker docklets
* are like this).
*
* HHHHD
* ....V
* ....V
* ....V
*
* If WinStateDockHorizontal is set, the WORKAREA will consist of area
* covered by '.' and 'V', otherwise the WORKAREA will consist of area
* covered by '. and 'H';
*
* currently hack is used where: w>h -> horizontal dock, else vertical
*/
/* work area of current workspace -- */
#define XA_WIN_WORKAREA "_WIN_WORKAREA"
/*
* CARD32[4]
* minX, minY, maxX, maxY of workarea.
* set/updated only by the window manager
*
* When windows are maximized they occupy the entire workarea except for
* the titlebar at the top (in icewm window frame is not visible).
*
* Note: when WORKAREA changes, the application window are automatically
* repositioned and maximized windows are also resized.
*/
#define XA_WIN_CLIENT_LIST "_WIN_CLIENT_LIST"
/*
* XID[]
*
* list of clients the WM is currently managing
*/
/* hack for gmc */
#define XA_WIN_DESKTOP_BUTTON_PROXY "_WIN_DESKTOP_BUTTON_PROXY"
/* not really used: */
#define XA_WIN_AREA "_WIN_AREA"
#define XA_WIN_AREA_COUNT "_WIN_AREA_COUNT"
#endif