2 * Copyright (C) 2004-2008 Kim Woelders
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies of the Software, its documentation and marketing & publicity
13 * materials, and acknowledgment shall be given in the documentation, materials
14 * and software packages that this Software was used.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 * Stuff for compiling without ecore_x.
29 #include <X11/Xatom.h>
31 #include <X11/Xutil.h>
34 #include "e16-ecore_hints.h"
36 /* Window property change actions (must match _NET_WM_STATE_... ones) */
37 #define ECORE_X_PROP_LIST_REMOVE 0
38 #define ECORE_X_PROP_LIST_ADD 1
39 #define ECORE_X_PROP_LIST_TOGGLE 2
43 extern Display *_ecore_x_disp;
46 ecore_x_icccm_state_set_iconic(Ecore_X_Window win)
48 ecore_x_icccm_state_set(win, ECORE_X_WINDOW_STATE_HINT_ICONIC);
52 ecore_x_icccm_state_set_normal(Ecore_X_Window win)
54 ecore_x_icccm_state_set(win, ECORE_X_WINDOW_STATE_HINT_NORMAL);
58 ecore_x_icccm_state_set_withdrawn(Ecore_X_Window win)
60 ecore_x_icccm_state_set(win, ECORE_X_WINDOW_STATE_HINT_WITHDRAWN);
63 #else /* USE_ECORE_X */
72 #define _ecore_x_disp disp
74 #define N_ITEMS(x) (sizeof(x)/sizeof(x[0]))
81 * Send client message (format 32)
84 ecore_x_client_message32_send(Window win, Atom type, long mask, long d0,
85 long d1, long d2, long d3, long d4)
89 xev.xclient.type = ClientMessage;
90 xev.xclient.window = win;
91 xev.xclient.message_type = type;
92 xev.xclient.format = 32;
93 xev.xclient.data.l[0] = d0;
94 xev.xclient.data.l[1] = d1;
95 xev.xclient.data.l[2] = d2;
96 xev.xclient.data.l[3] = d3;
97 xev.xclient.data.l[4] = d4;
99 return XSendEvent(_ecore_x_disp, win, False, mask, &xev);
103 * Set CARD32 (array) property
106 ecore_x_window_prop_card32_set(Ecore_X_Window win, Ecore_X_Atom atom,
107 unsigned int *val, unsigned int num)
109 #if SIZEOF_INT == SIZEOF_LONG
110 XChangeProperty(_ecore_x_disp, win, atom, XA_CARDINAL, 32, PropModeReplace,
111 (unsigned char *)val, num);
116 pl = malloc(num * sizeof(long));
119 for (i = 0; i < num; i++)
121 XChangeProperty(_ecore_x_disp, win, atom, XA_CARDINAL, 32, PropModeReplace,
122 (unsigned char *)pl, num);
128 * Get CARD32 (array) property
130 * At most len items are returned in val.
131 * If the property was successfully fetched the number of items stored in
132 * val is returned, otherwise -1 is returned.
133 * Note: Return value 0 means that the property exists but has no elements.
136 ecore_x_window_prop_card32_get(Ecore_X_Window win, Ecore_X_Atom atom,
137 unsigned int *val, unsigned int len)
139 unsigned char *prop_ret;
141 unsigned long bytes_after, num_ret;
147 if (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
148 XA_CARDINAL, &type_ret, &format_ret, &num_ret,
149 &bytes_after, &prop_ret) != Success)
152 if (type_ret == None || num_ret == 0)
156 else if (prop_ret && type_ret == XA_CARDINAL && format_ret == 32)
160 for (i = 0; i < len; i++)
161 val[i] = ((unsigned long *)prop_ret)[i];
175 * Get CARD32 (array) property of any length
177 * If the property was successfully fetched the number of items stored in
178 * val is returned, otherwise -1 is returned.
179 * Note: Return value 0 means that the property exists but has no elements.
182 ecore_x_window_prop_card32_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
185 unsigned char *prop_ret;
187 unsigned long bytes_after, num_ret;
189 unsigned int i, *val;
193 if (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
194 XA_CARDINAL, &type_ret, &format_ret, &num_ret,
195 &bytes_after, &prop_ret) != Success)
198 if (type_ret == None || num_ret == 0)
203 else if (prop_ret && type_ret == XA_CARDINAL && format_ret == 32)
205 val = (unsigned int *)malloc(num_ret * sizeof(unsigned int));
206 for (i = 0; i < num_ret; i++)
207 val[i] = ((unsigned long *)prop_ret)[i];
222 #endif /* USE_ECORE_X */
225 * Set simple string list property
228 ecore_x_window_prop_string_list_set(Ecore_X_Window win, Ecore_X_Atom atom,
233 if (XmbTextListToTextProperty(_ecore_x_disp, lst, num,
234 XStdICCTextStyle, &xtp) != Success)
236 XSetTextProperty(_ecore_x_disp, win, &xtp, atom);
241 * Get simple string list property
243 * If the property was successfully fetched the number of items stored in
244 * lst is returned, otherwise -1 is returned.
245 * Note: Return value 0 means that the property exists but has no elements.
248 ecore_x_window_prop_string_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
259 if (!XGetTextProperty(_ecore_x_disp, win, &xtp, atom))
264 s = XmbTextPropertyToTextList(_ecore_x_disp, &xtp, &list, &items);
269 pstr = (char **)malloc(items * sizeof(char *));
270 for (i = 0; i < items; i++)
271 pstr[i] = (list[i] && (*list[i] || i < items - 1)) ?
272 strdup(list[i]) : NULL;
275 XFreeStringList(list);
280 /* Bad format or XmbTextPropertyToTextList failed - Now what? */
281 pstr = (char **)malloc(sizeof(char *));
282 pstr[0] = (xtp.value) ? strdup((char *)xtp.value) : NULL;
295 * Set simple string property
298 ecore_x_window_prop_string_set(Ecore_X_Window win, Ecore_X_Atom atom,
301 ecore_x_window_prop_string_list_set(win, atom, (char **)(&str), 1);
305 * Get simple string property
308 ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom atom)
316 if (!XGetTextProperty(_ecore_x_disp, win, &xtp, atom))
321 s = XmbTextPropertyToTextList(_ecore_x_disp, &xtp, &list, &items);
322 if ((s == Success) && (items > 0))
324 str = (*list) ? strdup(*list) : NULL;
325 XFreeStringList(list);
328 str = (xtp.value) ? strdup((char *)xtp.value) : NULL;
331 str = (xtp.value) ? strdup((char *)xtp.value) : NULL;
339 * Set UTF-8 string property
342 _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, Ecore_X_Atom atom,
345 XChangeProperty(_ecore_x_disp, win, atom, ECORE_X_ATOM_UTF8_STRING, 8,
346 PropModeReplace, (unsigned char *)str, strlen(str));
350 * Get UTF-8 string property
353 _ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom)
356 unsigned char *prop_ret;
358 unsigned long bytes_after, num_ret;
363 XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
364 ECORE_X_ATOM_UTF8_STRING, &type_ret,
365 &format_ret, &num_ret, &bytes_after, &prop_ret);
366 if (prop_ret && num_ret > 0 && format_ret == 8)
368 str = (char *)malloc(num_ret + 1);
371 memcpy(str, prop_ret, num_ret);
382 * Set X ID (array) property
385 ecore_x_window_prop_xid_set(Ecore_X_Window win, Ecore_X_Atom atom,
386 Ecore_X_Atom type, Ecore_X_ID * lst,
389 #if SIZEOF_INT == SIZEOF_LONG
390 XChangeProperty(_ecore_x_disp, win, atom, type, 32, PropModeReplace,
391 (unsigned char *)lst, num);
396 pl = malloc(num * sizeof(long));
399 for (i = 0; i < num; i++)
401 XChangeProperty(_ecore_x_disp, win, atom, type, 32, PropModeReplace,
402 (unsigned char *)pl, num);
408 * Get X ID (array) property
410 * At most len items are returned in val.
411 * If the property was successfully fetched the number of items stored in
412 * val is returned, otherwise -1 is returned.
413 * Note: Return value 0 means that the property exists but has no elements.
416 ecore_x_window_prop_xid_get(Ecore_X_Window win, Ecore_X_Atom atom,
417 Ecore_X_Atom type, Ecore_X_ID * lst,
420 unsigned char *prop_ret;
422 unsigned long bytes_after, num_ret;
428 if (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
429 type, &type_ret, &format_ret, &num_ret,
430 &bytes_after, &prop_ret) != Success)
433 if (type_ret == None)
437 else if (prop_ret && type_ret == type && format_ret == 32)
441 for (i = 0; i < len; i++)
442 lst[i] = ((unsigned long *)prop_ret)[i];
456 * Get X ID (array) property
458 * If the property was successfully fetched the number of items stored in
459 * val is returned, otherwise -1 is returned.
460 * The returned array must be freed with free().
461 * Note: Return value 0 means that the property exists but has no elements.
464 ecore_x_window_prop_xid_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
465 Ecore_X_Atom type, Ecore_X_ID ** val)
467 unsigned char *prop_ret;
469 unsigned long bytes_after, num_ret;
477 if (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
478 type, &type_ret, &format_ret, &num_ret,
479 &bytes_after, &prop_ret) != Success)
482 if (type_ret == None || num_ret == 0)
486 else if (prop_ret && type_ret == type && format_ret == 32)
488 alst = (Ecore_X_Atom *) malloc(num_ret * sizeof(Ecore_X_ID));
489 for (i = 0; i < num_ret; i++)
490 alst[i] = ((unsigned long *)prop_ret)[i];
505 * Remove/add/toggle X ID list item.
508 ecore_x_window_prop_xid_list_change(Ecore_X_Window win, Ecore_X_Atom atom,
509 Ecore_X_Atom type, Ecore_X_ID item, int op)
514 num = ecore_x_window_prop_xid_list_get(win, atom, type, &lst);
516 return; /* Error - assuming invalid window */
519 for (i = 0; i < num; i++)
528 if (op == ECORE_X_PROP_LIST_ADD)
537 /* Was not in list */
538 if (op == ECORE_X_PROP_LIST_REMOVE)
542 lst = (Ecore_X_ID *) realloc(lst, num * sizeof(Ecore_X_ID));
546 ecore_x_window_prop_xid_set(win, atom, type, lst, num);
554 * Set Atom (array) property
557 ecore_x_window_prop_atom_set(Ecore_X_Window win, Ecore_X_Atom atom,
558 Ecore_X_Atom * lst, unsigned int num)
560 ecore_x_window_prop_xid_set(win, atom, XA_ATOM, lst, num);
564 * Get Atom (array) property
566 * At most len items are returned in val.
567 * If the property was successfully fetched the number of items stored in
568 * val is returned, otherwise -1 is returned.
569 * Note: Return value 0 means that the property exists but has no elements.
572 ecore_x_window_prop_atom_get(Ecore_X_Window win, Ecore_X_Atom atom,
573 Ecore_X_Atom * lst, unsigned int len)
575 return ecore_x_window_prop_xid_get(win, atom, XA_ATOM, lst, len);
579 * Get Atom (array) property
581 * If the property was successfully fetched the number of items stored in
582 * val is returned, otherwise -1 is returned.
583 * The returned array must be freed with free().
584 * Note: Return value 0 means that the property exists but has no elements.
587 ecore_x_window_prop_atom_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
588 Ecore_X_Atom ** plst)
590 return ecore_x_window_prop_xid_list_get(win, atom, XA_ATOM, plst);
594 * Remove/add/toggle atom list item.
597 ecore_x_window_prop_atom_list_change(Ecore_X_Window win, Ecore_X_Atom atom,
598 Ecore_X_Atom item, int op)
600 ecore_x_window_prop_xid_list_change(win, atom, XA_ATOM, item, op);
604 * Set Window (array) property
607 ecore_x_window_prop_window_set(Ecore_X_Window win, Ecore_X_Atom atom,
608 Ecore_X_Window * lst, unsigned int num)
610 ecore_x_window_prop_xid_set(win, atom, XA_WINDOW, lst, num);
614 * Get Window (array) property
616 * At most len items are returned in val.
617 * If the property was successfully fetched the number of items stored in
618 * val is returned, otherwise -1 is returned.
619 * Note: Return value 0 means that the property exists but has no elements.
622 ecore_x_window_prop_window_get(Ecore_X_Window win, Ecore_X_Atom atom,
623 Ecore_X_Window * lst, unsigned int len)
625 return ecore_x_window_prop_xid_get(win, atom, XA_WINDOW, lst, len);
629 * Get Window (array) property
631 * If the property was successfully fetched the number of items stored in
632 * val is returned, otherwise -1 is returned.
633 * The returned array must be freed with free().
634 * Note: Return value 0 means that the property exists but has no elements.
637 ecore_x_window_prop_window_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
638 Ecore_X_Window ** plst)
640 return ecore_x_window_prop_xid_list_get(win, atom, XA_WINDOW, plst);
643 #endif /* USE_ECORE_X */
650 static const char *const atoms_icccm_names[] = {
657 "WM_COLORMAP_WINDOWS",
671 unsigned int atoms_icccm[CHECK_COUNT_ICCCM];
674 ecore_x_icccm_init(void)
677 assert(CHECK_COUNT_ICCCM == N_ITEMS(atoms_icccm));
679 AtomListIntern(atoms_icccm_names, N_ITEMS(atoms_icccm), atoms_icccm);
683 ecore_x_icccm_state_set(Ecore_X_Window win, unsigned int state)
689 XChangeProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE,
690 ECORE_X_ATOM_WM_STATE, 32, PropModeReplace,
691 (unsigned char *)c, 2);
695 ecore_x_icccm_state_set_iconic(Ecore_X_Window win)
697 ecore_x_icccm_state_set(win, IconicState);
701 ecore_x_icccm_state_set_normal(Ecore_X_Window win)
703 ecore_x_icccm_state_set(win, NormalState);
707 ecore_x_icccm_state_set_withdrawn(Ecore_X_Window win)
709 ecore_x_icccm_state_set(win, WithdrawnState);
713 ecore_x_icccm_client_message_send(Ecore_X_Window win,
714 Ecore_X_Atom atom, Ecore_X_Time ts)
716 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS, NoEventMask,
721 ecore_x_icccm_delete_window_send(Ecore_X_Window win, Ecore_X_Time ts)
723 ecore_x_icccm_client_message_send(win, ECORE_X_ATOM_WM_DELETE_WINDOW, ts);
727 ecore_x_icccm_take_focus_send(Ecore_X_Window win, Ecore_X_Time ts)
729 ecore_x_icccm_client_message_send(win, ECORE_X_ATOM_WM_TAKE_FOCUS, ts);
734 ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time ts)
736 ecore_x_icccm_client_message_send(win, ECORE_X_ATOM_WM_SAVE_YOURSELF, ts);
741 ecore_x_icccm_title_set(Ecore_X_Window win, const char *title)
743 ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_NAME, title);
747 ecore_x_icccm_title_get(Ecore_X_Window win)
749 return ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_NAME);
753 ecore_x_icccm_name_class_set(Ecore_X_Window win, const char *name,
758 xch = XAllocClassHint();
761 xch->res_name = (char *)name;
762 xch->res_class = (char *)clss;
763 XSetClassHint(_ecore_x_disp, win, xch);
768 ecore_x_icccm_name_class_get(Ecore_X_Window win, char **name, char **clss)
772 *name = *clss = NULL;
774 xch.res_class = NULL;
775 if (XGetClassHint(_ecore_x_disp, win, &xch))
777 if (name && xch.res_name)
778 *name = strdup(xch.res_name);
779 if (clss && xch.res_class)
780 *clss = strdup(xch.res_class);
782 XFree(xch.res_class);
786 #endif /* USE_ECORE_X */
790 * _NET_WM hints (EWMH)
793 static const char *const atoms_netwm_names[] = {
796 /* Window manager info */
798 "_NET_SUPPORTING_WM_CHECK",
800 /* Desktop status/requests */
801 "_NET_NUMBER_OF_DESKTOPS",
802 "_NET_VIRTUAL_ROOTS",
803 "_NET_DESKTOP_GEOMETRY",
804 "_NET_DESKTOP_NAMES",
805 "_NET_DESKTOP_VIEWPORT",
807 "_NET_CURRENT_DESKTOP",
808 "_NET_SHOWING_DESKTOP",
810 "_NET_ACTIVE_WINDOW",
812 "_NET_CLIENT_LIST_STACKING",
814 /* Client window props/client messages */
816 "_NET_WM_VISIBLE_NAME",
818 "_NET_WM_VISIBLE_ICON_NAME",
822 "_NET_WM_WINDOW_TYPE",
823 "_NET_WM_WINDOW_TYPE_DESKTOP",
824 "_NET_WM_WINDOW_TYPE_DOCK",
825 "_NET_WM_WINDOW_TYPE_TOOLBAR",
826 "_NET_WM_WINDOW_TYPE_MENU",
827 "_NET_WM_WINDOW_TYPE_UTILITY",
828 "_NET_WM_WINDOW_TYPE_SPLASH",
829 "_NET_WM_WINDOW_TYPE_DIALOG",
830 "_NET_WM_WINDOW_TYPE_NORMAL",
833 "_NET_WM_STATE_MODAL",
834 "_NET_WM_STATE_STICKY",
835 "_NET_WM_STATE_MAXIMIZED_VERT",
836 "_NET_WM_STATE_MAXIMIZED_HORZ",
837 "_NET_WM_STATE_SHADED",
838 "_NET_WM_STATE_SKIP_TASKBAR",
839 "_NET_WM_STATE_SKIP_PAGER",
840 "_NET_WM_STATE_HIDDEN",
841 "_NET_WM_STATE_FULLSCREEN",
842 "_NET_WM_STATE_ABOVE",
843 "_NET_WM_STATE_BELOW",
844 "_NET_WM_STATE_DEMANDS_ATTENTION",
846 "_NET_WM_ALLOWED_ACTIONS",
847 "_NET_WM_ACTION_MOVE",
848 "_NET_WM_ACTION_RESIZE",
849 "_NET_WM_ACTION_MINIMIZE",
850 "_NET_WM_ACTION_SHADE",
851 "_NET_WM_ACTION_STICK",
852 "_NET_WM_ACTION_MAXIMIZE_HORZ",
853 "_NET_WM_ACTION_MAXIMIZE_VERT",
854 "_NET_WM_ACTION_FULLSCREEN",
855 "_NET_WM_ACTION_CHANGE_DESKTOP",
856 "_NET_WM_ACTION_CLOSE",
857 "_NET_WM_ACTION_ABOVE",
858 "_NET_WM_ACTION_BELOW",
861 "_NET_WM_STRUT_PARTIAL",
863 "_NET_FRAME_EXTENTS",
870 "_NET_WM_ICON_GEOMETRY",
872 "_NET_WM_HANDLED_ICONS",
876 "_NET_WM_SYNC_REQUEST",
877 "_NET_WM_SYNC_REQUEST_COUNTER",
879 "_NET_WM_WINDOW_OPACITY",
881 /* Misc window ops */
883 "_NET_MOVERESIZE_WINDOW",
884 "_NET_WM_MOVERESIZE",
885 "_NET_RESTACK_WINDOW",
887 #if 0 /* Not yet implemented */
888 "_NET_REQUEST_FRAME_EXTENTS",
891 /* Startup notification */
893 "_NET_STARTUP_INFO_BEGIN",
898 unsigned int atoms_netwm[CHECK_COUNT_NETWM];
901 ecore_x_netwm_init(void)
904 assert(CHECK_COUNT_NETWM == N_ITEMS(atoms_netwm));
906 AtomListIntern(atoms_netwm_names, N_ITEMS(atoms_netwm), atoms_netwm);
913 ecore_x_netwm_wm_identify(Ecore_X_Window root, Ecore_X_Window check,
916 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
918 ecore_x_window_prop_window_set(check, ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
920 _ecore_x_window_prop_string_utf8_set(check, ECORE_X_ATOM_NET_WM_NAME,
922 /* This one isn't mandatory */
923 _ecore_x_window_prop_string_utf8_set(root, ECORE_X_ATOM_NET_WM_NAME,
928 * Desktop configuration and status
932 ecore_x_netwm_desk_count_set(Ecore_X_Window root, unsigned int n_desks)
934 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS,
939 ecore_x_netwm_desk_roots_set(Ecore_X_Window root, Ecore_X_Window * vroots,
940 unsigned int n_desks)
942 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_VIRTUAL_ROOTS, vroots,
947 ecore_x_netwm_desk_names_set(Ecore_X_Window root, const char **names,
948 unsigned int n_desks)
958 for (i = 0; i < n_desks; i++)
960 s = (names) ? names[i] : NULL;
963 /* Default to "Desk-<number>" */
964 sprintf(ss, "Desk-%d", i);
969 buf = (char *)realloc(buf, len + l);
970 memcpy(buf + len, s, l);
974 XChangeProperty(_ecore_x_disp, root, ECORE_X_ATOM_NET_DESKTOP_NAMES,
975 ECORE_X_ATOM_UTF8_STRING, 8, PropModeReplace,
976 (unsigned char *)buf, len);
982 ecore_x_netwm_desk_size_set(Ecore_X_Window root, unsigned int width,
985 unsigned int size[2];
989 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_GEOMETRY, size,
994 ecore_x_netwm_desk_workareas_set(Ecore_X_Window root, unsigned int *areas,
995 unsigned int n_desks)
997 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_WORKAREA, areas,
1002 ecore_x_netwm_desk_current_set(Ecore_X_Window root, unsigned int desk)
1004 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_CURRENT_DESKTOP, &desk,
1009 ecore_x_netwm_desk_viewports_set(Ecore_X_Window root, unsigned int *origins,
1010 unsigned int n_desks)
1012 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_VIEWPORT,
1013 origins, 2 * n_desks);
1017 ecore_x_netwm_showing_desktop_set(Ecore_X_Window root, int on)
1022 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_SHOWING_DESKTOP, &val,
1032 ecore_x_netwm_client_list_set(Ecore_X_Window root, Ecore_X_Window * p_clients,
1033 unsigned int n_clients)
1035 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST, p_clients,
1039 /* Stacking order */
1041 ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root,
1042 Ecore_X_Window * p_clients,
1043 unsigned int n_clients)
1045 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST_STACKING,
1046 p_clients, n_clients);
1050 ecore_x_netwm_client_active_set(Ecore_X_Window root, Ecore_X_Window win)
1052 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_ACTIVE_WINDOW, &win,
1057 * Client window properties
1061 ecore_x_netwm_name_set(Ecore_X_Window win, const char *name)
1063 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_NAME, name);
1067 ecore_x_netwm_name_get(Ecore_X_Window win, char **name)
1071 s = _ecore_x_window_prop_string_utf8_get(win, ECORE_X_ATOM_NET_WM_NAME);
1078 ecore_x_netwm_visible_name_set(Ecore_X_Window win, const char *name)
1080 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_NAME,
1085 ecore_x_netwm_visible_name_get(Ecore_X_Window win, char **name)
1089 s = _ecore_x_window_prop_string_utf8_get(win,
1090 ECORE_X_ATOM_NET_WM_VISIBLE_NAME);
1097 ecore_x_netwm_icon_name_set(Ecore_X_Window win, const char *name)
1099 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME,
1104 ecore_x_netwm_icon_name_get(Ecore_X_Window win, char **name)
1108 s = _ecore_x_window_prop_string_utf8_get(win, ECORE_X_ATOM_NET_WM_ICON_NAME);
1115 ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win, const char *name)
1117 _ecore_x_window_prop_string_utf8_set(win,
1118 ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME,
1123 ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win, char **name)
1127 s = _ecore_x_window_prop_string_utf8_get(win,
1128 ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME);
1135 ecore_x_netwm_desktop_set(Ecore_X_Window win, unsigned int desk)
1137 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_DESKTOP, &desk, 1);
1141 ecore_x_netwm_desktop_get(Ecore_X_Window win, unsigned int *desk)
1143 return ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_DESKTOP,
1148 ecore_x_netwm_user_time_get(Ecore_X_Window win, unsigned int *ts)
1150 return ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_USER_TIME,
1155 ecore_x_netwm_opacity_set(Ecore_X_Window win, unsigned int opacity)
1157 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
1162 ecore_x_netwm_opacity_get(Ecore_X_Window win, unsigned int *opacity)
1164 return ecore_x_window_prop_card32_get(win,
1165 ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
1169 #if 0 /* Not used */
1171 ecore_x_netwm_startup_id_set(Ecore_X_Window win, const char *id)
1173 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_STARTUP_ID, id);
1178 ecore_x_netwm_startup_id_get(Ecore_X_Window win, char **id)
1182 s = _ecore_x_window_prop_string_utf8_get(win, ECORE_X_ATOM_NET_STARTUP_ID);
1188 #endif /* USE_ECORE_X */