awesomerc: remove marking
[awesome.git] / ewmh.c
blobd0ff5e5c278216c9c87e3754d7cb92a184ea0891
1 /*
2 * ewmh.c - EWMH support functions
4 * Copyright © 2007-2009 Julien Danjou <julien@danjou.info>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include <sys/types.h>
23 #include <unistd.h>
25 #include <xcb/xcb.h>
26 #include <xcb/xcb_atom.h>
28 #include "ewmh.h"
29 #include "tag.h"
30 #include "screen.h"
31 #include "client.h"
32 #include "widget.h"
33 #include "wibox.h"
34 #include "common/atoms.h"
35 #include "common/buffer.h"
36 #include "common/xutil.h"
38 #define _NET_WM_STATE_REMOVE 0
39 #define _NET_WM_STATE_ADD 1
40 #define _NET_WM_STATE_TOGGLE 2
42 /** Update the desktop geometry.
43 * \param phys_screen The physical screen id.
45 static void
46 ewmh_update_desktop_geometry(int phys_screen)
48 area_t geom = screen_area_get(&globalconf.screens.tab[phys_screen], false);
49 uint32_t sizes[] = { geom.width, geom.height };
51 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
52 xutil_screen_get(globalconf.connection, phys_screen)->root,
53 _NET_DESKTOP_GEOMETRY, CARDINAL, 32, countof(sizes), sizes);
56 void
57 ewmh_init(int phys_screen)
59 xcb_window_t father;
60 xcb_screen_t *xscreen = xutil_screen_get(globalconf.connection, phys_screen);
61 xcb_atom_t atom[] =
63 _NET_SUPPORTED,
64 _NET_SUPPORTING_WM_CHECK,
65 _NET_STARTUP_ID,
66 _NET_CLIENT_LIST,
67 _NET_CLIENT_LIST_STACKING,
68 _NET_NUMBER_OF_DESKTOPS,
69 _NET_CURRENT_DESKTOP,
70 _NET_DESKTOP_NAMES,
71 _NET_ACTIVE_WINDOW,
72 _NET_WORKAREA,
73 _NET_DESKTOP_GEOMETRY,
74 _NET_CLOSE_WINDOW,
75 _NET_WM_NAME,
76 _NET_WM_STRUT_PARTIAL,
77 _NET_WM_ICON_NAME,
78 _NET_WM_VISIBLE_ICON_NAME,
79 _NET_WM_DESKTOP,
80 _NET_WM_WINDOW_TYPE,
81 _NET_WM_WINDOW_TYPE_DESKTOP,
82 _NET_WM_WINDOW_TYPE_DOCK,
83 _NET_WM_WINDOW_TYPE_TOOLBAR,
84 _NET_WM_WINDOW_TYPE_MENU,
85 _NET_WM_WINDOW_TYPE_UTILITY,
86 _NET_WM_WINDOW_TYPE_SPLASH,
87 _NET_WM_WINDOW_TYPE_DIALOG,
88 _NET_WM_WINDOW_TYPE_DROPDOWN_MENU,
89 _NET_WM_WINDOW_TYPE_POPUP_MENU,
90 _NET_WM_WINDOW_TYPE_TOOLTIP,
91 _NET_WM_WINDOW_TYPE_NOTIFICATION,
92 _NET_WM_WINDOW_TYPE_COMBO,
93 _NET_WM_WINDOW_TYPE_DND,
94 _NET_WM_WINDOW_TYPE_NORMAL,
95 _NET_WM_ICON,
96 _NET_WM_PID,
97 _NET_WM_STATE,
98 _NET_WM_STATE_STICKY,
99 _NET_WM_STATE_SKIP_TASKBAR,
100 _NET_WM_STATE_FULLSCREEN,
101 _NET_WM_STATE_MAXIMIZED_HORZ,
102 _NET_WM_STATE_MAXIMIZED_VERT,
103 _NET_WM_STATE_ABOVE,
104 _NET_WM_STATE_BELOW,
105 _NET_WM_STATE_MODAL,
106 _NET_WM_STATE_HIDDEN,
107 _NET_WM_STATE_DEMANDS_ATTENTION
109 int i;
111 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
112 xscreen->root, _NET_SUPPORTED, ATOM, 32,
113 countof(atom), atom);
115 /* create our own window */
116 father = xcb_generate_id(globalconf.connection);
117 xcb_create_window(globalconf.connection, xscreen->root_depth,
118 father, xscreen->root, -1, -1, 1, 1, 0,
119 XCB_COPY_FROM_PARENT, xscreen->root_visual, 0, NULL);
121 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
122 xscreen->root, _NET_SUPPORTING_WM_CHECK, WINDOW, 32,
123 1, &father);
125 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
126 father, _NET_SUPPORTING_WM_CHECK, WINDOW, 32,
127 1, &father);
129 /* set the window manager name */
130 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
131 father, _NET_WM_NAME, UTF8_STRING, 8, 7, "awesome");
133 /* set the window manager PID */
134 i = getpid();
135 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
136 father, _NET_WM_PID, CARDINAL, 32, 1, &i);
138 ewmh_update_desktop_geometry(phys_screen);
141 void
142 ewmh_update_net_client_list(int phys_screen)
144 xcb_window_t *wins = p_alloca(xcb_window_t, globalconf.clients.len);
146 int n = 0;
147 foreach(_c, globalconf.clients)
149 client_t *c = *_c;
150 if(c->phys_screen == phys_screen)
151 wins[n++] = c->win;
154 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
155 xutil_screen_get(globalconf.connection, phys_screen)->root,
156 _NET_CLIENT_LIST, WINDOW, 32, n, wins);
159 /** Set the client list in stacking order, bottom to top.
160 * \param phys_screen The physical screen id.
162 void
163 ewmh_update_net_client_list_stacking(int phys_screen)
165 int n = 0;
166 xcb_window_t *wins = p_alloca(xcb_window_t, globalconf.stack.len);
168 foreach(client, globalconf.stack)
169 if((*client)->phys_screen == phys_screen)
170 wins[n++] = (*client)->win;
172 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
173 xutil_screen_get(globalconf.connection, phys_screen)->root,
174 _NET_CLIENT_LIST_STACKING, WINDOW, 32, n, wins);
177 void
178 ewmh_update_net_numbers_of_desktop(int phys_screen)
180 uint32_t count = globalconf.screens.tab[phys_screen].tags.len;
182 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
183 xutil_screen_get(globalconf.connection, phys_screen)->root,
184 _NET_NUMBER_OF_DESKTOPS, CARDINAL, 32, 1, &count);
187 void
188 ewmh_update_net_current_desktop(int phys_screen)
190 uint32_t idx = tags_get_first_selected_index(&globalconf.screens.tab[phys_screen]);
192 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
193 xutil_screen_get(globalconf.connection, phys_screen)->root,
194 _NET_CURRENT_DESKTOP, CARDINAL, 32, 1, &idx);
197 void
198 ewmh_update_net_desktop_names(int phys_screen)
200 tag_array_t *tags = &globalconf.screens.tab[phys_screen].tags;
201 buffer_t buf;
203 buffer_inita(&buf, BUFSIZ);
205 for(int i = 0; i < tags->len; i++)
207 buffer_adds(&buf, tags->tab[i]->name);
208 buffer_addc(&buf, '\0');
211 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
212 xutil_screen_get(globalconf.connection, phys_screen)->root,
213 _NET_DESKTOP_NAMES, UTF8_STRING, 8, buf.len, buf.s);
214 buffer_wipe(&buf);
217 /** Update the work area space for each physical screen and each desktop.
218 * \param phys_screen The physical screen id.
220 void
221 ewmh_update_workarea(int phys_screen)
223 tag_array_t *tags = &globalconf.screens.tab[phys_screen].tags;
224 uint32_t *area = p_alloca(uint32_t, tags->len * 4);
225 area_t geom = screen_area_get(&globalconf.screens.tab[phys_screen], true);
227 for(int i = 0; i < tags->len; i++)
229 area[4 * i + 0] = geom.x;
230 area[4 * i + 1] = geom.y;
231 area[4 * i + 2] = geom.width;
232 area[4 * i + 3] = geom.height;
235 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
236 xutil_screen_get(globalconf.connection, phys_screen)->root,
237 _NET_WORKAREA, CARDINAL, 32, tags->len * 4, area);
240 void
241 ewmh_update_net_active_window(int phys_screen)
243 xcb_window_t win;
245 if(globalconf.screen_focus->client_focus
246 && globalconf.screen_focus->client_focus->phys_screen == phys_screen)
247 win = globalconf.screen_focus->client_focus->win;
248 else
249 win = XCB_NONE;
251 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
252 xutil_screen_get(globalconf.connection, phys_screen)->root,
253 _NET_ACTIVE_WINDOW, WINDOW, 32, 1, &win);
256 static void
257 ewmh_process_state_atom(client_t *c, xcb_atom_t state, int set)
259 if(state == _NET_WM_STATE_STICKY)
261 if(set == _NET_WM_STATE_REMOVE)
262 client_setsticky(c, false);
263 else if(set == _NET_WM_STATE_ADD)
264 client_setsticky(c, true);
265 else if(set == _NET_WM_STATE_TOGGLE)
266 client_setsticky(c, !c->issticky);
268 else if(state == _NET_WM_STATE_SKIP_TASKBAR)
270 if(set == _NET_WM_STATE_REMOVE)
272 c->skiptb = false;
273 ewmh_client_update_hints(c);
275 else if(set == _NET_WM_STATE_ADD)
277 c->skiptb = true;
278 ewmh_client_update_hints(c);
280 else if(set == _NET_WM_STATE_TOGGLE)
282 c->skiptb = !c->skiptb;
283 ewmh_client_update_hints(c);
286 else if(state == _NET_WM_STATE_FULLSCREEN)
288 if(set == _NET_WM_STATE_REMOVE)
289 client_setfullscreen(c, false);
290 else if(set == _NET_WM_STATE_ADD)
291 client_setfullscreen(c, true);
292 else if(set == _NET_WM_STATE_TOGGLE)
293 client_setfullscreen(c, !c->isfullscreen);
295 else if(state == _NET_WM_STATE_MAXIMIZED_HORZ)
297 if(set == _NET_WM_STATE_REMOVE)
298 client_setmaxhoriz(c, false);
299 else if(set == _NET_WM_STATE_ADD)
300 client_setmaxhoriz(c, true);
301 else if(set == _NET_WM_STATE_TOGGLE)
302 client_setmaxhoriz(c, !c->ismaxhoriz);
304 else if(state == _NET_WM_STATE_MAXIMIZED_VERT)
306 if(set == _NET_WM_STATE_REMOVE)
307 client_setmaxvert(c, false);
308 else if(set == _NET_WM_STATE_ADD)
309 client_setmaxvert(c, true);
310 else if(set == _NET_WM_STATE_TOGGLE)
311 client_setmaxvert(c, !c->ismaxvert);
313 else if(state == _NET_WM_STATE_ABOVE)
315 if(set == _NET_WM_STATE_REMOVE)
316 client_setabove(c, false);
317 else if(set == _NET_WM_STATE_ADD)
318 client_setabove(c, true);
319 else if(set == _NET_WM_STATE_TOGGLE)
320 client_setabove(c, !c->isabove);
322 else if(state == _NET_WM_STATE_BELOW)
324 if(set == _NET_WM_STATE_REMOVE)
325 client_setbelow(c, false);
326 else if(set == _NET_WM_STATE_ADD)
327 client_setbelow(c, true);
328 else if(set == _NET_WM_STATE_TOGGLE)
329 client_setbelow(c, !c->isbelow);
331 else if(state == _NET_WM_STATE_MODAL)
333 if(set == _NET_WM_STATE_REMOVE)
334 client_setmodal(c, false);
335 else if(set == _NET_WM_STATE_ADD)
336 client_setmodal(c, true);
337 else if(set == _NET_WM_STATE_TOGGLE)
338 client_setmodal(c, !c->ismodal);
340 else if(state == _NET_WM_STATE_HIDDEN)
342 if(set == _NET_WM_STATE_REMOVE)
343 client_setminimized(c, false);
344 else if(set == _NET_WM_STATE_ADD)
345 client_setminimized(c, true);
346 else if(set == _NET_WM_STATE_TOGGLE)
347 client_setminimized(c, !c->isminimized);
349 else if(state == _NET_WM_STATE_DEMANDS_ATTENTION)
351 if(set == _NET_WM_STATE_REMOVE)
352 client_seturgent(c, false);
353 else if(set == _NET_WM_STATE_ADD)
354 client_seturgent(c, true);
355 else if(set == _NET_WM_STATE_TOGGLE)
356 client_seturgent(c, !c->isurgent);
361 ewmh_process_client_message(xcb_client_message_event_t *ev)
363 client_t *c;
364 int screen;
366 if(ev->type == _NET_CURRENT_DESKTOP)
367 for(screen = 0;
368 screen < xcb_setup_roots_length(xcb_get_setup(globalconf.connection));
369 screen++)
371 if(ev->window == xutil_screen_get(globalconf.connection, screen)->root)
372 tag_view_only_byindex(&globalconf.screens.tab[screen], ev->data.data32[0]);
374 else if(ev->type == _NET_CLOSE_WINDOW)
376 if((c = client_getbywin(ev->window)))
377 client_kill(c);
379 else if(ev->type == _NET_WM_DESKTOP)
381 if((c = client_getbywin(ev->window)))
383 tag_array_t *tags = &c->screen->tags;
385 if(ev->data.data32[0] == 0xffffffff)
386 c->issticky = true;
387 else
388 for(int i = 0; i < tags->len; i++)
389 if((int)ev->data.data32[0] == i)
391 tag_push(globalconf.L, tags->tab[i]);
392 tag_client(c);
394 else
395 untag_client(c, tags->tab[i]);
398 else if(ev->type == _NET_WM_STATE)
400 if((c = client_getbywin(ev->window)))
402 ewmh_process_state_atom(c, (xcb_atom_t) ev->data.data32[1], ev->data.data32[0]);
403 if(ev->data.data32[2])
404 ewmh_process_state_atom(c, (xcb_atom_t) ev->data.data32[2],
405 ev->data.data32[0]);
408 else if(ev->type == _NET_ACTIVE_WINDOW)
410 if((c = client_getbywin(ev->window)))
411 client_focus(c);
414 return 0;
417 /** Update client EWMH hints.
418 * \param c The client.
420 void
421 ewmh_client_update_hints(client_t *c)
423 xcb_atom_t state[10]; /* number of defined state atoms */
424 int i = 0;
426 if(c->ismodal)
427 state[i++] = _NET_WM_STATE_MODAL;
428 if(c->isfullscreen)
429 state[i++] = _NET_WM_STATE_FULLSCREEN;
430 if(c->ismaxvert)
431 state[i++] = _NET_WM_STATE_MAXIMIZED_VERT;
432 if(c->ismaxhoriz)
433 state[i++] = _NET_WM_STATE_MAXIMIZED_HORZ;
434 if(c->issticky)
435 state[i++] = _NET_WM_STATE_STICKY;
436 if(c->skiptb)
437 state[i++] = _NET_WM_STATE_SKIP_TASKBAR;
438 if(c->isabove)
439 state[i++] = _NET_WM_STATE_ABOVE;
440 if(c->isbelow)
441 state[i++] = _NET_WM_STATE_BELOW;
442 if(c->isminimized)
443 state[i++] = _NET_WM_STATE_HIDDEN;
444 if(c->isurgent)
445 state[i++] = _NET_WM_STATE_DEMANDS_ATTENTION;
447 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
448 c->win, _NET_WM_STATE, ATOM, 32, i, state);
451 /** Update the client active desktop.
452 * This is "wrong" since it can be on several tags, but EWMH has a strict view
453 * of desktop system so just take the first tag.
454 * \param c The client.
456 void
457 ewmh_client_update_desktop(client_t *c)
459 int i;
460 tag_array_t *tags = &c->screen->tags;
462 for(i = 0; i < tags->len; i++)
463 if(is_client_tagged(c, tags->tab[i]))
465 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
466 c->win, _NET_WM_DESKTOP, CARDINAL, 32, 1, &i);
467 return;
471 /** Update the client struts.
472 * \param c The client.
474 void
475 ewmh_update_client_strut(client_t *c)
477 uint32_t state[] =
479 c->strut.left,
480 c->strut.right,
481 c->strut.top,
482 c->strut.bottom,
483 c->strut.left_start_y,
484 c->strut.left_end_y,
485 c->strut.right_start_y,
486 c->strut.right_end_y,
487 c->strut.top_start_x,
488 c->strut.top_end_x,
489 c->strut.bottom_start_x,
490 c->strut.bottom_end_x
493 xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
494 c->win, _NET_WM_STRUT_PARTIAL, CARDINAL, 32, countof(state), state);
497 void
498 ewmh_client_check_hints(client_t *c)
500 xcb_atom_t *state;
501 void *data = NULL;
502 int desktop;
503 xcb_get_property_cookie_t c0, c1, c2;
504 xcb_get_property_reply_t *reply;
506 /* Send the GetProperty requests which will be processed later */
507 c0 = xcb_get_property_unchecked(globalconf.connection, false, c->win,
508 _NET_WM_DESKTOP, XCB_GET_PROPERTY_TYPE_ANY, 0, 1);
510 c1 = xcb_get_property_unchecked(globalconf.connection, false, c->win,
511 _NET_WM_STATE, ATOM, 0, UINT32_MAX);
513 c2 = xcb_get_property_unchecked(globalconf.connection, false, c->win,
514 _NET_WM_WINDOW_TYPE, ATOM, 0, UINT32_MAX);
516 reply = xcb_get_property_reply(globalconf.connection, c0, NULL);
517 if(reply && reply->value_len && (data = xcb_get_property_value(reply)))
519 tag_array_t *tags = &c->screen->tags;
521 desktop = *(uint32_t *) data;
522 if(desktop == -1)
523 c->issticky = true;
524 else
525 for(int i = 0; i < tags->len; i++)
526 if(desktop == i)
528 tag_push(globalconf.L, tags->tab[i]);
529 tag_client(c);
531 else
532 untag_client(c, tags->tab[i]);
535 p_delete(&reply);
537 reply = xcb_get_property_reply(globalconf.connection, c1, NULL);
538 if(reply && (data = xcb_get_property_value(reply)))
540 state = (xcb_atom_t *) data;
541 for(int i = 0; i < xcb_get_property_value_length(reply); i++)
542 ewmh_process_state_atom(c, state[i], _NET_WM_STATE_ADD);
545 p_delete(&reply);
547 reply = xcb_get_property_reply(globalconf.connection, c2, NULL);
548 if(reply && (data = xcb_get_property_value(reply)))
550 state = (xcb_atom_t *) data;
551 for(int i = 0; i < xcb_get_property_value_length(reply); i++)
552 if(state[i] == _NET_WM_WINDOW_TYPE_DESKTOP)
553 c->type = MAX(c->type, WINDOW_TYPE_DESKTOP);
554 else if(state[i] == _NET_WM_WINDOW_TYPE_DIALOG)
555 c->type = MAX(c->type, WINDOW_TYPE_DIALOG);
556 else if(state[i] == _NET_WM_WINDOW_TYPE_SPLASH)
557 c->type = MAX(c->type, WINDOW_TYPE_SPLASH);
558 else if(state[i] == _NET_WM_WINDOW_TYPE_DOCK)
559 c->type = MAX(c->type, WINDOW_TYPE_DOCK);
560 else if(state[i] == _NET_WM_WINDOW_TYPE_MENU)
561 c->type = MAX(c->type, WINDOW_TYPE_MENU);
562 else if(state[i] == _NET_WM_WINDOW_TYPE_TOOLBAR)
563 c->type = MAX(c->type, WINDOW_TYPE_TOOLBAR);
564 else if(state[i] == _NET_WM_WINDOW_TYPE_UTILITY)
565 c->type = MAX(c->type, WINDOW_TYPE_UTILITY);
568 p_delete(&reply);
571 /** Process the WM strut of a client.
572 * \param c The client.
573 * \param strut_r (Optional) An existing reply.
575 void
576 ewmh_process_client_strut(client_t *c, xcb_get_property_reply_t *strut_r)
578 void *data;
579 xcb_get_property_reply_t *mstrut_r = NULL;
581 if(!strut_r)
583 xcb_get_property_cookie_t strut_q = xcb_get_property_unchecked(globalconf.connection, false, c->win,
584 _NET_WM_STRUT_PARTIAL, CARDINAL, 0, 12);
585 strut_r = mstrut_r = xcb_get_property_reply(globalconf.connection, strut_q, NULL);
588 if(strut_r
589 && strut_r->value_len
590 && (data = xcb_get_property_value(strut_r)))
592 uint32_t *strut = data;
594 if(c->strut.left != strut[0]
595 || c->strut.right != strut[1]
596 || c->strut.top != strut[2]
597 || c->strut.bottom != strut[3]
598 || c->strut.left_start_y != strut[4]
599 || c->strut.left_end_y != strut[5]
600 || c->strut.right_start_y != strut[6]
601 || c->strut.right_end_y != strut[7]
602 || c->strut.top_start_x != strut[8]
603 || c->strut.top_end_x != strut[9]
604 || c->strut.bottom_start_x != strut[10]
605 || c->strut.bottom_end_x != strut[11])
607 c->strut.left = strut[0];
608 c->strut.right = strut[1];
609 c->strut.top = strut[2];
610 c->strut.bottom = strut[3];
611 c->strut.left_start_y = strut[4];
612 c->strut.left_end_y = strut[5];
613 c->strut.right_start_y = strut[6];
614 c->strut.right_end_y = strut[7];
615 c->strut.top_start_x = strut[8];
616 c->strut.top_end_x = strut[9];
617 c->strut.bottom_start_x = strut[10];
618 c->strut.bottom_end_x = strut[11];
620 hook_property(client, c, "struts");
624 p_delete(&mstrut_r);
627 /** Send request to get NET_WM_ICON (EWMH)
628 * \param w The window.
629 * \return The cookie associated with the request.
631 xcb_get_property_cookie_t
632 ewmh_window_icon_get_unchecked(xcb_window_t w)
634 return xcb_get_property_unchecked(globalconf.connection, false, w,
635 _NET_WM_ICON, CARDINAL, 0, UINT32_MAX);
639 ewmh_window_icon_from_reply(xcb_get_property_reply_t *r)
641 uint32_t *data;
642 uint64_t len;
644 if(!r || r->type != CARDINAL || r->format != 32 || r->length < 2)
645 return 0;
647 data = (uint32_t *) xcb_get_property_value(r);
648 if (!data)
649 return 0;
651 /* Check that the property is as long as it should be, handling integer
652 * overflow. <uint32_t> times <another uint32_t casted to uint64_t> always
653 * fits into an uint64_t and thus this multiplication cannot overflow.
655 len = data[0] * (uint64_t) data[1];
656 if (!data[0] || !data[1] || len > r->length - 2)
657 return 0;
659 return image_new_from_argb32(data[0], data[1], data + 2);
662 /** Get NET_WM_ICON.
663 * \param cookie The cookie.
664 * \return The number of elements on stack.
667 ewmh_window_icon_get_reply(xcb_get_property_cookie_t cookie)
669 xcb_get_property_reply_t *r = xcb_get_property_reply(globalconf.connection, cookie, NULL);
670 int ret = ewmh_window_icon_from_reply(r);
671 p_delete(&r);
672 return ret;
675 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80