237 |
Status status; |
Status status; |
238 |
XEvent xevent; |
XEvent xevent; |
239 |
|
|
240 |
|
int result; |
241 |
unsigned long nitems; |
unsigned long nitems; |
242 |
unsigned char *props; |
unsigned char *props; |
243 |
uint32 *state; |
uint32 state; |
244 |
|
|
245 |
/* The spec states that the window manager must respect any |
/* The spec states that the window manager must respect any |
246 |
_NET_WM_STATE attributes on a withdrawn window. In order words, we |
_NET_WM_STATE attributes on a withdrawn window. In order words, we |
247 |
modify the attributes directly for withdrawn windows and ask the WM |
modify the attributes directly for withdrawn windows and ask the WM |
248 |
to do it for active windows. */ |
to do it for active windows. */ |
249 |
if ((get_property_value(wnd, "WM_STATE", 64, &nitems, &props, 1) < 0) |
result = get_property_value(wnd, "WM_STATE", 64, &nitems, &props, 1); |
250 |
|| ((state = (uint32 *) props)[0] == WithdrawnState)) |
if ((result >= 0) && nitems) |
251 |
|
{ |
252 |
|
state = *(uint32 *) props; |
253 |
|
XFree(props); |
254 |
|
} |
255 |
|
|
256 |
|
if ((result < 0) || !nitems || (state == WithdrawnState)) |
257 |
{ |
{ |
258 |
if (add) |
if (add) |
259 |
{ |
{ |
294 |
|
|
295 |
XChangeProperty(g_display, wnd, g_net_wm_state_atom, XA_ATOM, |
XChangeProperty(g_display, wnd, g_net_wm_state_atom, XA_ATOM, |
296 |
32, PropModeReplace, (unsigned char *) atoms, nitems); |
32, PropModeReplace, (unsigned char *) atoms, nitems); |
297 |
|
|
298 |
|
XFree(props); |
299 |
} |
} |
300 |
|
|
301 |
return 0; |
return 0; |