2 * Various ICCCM related functions.
4 * This is ALL the code involving anything ICCCM related. for both WM and
10 #endif /* ifdef HAVE_CONFIG_H */
16 #include "ecore_x_private.h"
18 #include "Ecore_X_Atoms.h"
21 ecore_x_icccm_init(void)
23 LOGFN(__FILE__, __LINE__, __FUNCTION__);
27 ecore_x_icccm_state_set(Ecore_X_Window win,
28 Ecore_X_Window_State_Hint state)
32 LOGFN(__FILE__, __LINE__, __FUNCTION__);
33 if (state == ECORE_X_WINDOW_STATE_HINT_WITHDRAWN)
34 c[0] = WithdrawnState;
35 else if (state == ECORE_X_WINDOW_STATE_HINT_NORMAL)
37 else if (state == ECORE_X_WINDOW_STATE_HINT_ICONIC)
41 XChangeProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE,
42 ECORE_X_ATOM_WM_STATE, 32, PropModeReplace,
43 (unsigned char *)c, 2);
46 EAPI Ecore_X_Window_State_Hint
47 ecore_x_icccm_state_get(Ecore_X_Window win)
49 unsigned char *prop_ret = NULL;
51 unsigned long bytes_after, num_ret;
53 Ecore_X_Window_State_Hint hint;
55 LOGFN(__FILE__, __LINE__, __FUNCTION__);
56 hint = ECORE_X_WINDOW_STATE_HINT_NONE;
57 XGetWindowProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE,
58 0, 0x7fffffff, False, ECORE_X_ATOM_WM_STATE,
59 &type_ret, &format_ret, &num_ret, &bytes_after,
61 if ((prop_ret) && (num_ret == 2))
63 if (prop_ret[0] == WithdrawnState)
64 hint = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
65 else if (prop_ret[0] == NormalState)
66 hint = ECORE_X_WINDOW_STATE_HINT_NORMAL;
67 else if (prop_ret[0] == IconicState)
68 hint = ECORE_X_WINDOW_STATE_HINT_ICONIC;
78 ecore_x_icccm_delete_window_send(Ecore_X_Window win,
81 LOGFN(__FILE__, __LINE__, __FUNCTION__);
82 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
83 ECORE_X_EVENT_MASK_NONE,
84 ECORE_X_ATOM_WM_DELETE_WINDOW,
89 ecore_x_icccm_take_focus_send(Ecore_X_Window win,
92 LOGFN(__FILE__, __LINE__, __FUNCTION__);
93 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
94 ECORE_X_EVENT_MASK_NONE,
95 ECORE_X_ATOM_WM_TAKE_FOCUS,
100 ecore_x_icccm_save_yourself_send(Ecore_X_Window win,
103 LOGFN(__FILE__, __LINE__, __FUNCTION__);
104 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
105 ECORE_X_EVENT_MASK_NONE,
106 ECORE_X_ATOM_WM_SAVE_YOURSELF,
111 ecore_x_icccm_move_resize_send(Ecore_X_Window win,
119 LOGFN(__FILE__, __LINE__, __FUNCTION__);
120 ev.type = ConfigureNotify;
121 ev.xconfigure.display = _ecore_x_disp;
122 ev.xconfigure.event = win;
123 ev.xconfigure.window = win;
126 ev.xconfigure.width = w;
127 ev.xconfigure.height = h;
128 ev.xconfigure.border_width = 0;
129 ev.xconfigure.above = None;
130 ev.xconfigure.override_redirect = False;
131 XSendEvent(_ecore_x_disp, win, False, StructureNotifyMask, &ev);
135 ecore_x_icccm_hints_set(Ecore_X_Window win,
136 Eina_Bool accepts_focus,
137 Ecore_X_Window_State_Hint initial_state,
138 Ecore_X_Pixmap icon_pixmap,
139 Ecore_X_Pixmap icon_mask,
140 Ecore_X_Window icon_window,
141 Ecore_X_Window window_group,
146 hints = XAllocWMHints();
150 LOGFN(__FILE__, __LINE__, __FUNCTION__);
151 hints->flags = InputHint | StateHint;
152 hints->input = accepts_focus;
153 if (initial_state == ECORE_X_WINDOW_STATE_HINT_WITHDRAWN)
154 hints->initial_state = WithdrawnState;
155 else if (initial_state == ECORE_X_WINDOW_STATE_HINT_NORMAL)
156 hints->initial_state = NormalState;
157 else if (initial_state == ECORE_X_WINDOW_STATE_HINT_ICONIC)
158 hints->initial_state = IconicState;
160 if (icon_pixmap != 0)
162 hints->icon_pixmap = icon_pixmap;
163 hints->flags |= IconPixmapHint;
168 hints->icon_mask = icon_mask;
169 hints->flags |= IconMaskHint;
172 if (icon_window != 0)
174 hints->icon_window = icon_window;
175 hints->flags |= IconWindowHint;
178 if (window_group != 0)
180 hints->window_group = window_group;
181 hints->flags |= WindowGroupHint;
185 hints->flags |= XUrgencyHint;
187 XSetWMHints(_ecore_x_disp, win, hints);
192 ecore_x_icccm_hints_get(Ecore_X_Window win,
193 Eina_Bool *accepts_focus,
194 Ecore_X_Window_State_Hint *initial_state,
195 Ecore_X_Pixmap *icon_pixmap,
196 Ecore_X_Pixmap *icon_mask,
197 Ecore_X_Window *icon_window,
198 Ecore_X_Window *window_group,
199 Eina_Bool *is_urgent)
203 LOGFN(__FILE__, __LINE__, __FUNCTION__);
205 *accepts_focus = EINA_TRUE;
208 *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
223 *is_urgent = EINA_FALSE;
225 hints = XGetWMHints(_ecore_x_disp, win);
228 if ((hints->flags & InputHint) && (accepts_focus))
231 *accepts_focus = EINA_TRUE;
233 *accepts_focus = EINA_FALSE;
236 if ((hints->flags & StateHint) && (initial_state))
238 if (hints->initial_state == WithdrawnState)
239 *initial_state = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
240 else if (hints->initial_state == NormalState)
241 *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
242 else if (hints->initial_state == IconicState)
243 *initial_state = ECORE_X_WINDOW_STATE_HINT_ICONIC;
246 if ((hints->flags & IconPixmapHint) && (icon_pixmap))
247 *icon_pixmap = hints->icon_pixmap;
249 if ((hints->flags & IconMaskHint) && (icon_mask))
250 *icon_mask = hints->icon_mask;
252 if ((hints->flags & IconWindowHint) && (icon_window))
253 *icon_window = hints->icon_window;
255 if ((hints->flags & WindowGroupHint) && (window_group))
256 *window_group = hints->window_group;
258 if ((hints->flags & XUrgencyHint) && (is_urgent))
259 *is_urgent = EINA_TRUE;
269 ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
270 Eina_Bool request_pos,
271 Ecore_X_Gravity gravity,
286 LOGFN(__FILE__, __LINE__, __FUNCTION__);
287 if (!XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask))
288 memset(&hint, 0, sizeof(XSizeHints));
292 hint.flags |= USPosition;
294 if (gravity != ECORE_X_GRAVITY_NW)
296 hint.flags |= PWinGravity;
297 hint.win_gravity = gravity;
300 if ((min_w > 0) || (min_h > 0))
302 hint.flags |= PMinSize;
303 hint.min_width = min_w;
304 hint.min_height = min_h;
307 if ((max_w > 0) || (max_h > 0))
309 hint.flags |= PMaxSize;
310 hint.max_width = max_w;
311 hint.max_height = max_h;
314 if ((base_w > 0) || (base_h > 0))
316 hint.flags |= PBaseSize;
317 hint.base_width = base_w;
318 hint.base_height = base_h;
321 if ((step_x > 1) || (step_y > 1))
323 hint.flags |= PResizeInc;
324 hint.width_inc = step_x;
325 hint.height_inc = step_y;
328 if ((min_aspect > 0.0) || (max_aspect > 0.0))
330 hint.flags |= PAspect;
331 hint.min_aspect.x = min_aspect * 10000;
332 hint.min_aspect.y = 10000;
333 hint.max_aspect.x = max_aspect * 10000;
334 hint.max_aspect.y = 10000;
337 XSetWMNormalHints(_ecore_x_disp, win, &hint);
341 ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
342 Eina_Bool *request_pos,
343 Ecore_X_Gravity *gravity,
358 int minw = 0, minh = 0;
359 int maxw = 32767, maxh = 32767;
360 int basew = -1, baseh = -1;
361 int stepx = -1, stepy = -1;
362 double mina = 0.0, maxa = 0.0;
364 LOGFN(__FILE__, __LINE__, __FUNCTION__);
365 if (!XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask))
368 if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
371 *request_pos = EINA_TRUE;
373 else if (request_pos)
374 *request_pos = EINA_FALSE;
376 if (hint.flags & PWinGravity)
379 *gravity = hint.win_gravity;
382 *gravity = ECORE_X_GRAVITY_NW;
384 if (hint.flags & PMinSize)
386 minw = hint.min_width;
387 minh = hint.min_height;
390 if (hint.flags & PMaxSize)
392 maxw = hint.max_width;
393 maxh = hint.max_height;
401 if (hint.flags & PBaseSize)
403 basew = hint.base_width;
404 baseh = hint.base_height;
412 if (hint.flags & PResizeInc)
414 stepx = hint.width_inc;
415 stepy = hint.height_inc;
423 if (hint.flags & PAspect)
425 if (hint.min_aspect.y > 0)
426 mina = ((double)hint.min_aspect.x) / ((double)hint.min_aspect.y);
428 if (hint.max_aspect.y > 0)
429 maxa = ((double)hint.max_aspect.x) / ((double)hint.max_aspect.y);
466 ecore_x_icccm_title_set(Ecore_X_Window win,
476 LOGFN(__FILE__, __LINE__, __FUNCTION__);
478 #ifdef X_HAVE_UTF8_STRING
481 Xutf8TextListToTextProperty(_ecore_x_disp, list, 1, XUTF8StringStyle,
483 #else /* ifdef X_HAVE_UTF8_STRING */
486 XmbTextListToTextProperty(_ecore_x_disp, list, 1, XStdICCTextStyle,
488 #endif /* ifdef X_HAVE_UTF8_STRING */
491 XSetWMName(_ecore_x_disp, win, &xprop);
495 else if (XStringListToTextProperty(list, 1, &xprop) >= Success)
497 XSetWMName(_ecore_x_disp, win, &xprop);
506 ecore_x_icccm_title_get(Ecore_X_Window win)
510 LOGFN(__FILE__, __LINE__, __FUNCTION__);
512 if (XGetWMName(_ecore_x_disp, win, &xprop) >= Success)
521 if (xprop.encoding == ECORE_X_ATOM_UTF8_STRING)
522 t = strdup((char *)xprop.value);
525 /* convert to utf8 */
526 #ifdef X_HAVE_UTF8_STRING
527 ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
529 #else /* ifdef X_HAVE_UTF8_STRING */
530 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
532 #endif /* ifdef X_HAVE_UTF8_STRING */
534 if ((ret == XLocaleNotSupported) ||
535 (ret == XNoMemory) || (ret == XConverterNotFound))
536 t = strdup((char *)xprop.value);
537 else if ((ret >= Success) && (num > 0))
541 XFreeStringList(list);
555 * Set protocol atoms explicitly
556 * @param win The Window
557 * @param protos An array of protocol atoms
558 * @param num the number of members of the array
561 ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win,
562 Ecore_X_Atom *protos,
565 LOGFN(__FILE__, __LINE__, __FUNCTION__);
567 XSetWMProtocols(_ecore_x_disp, win, (Atom *)(protos), num);
569 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_PROTOCOLS);
573 * Set or unset a wm protocol property.
574 * @param win The Window
575 * @param protocol The protocol to enable/disable
579 ecore_x_icccm_protocol_set(Ecore_X_Window win,
580 Ecore_X_WM_Protocol protocol,
585 int protos_count = 0;
589 /* Check for invalid values */
590 if (protocol >= ECORE_X_WM_PROTOCOL_NUM)
593 LOGFN(__FILE__, __LINE__, __FUNCTION__);
594 proto = _ecore_x_atoms_wm_protocols[protocol];
596 if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
602 for (i = 0; i < protos_count; i++)
604 if (protos[i] == proto)
613 Atom *new_protos = NULL;
618 new_protos = malloc((protos_count + 1) * sizeof(Atom));
622 for (i = 0; i < protos_count; i++)
623 new_protos[i] = protos[i];
624 new_protos[protos_count] = proto;
625 XSetWMProtocols(_ecore_x_disp, win, new_protos, protos_count + 1);
633 for (i = 0; i < protos_count; i++)
635 if (protos[i] == proto)
639 for (j = i + 1; j < protos_count; j++)
640 protos[j - 1] = protos[j];
641 if (protos_count > 1)
642 XSetWMProtocols(_ecore_x_disp, win, protos,
645 XDeleteProperty(_ecore_x_disp, win,
646 ECORE_X_ATOM_WM_PROTOCOLS);
659 * Determines whether a protocol is set for a window.
660 * @param win The Window
661 * @param protocol The protocol to query
662 * @return 1 if the protocol is set, else 0.
665 ecore_x_icccm_protocol_isset(Ecore_X_Window win,
666 Ecore_X_WM_Protocol protocol)
668 Atom proto, *protos = NULL;
669 int i, protos_count = 0;
670 Eina_Bool ret = EINA_FALSE;
672 /* check for invalid values */
673 if (protocol >= ECORE_X_WM_PROTOCOL_NUM)
676 LOGFN(__FILE__, __LINE__, __FUNCTION__);
677 proto = _ecore_x_atoms_wm_protocols[protocol];
679 if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
682 for (i = 0; i < protos_count; i++)
683 if (protos[i] == proto)
696 * Set a window name & class.
697 * @param win The window
698 * @param n The name string
699 * @param c The class string
701 * Set a window name * class
704 ecore_x_icccm_name_class_set(Ecore_X_Window win,
710 xch = XAllocClassHint();
714 LOGFN(__FILE__, __LINE__, __FUNCTION__);
715 xch->res_name = (char *)n;
716 xch->res_class = (char *)c;
717 XSetClassHint(_ecore_x_disp, win, xch);
722 * Get a window name & class.
723 * @param win The window
724 * @param n The name string
725 * @param c The class string
727 * Get a window name * class
730 ecore_x_icccm_name_class_get(Ecore_X_Window win,
736 LOGFN(__FILE__, __LINE__, __FUNCTION__);
744 xch.res_class = NULL;
745 if (XGetClassHint(_ecore_x_disp, win, &xch))
749 *n = strdup(xch.res_name);
753 *c = strdup(xch.res_class);
756 XFree(xch.res_class);
761 * Get a window client machine string.
762 * @param win The window
763 * @return The windows client machine string
765 * Return the client machine of a window. String must be free'd when done with.
768 ecore_x_icccm_client_machine_get(Ecore_X_Window win)
772 LOGFN(__FILE__, __LINE__, __FUNCTION__);
773 name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_CLIENT_MACHINE);
778 * Sets the WM_COMMAND property for @a win.
780 * @param win The window.
781 * @param argc Number of arguments.
782 * @param argv Arguments.
785 ecore_x_icccm_command_set(Ecore_X_Window win,
789 LOGFN(__FILE__, __LINE__, __FUNCTION__);
790 XSetCommand(_ecore_x_disp, win, argv, argc);
794 * Get the WM_COMMAND property for @a win.
796 * Return the command of a window. String must be free'd when done with.
798 * @param win The window.
799 * @param argc Number of arguments.
800 * @param argv Arguments.
803 ecore_x_icccm_command_get(Ecore_X_Window win,
816 LOGFN(__FILE__, __LINE__, __FUNCTION__);
817 if (!XGetCommand(_ecore_x_disp, win, &v, &c))
833 (*argv) = malloc(c * sizeof(char *));
843 for (i = 0; i < c; i++)
846 (*argv)[i] = strdup(v[i]);
848 (*argv)[i] = strdup("");
856 * Set a window icon name.
857 * @param win The window
858 * @param t The icon name string
860 * Set a window icon name
863 ecore_x_icccm_icon_name_set(Ecore_X_Window win,
870 LOGFN(__FILE__, __LINE__, __FUNCTION__);
872 #ifdef X_HAVE_UTF8_STRING
874 ret = Xutf8TextListToTextProperty(_ecore_x_disp, list, 1,
875 XUTF8StringStyle, &xprop);
876 #else /* ifdef X_HAVE_UTF8_STRING */
878 ret = XmbTextListToTextProperty(_ecore_x_disp, list, 1,
879 XStdICCTextStyle, &xprop);
880 #endif /* ifdef X_HAVE_UTF8_STRING */
883 XSetWMIconName(_ecore_x_disp, win, &xprop);
887 else if (XStringListToTextProperty(list, 1, &xprop) >= Success)
889 XSetWMIconName(_ecore_x_disp, win, &xprop);
898 * Get a window icon name.
899 * @param win The window
900 * @return The windows icon name string
902 * Return the icon name of a window. String must be free'd when done with.
905 ecore_x_icccm_icon_name_get(Ecore_X_Window win)
909 LOGFN(__FILE__, __LINE__, __FUNCTION__);
911 if (XGetWMIconName(_ecore_x_disp, win, &xprop) >= Success)
920 if (xprop.encoding == ECORE_X_ATOM_UTF8_STRING)
921 t = strdup((char *)xprop.value);
924 /* convert to utf8 */
925 #ifdef X_HAVE_UTF8_STRING
926 ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
928 #else /* ifdef X_HAVE_UTF8_STRING */
929 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
931 #endif /* ifdef X_HAVE_UTF8_STRING */
933 if ((ret == XLocaleNotSupported) ||
934 (ret == XNoMemory) || (ret == XConverterNotFound))
935 t = strdup((char *)xprop.value);
936 else if (ret >= Success)
938 if ((num >= 1) && (list))
942 XFreeStringList(list);
957 * Add a subwindow to the list of windows that need a different colormap installed.
958 * @param win The toplevel window
959 * @param subwin The subwindow to be added to the colormap windows list
962 ecore_x_icccm_colormap_window_set(Ecore_X_Window win,
963 Ecore_X_Window subwin)
966 unsigned char *old_data = NULL;
967 unsigned char *data = NULL;
968 Window *oldset = NULL;
969 Window *newset = NULL;
971 LOGFN(__FILE__, __LINE__, __FUNCTION__);
972 if (!ecore_x_window_prop_property_get(win,
973 ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
974 XA_WINDOW, 32, &old_data, &num))
976 newset = calloc(1, sizeof(Window));
982 data = (unsigned char *)newset;
986 newset = calloc(num + 1, sizeof(Window));
987 oldset = (Window *)old_data;
991 for (i = 0; i < num; ++i)
993 if (oldset[i] == subwin)
1003 newset[i] = oldset[i];
1006 newset[num++] = subwin;
1010 data = (unsigned char *)newset;
1013 ecore_x_window_prop_property_set(win,
1014 ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
1015 XA_WINDOW, 32, data, num);
1020 * Remove a window from the list of colormap windows.
1021 * @param win The toplevel window
1022 * @param subwin The window to be removed from the colormap window list.
1025 ecore_x_icccm_colormap_window_unset(Ecore_X_Window win,
1026 Ecore_X_Window subwin)
1028 int num = 0, i, j, k = 0;
1029 unsigned char *old_data = NULL;
1030 unsigned char *data = NULL;
1031 Window *oldset = NULL;
1032 Window *newset = NULL;
1034 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1035 if (!ecore_x_window_prop_property_get(win,
1036 ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
1037 XA_WINDOW, 32, &old_data, &num))
1040 oldset = (Window *)old_data;
1041 for (i = 0; i < num; i++)
1043 if (oldset[i] == subwin)
1047 XDeleteProperty(_ecore_x_disp,
1048 win, ECORE_X_ATOM_WM_COLORMAP_WINDOWS);
1057 newset = calloc(num - 1, sizeof(Window));
1058 data = (unsigned char *)newset;
1059 for (j = 0; j < num; ++j)
1060 if (oldset[j] != subwin)
1061 newset[k++] = oldset[j];
1063 ecore_x_window_prop_property_set(
1065 ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
1085 * Specify that a window is transient for another top-level window and should be handled accordingly.
1086 * @param win the transient window
1087 * @param forwin the toplevel window
1090 ecore_x_icccm_transient_for_set(Ecore_X_Window win,
1091 Ecore_X_Window forwin)
1093 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1094 XSetTransientForHint(_ecore_x_disp, win, forwin);
1098 * Remove the transient_for setting from a window.
1099 * @param win The window
1102 ecore_x_icccm_transient_for_unset(Ecore_X_Window win)
1104 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1105 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_TRANSIENT_FOR);
1109 * Get the window this window is transient for, if any.
1110 * @param win The window to check
1111 * @return The window ID of the top-level window, or 0 if the property does not exist.
1114 ecore_x_icccm_transient_for_get(Ecore_X_Window win)
1118 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1119 if (XGetTransientForHint(_ecore_x_disp, win, &forwin))
1120 return (Ecore_X_Window)forwin;
1126 * Set the window role hint.
1127 * @param win The window
1128 * @param role The role string
1131 ecore_x_icccm_window_role_set(Ecore_X_Window win,
1134 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1135 ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_WINDOW_ROLE,
1140 * Get the window role.
1141 * @param win The window
1142 * @return The window's role string.
1145 ecore_x_icccm_window_role_get(Ecore_X_Window win)
1147 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1148 return ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_WINDOW_ROLE);
1152 * Set the window's client leader.
1153 * @param win The window
1154 * @param l The client leader window
1156 * All non-transient top-level windows created by an app other than
1157 * the main window must have this property set to the app's main window.
1160 ecore_x_icccm_client_leader_set(Ecore_X_Window win,
1163 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1164 ecore_x_window_prop_window_set(win, ECORE_X_ATOM_WM_CLIENT_LEADER,
1169 * Get the window's client leader.
1170 * @param win The window
1171 * @return The window's client leader window, or 0 if unset */
1173 ecore_x_icccm_client_leader_get(Ecore_X_Window win)
1177 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1178 if (ecore_x_window_prop_window_get(win, ECORE_X_ATOM_WM_CLIENT_LEADER,
1186 ecore_x_icccm_iconic_request_send(Ecore_X_Window win,
1187 Ecore_X_Window root)
1194 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1196 root = DefaultRootWindow(_ecore_x_disp);
1198 xev.xclient.type = ClientMessage;
1199 xev.xclient.serial = 0;
1200 xev.xclient.send_event = True;
1201 xev.xclient.display = _ecore_x_disp;
1202 xev.xclient.window = win;
1203 xev.xclient.format = 32;
1204 xev.xclient.message_type = ECORE_X_ATOM_WM_CHANGE_STATE;
1205 xev.xclient.data.l[0] = IconicState;
1207 XSendEvent(_ecore_x_disp, root, False,
1208 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1211 /* FIXME: there are older E hints, gnome hints and mwm hints and new netwm */
1212 /* hints. each should go in their own file/section so we know which */
1213 /* is which. also older kde hints too. we should try support as much */
1214 /* as makese sense to support */