2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
6 * Various ICCCM related functions.
8 * This is ALL the code involving anything ICCCM related. for both WM and
20 #include "ecore_x_private.h"
22 #include "Ecore_X_Atoms.h"
26 ecore_x_icccm_init(void)
28 LOGFN(__FILE__, __LINE__, __FUNCTION__);
32 ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint state)
36 LOGFN(__FILE__, __LINE__, __FUNCTION__);
37 if (state == ECORE_X_WINDOW_STATE_HINT_WITHDRAWN)
38 c[0] = WithdrawnState;
39 else if (state == ECORE_X_WINDOW_STATE_HINT_NORMAL)
41 else if (state == ECORE_X_WINDOW_STATE_HINT_ICONIC)
44 XChangeProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE,
45 ECORE_X_ATOM_WM_STATE, 32, PropModeReplace,
46 (unsigned char *)c, 2);
49 EAPI Ecore_X_Window_State_Hint
50 ecore_x_icccm_state_get(Ecore_X_Window win)
52 unsigned char *prop_ret = NULL;
54 unsigned long bytes_after, num_ret;
56 Ecore_X_Window_State_Hint hint;
58 LOGFN(__FILE__, __LINE__, __FUNCTION__);
59 hint = ECORE_X_WINDOW_STATE_HINT_NONE;
60 XGetWindowProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE,
61 0, 0x7fffffff, False, ECORE_X_ATOM_WM_STATE,
62 &type_ret, &format_ret, &num_ret, &bytes_after,
64 if ((prop_ret) && (num_ret == 2))
66 if (prop_ret[0] == WithdrawnState)
67 hint = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
68 else if (prop_ret[0] == NormalState)
69 hint = ECORE_X_WINDOW_STATE_HINT_NORMAL;
70 else if (prop_ret[0] == IconicState)
71 hint = ECORE_X_WINDOW_STATE_HINT_ICONIC;
81 ecore_x_icccm_delete_window_send(Ecore_X_Window win, Ecore_X_Time t)
83 LOGFN(__FILE__, __LINE__, __FUNCTION__);
84 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
85 ECORE_X_EVENT_MASK_NONE,
86 ECORE_X_ATOM_WM_DELETE_WINDOW,
91 ecore_x_icccm_take_focus_send(Ecore_X_Window win, Ecore_X_Time t)
93 LOGFN(__FILE__, __LINE__, __FUNCTION__);
94 ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
95 ECORE_X_EVENT_MASK_NONE,
96 ECORE_X_ATOM_WM_TAKE_FOCUS,
101 ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time t)
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, int x, int y, int w, int h)
115 LOGFN(__FILE__, __LINE__, __FUNCTION__);
116 ev.type = ConfigureNotify;
117 ev.xconfigure.display = _ecore_x_disp;
118 ev.xconfigure.event = win;
119 ev.xconfigure.window = win;
122 ev.xconfigure.width = w;
123 ev.xconfigure.height = h;
124 ev.xconfigure.border_width = 0;
125 ev.xconfigure.above = None;
126 ev.xconfigure.override_redirect = False;
127 XSendEvent(_ecore_x_disp, win, False, StructureNotifyMask, &ev);
131 ecore_x_icccm_hints_set(Ecore_X_Window win,
133 Ecore_X_Window_State_Hint initial_state,
134 Ecore_X_Pixmap icon_pixmap,
135 Ecore_X_Pixmap icon_mask,
136 Ecore_X_Window icon_window,
137 Ecore_X_Window window_group, int is_urgent)
141 hints = XAllocWMHints();
145 LOGFN(__FILE__, __LINE__, __FUNCTION__);
146 hints->flags = InputHint | StateHint;
147 hints->input = accepts_focus;
148 if (initial_state == ECORE_X_WINDOW_STATE_HINT_WITHDRAWN)
149 hints->initial_state = WithdrawnState;
150 else if (initial_state == ECORE_X_WINDOW_STATE_HINT_NORMAL)
151 hints->initial_state = NormalState;
152 else if (initial_state == ECORE_X_WINDOW_STATE_HINT_ICONIC)
153 hints->initial_state = IconicState;
154 if (icon_pixmap != 0)
156 hints->icon_pixmap = icon_pixmap;
157 hints->flags |= IconPixmapHint;
161 hints->icon_mask = icon_mask;
162 hints->flags |= IconMaskHint;
164 if (icon_window != 0)
166 hints->icon_window = icon_window;
167 hints->flags |= IconWindowHint;
169 if (window_group != 0)
171 hints->window_group = window_group;
172 hints->flags |= WindowGroupHint;
175 hints->flags |= XUrgencyHint;
176 XSetWMHints(_ecore_x_disp, win, hints);
181 ecore_x_icccm_hints_get(Ecore_X_Window win,
183 Ecore_X_Window_State_Hint *initial_state,
184 Ecore_X_Pixmap *icon_pixmap,
185 Ecore_X_Pixmap *icon_mask,
186 Ecore_X_Window *icon_window,
187 Ecore_X_Window *window_group, int *is_urgent)
191 LOGFN(__FILE__, __LINE__, __FUNCTION__);
195 *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
206 hints = XGetWMHints(_ecore_x_disp, win);
209 if ((hints->flags & InputHint) && (accepts_focus))
216 if ((hints->flags & StateHint) && (initial_state))
218 if (hints->initial_state == WithdrawnState)
219 *initial_state = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
220 else if (hints->initial_state == NormalState)
221 *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
222 else if (hints->initial_state == IconicState)
223 *initial_state = ECORE_X_WINDOW_STATE_HINT_ICONIC;
225 if ((hints->flags & IconPixmapHint) && (icon_pixmap))
227 *icon_pixmap = hints->icon_pixmap;
229 if ((hints->flags & IconMaskHint) && (icon_mask))
231 *icon_mask = hints->icon_mask;
233 if ((hints->flags & IconWindowHint) && (icon_window))
235 *icon_window = hints->icon_window;
237 if ((hints->flags & WindowGroupHint) && (window_group))
239 *window_group = hints->window_group;
241 if ((hints->flags & XUrgencyHint) && (is_urgent))
252 ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
254 Ecore_X_Gravity gravity,
255 int min_w, int min_h,
256 int max_w, int max_h,
257 int base_w, int base_h,
258 int step_x, int step_y,
259 double min_aspect, double max_aspect)
264 LOGFN(__FILE__, __LINE__, __FUNCTION__);
265 if (!XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask))
267 memset(&hint, 0, sizeof(XSizeHints));
273 hint.flags |= USPosition;
275 if (gravity != ECORE_X_GRAVITY_NW)
277 hint.flags |= PWinGravity;
278 hint.win_gravity = gravity;
280 if ((min_w > 0) || (min_h > 0))
282 hint.flags |= PMinSize;
283 hint.min_width = min_w;
284 hint.min_height = min_h;
286 if ((max_w > 0) || (max_h > 0))
288 hint.flags |= PMaxSize;
289 hint.max_width = max_w;
290 hint.max_height = max_h;
292 if ((base_w > 0) || (base_h > 0))
294 hint.flags |= PBaseSize;
295 hint.base_width = base_w;
296 hint.base_height = base_h;
298 if ((step_x > 1) || (step_y > 1))
300 hint.flags |= PResizeInc;
301 hint.width_inc = step_x;
302 hint.height_inc = step_y;
304 if ((min_aspect > 0.0) || (max_aspect > 0.0))
306 hint.flags |= PAspect;
307 hint.min_aspect.x = min_aspect * 10000;
308 hint.min_aspect.y = 10000;
309 hint.max_aspect.x = max_aspect * 10000;
310 hint.max_aspect.y = 10000;
312 XSetWMNormalHints(_ecore_x_disp, win, &hint);
316 ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
318 Ecore_X_Gravity *gravity,
319 int *min_w, int *min_h,
320 int *max_w, int *max_h,
321 int *base_w, int *base_h,
322 int *step_x, int *step_y,
323 double *min_aspect, double *max_aspect)
328 int minw = 0, minh = 0;
329 int maxw = 32767, maxh = 32767;
330 int basew = -1, baseh = -1;
331 int stepx = -1, stepy = -1;
332 double mina = 0.0, maxa = 0.0;
334 LOGFN(__FILE__, __LINE__, __FUNCTION__);
335 if (!XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask))
338 if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
348 if (hint.flags & PWinGravity)
351 *gravity = hint.win_gravity;
356 *gravity = ECORE_X_GRAVITY_NW;
358 if (hint.flags & PMinSize)
360 minw = hint.min_width;
361 minh = hint.min_height;
363 if (hint.flags & PMaxSize)
365 maxw = hint.max_width;
366 maxh = hint.max_height;
372 if (hint.flags & PBaseSize)
374 basew = hint.base_width;
375 baseh = hint.base_height;
381 if (hint.flags & PResizeInc)
383 stepx = hint.width_inc;
384 stepy = hint.height_inc;
390 if (hint.flags & PAspect)
392 if (hint.min_aspect.y > 0)
393 mina = ((double)hint.min_aspect.x) / ((double)hint.min_aspect.y);
394 if (hint.max_aspect.y > 0)
395 maxa = ((double)hint.max_aspect.x) / ((double)hint.max_aspect.y);
421 ecore_x_icccm_title_set(Ecore_X_Window win, const char *t)
429 LOGFN(__FILE__, __LINE__, __FUNCTION__);
431 #ifdef X_HAVE_UTF8_STRING
434 Xutf8TextListToTextProperty(_ecore_x_disp, list, 1, XUTF8StringStyle,
439 XmbTextListToTextProperty(_ecore_x_disp, list, 1, XStdICCTextStyle,
444 XSetWMName(_ecore_x_disp, win, &xprop);
445 if (xprop.value) XFree(xprop.value);
449 if (XStringListToTextProperty(list, 1, &xprop) >= Success)
451 XSetWMName(_ecore_x_disp, win, &xprop);
452 if (xprop.value) XFree(xprop.value);
459 ecore_x_icccm_title_get(Ecore_X_Window win)
463 LOGFN(__FILE__, __LINE__, __FUNCTION__);
465 if (XGetWMName(_ecore_x_disp, win, &xprop) >= Success)
474 if (xprop.encoding == ECORE_X_ATOM_UTF8_STRING)
476 t = strdup((char *)xprop.value);
481 /* convert to utf8 */
482 #ifdef X_HAVE_UTF8_STRING
483 ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
486 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
490 if ((ret == XLocaleNotSupported) ||
491 (ret == XNoMemory) || (ret == XConverterNotFound))
493 t = strdup((char *)xprop.value);
495 else if ((ret >= Success) && (num > 0))
500 XFreeStringList(list);
503 if (xprop.value) XFree(xprop.value);
511 * Set protocol atoms explicitly
512 * @param win The Window
513 * @param protos An array of protocol atoms
514 * @param num the number of members of the array
517 ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win, Ecore_X_Atom *protos, int num)
519 LOGFN(__FILE__, __LINE__, __FUNCTION__);
521 XSetWMProtocols(_ecore_x_disp, win, (Atom *)(protos), num);
523 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_PROTOCOLS);
527 * Set or unset a wm protocol property.
528 * @param win The Window
529 * @param protocol The protocol to enable/disable
533 ecore_x_icccm_protocol_set(Ecore_X_Window win,
534 Ecore_X_WM_Protocol protocol, int on)
538 int protos_count = 0;
542 /* Check for invalid values */
543 if (protocol >= ECORE_X_WM_PROTOCOL_NUM)
546 LOGFN(__FILE__, __LINE__, __FUNCTION__);
547 proto = _ecore_x_atoms_wm_protocols[protocol];
549 if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
555 for (i = 0; i < protos_count; i++)
557 if (protos[i] == proto)
566 Atom *new_protos = NULL;
570 new_protos = malloc((protos_count + 1) * sizeof(Atom));
573 for (i = 0; i < protos_count; i++)
574 new_protos[i] = protos[i];
575 new_protos[protos_count] = proto;
576 XSetWMProtocols(_ecore_x_disp, win, new_protos, protos_count + 1);
583 for (i = 0; i < protos_count; i++)
585 if (protos[i] == proto)
589 for (j = i + 1; j < protos_count; j++)
590 protos[j - 1] = protos[j];
591 if (protos_count > 1)
592 XSetWMProtocols(_ecore_x_disp, win, protos,
595 XDeleteProperty(_ecore_x_disp, win,
596 ECORE_X_ATOM_WM_PROTOCOLS);
609 * Determines whether a protocol is set for a window.
610 * @param win The Window
611 * @param protocol The protocol to query
612 * @return 1 if the protocol is set, else 0.
615 ecore_x_icccm_protocol_isset(Ecore_X_Window win, Ecore_X_WM_Protocol protocol)
617 Atom proto, *protos = NULL;
618 int i, ret = 0, protos_count = 0;
620 /* check for invalid values */
621 if (protocol >= ECORE_X_WM_PROTOCOL_NUM)
624 LOGFN(__FILE__, __LINE__, __FUNCTION__);
625 proto = _ecore_x_atoms_wm_protocols[protocol];
627 if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
630 for (i = 0; i < protos_count; i++)
631 if (protos[i] == proto)
637 if (protos) XFree(protos);
643 * Set a window name & class.
644 * @param win The window
645 * @param n The name string
646 * @param c The class string
648 * Set a window name * class
651 ecore_x_icccm_name_class_set(Ecore_X_Window win, const char *n, const char *c)
655 xch = XAllocClassHint();
658 LOGFN(__FILE__, __LINE__, __FUNCTION__);
659 xch->res_name = (char *)n;
660 xch->res_class = (char *)c;
661 XSetClassHint(_ecore_x_disp, win, xch);
666 * Get a window name & class.
667 * @param win The window
668 * @param n The name string
669 * @param c The class string
671 * Get a window name * class
674 ecore_x_icccm_name_class_get(Ecore_X_Window win, char **n, char **c)
678 LOGFN(__FILE__, __LINE__, __FUNCTION__);
682 xch.res_class = NULL;
683 if (XGetClassHint(_ecore_x_disp, win, &xch))
687 if (xch.res_name) *n = strdup(xch.res_name);
691 if (xch.res_class) *c = strdup(xch.res_class);
694 XFree(xch.res_class);
699 * Get a window client machine string.
700 * @param win The window
701 * @return The windows client machine string
703 * Return the client machine of a window. String must be free'd when done with.
706 ecore_x_icccm_client_machine_get(Ecore_X_Window win)
710 LOGFN(__FILE__, __LINE__, __FUNCTION__);
711 name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_CLIENT_MACHINE);
716 * Sets the WM_COMMAND property for @a win.
718 * @param win The window.
719 * @param argc Number of arguments.
720 * @param argv Arguments.
723 ecore_x_icccm_command_set(Ecore_X_Window win, int argc, char **argv)
725 LOGFN(__FILE__, __LINE__, __FUNCTION__);
726 XSetCommand(_ecore_x_disp, win, argv, argc);
730 * Get the WM_COMMAND property for @a win.
732 * Return the command of a window. String must be free'd when done with.
734 * @param win The window.
735 * @param argc Number of arguments.
736 * @param argv Arguments.
739 ecore_x_icccm_command_get(Ecore_X_Window win, int *argc, char ***argv)
745 if (argv) *argv = NULL;
747 LOGFN(__FILE__, __LINE__, __FUNCTION__);
748 if (!XGetCommand(_ecore_x_disp, win, &v, &c))
760 (*argv) = malloc(c * sizeof(char *));
767 for (i = 0; i < c; i++)
770 (*argv)[i] = strdup(v[i]);
772 (*argv)[i] = strdup("");
779 * Set a window icon name.
780 * @param win The window
781 * @param t The icon name string
783 * Set a window icon name
786 ecore_x_icccm_icon_name_set(Ecore_X_Window win, const char *t)
792 LOGFN(__FILE__, __LINE__, __FUNCTION__);
794 #ifdef X_HAVE_UTF8_STRING
796 ret = Xutf8TextListToTextProperty(_ecore_x_disp, list, 1,
797 XUTF8StringStyle, &xprop);
800 ret = XmbTextListToTextProperty(_ecore_x_disp, list, 1,
801 XStdICCTextStyle, &xprop);
805 XSetWMIconName(_ecore_x_disp, win, &xprop);
806 if (xprop.value) XFree(xprop.value);
810 if (XStringListToTextProperty(list, 1, &xprop) >= Success)
812 XSetWMIconName(_ecore_x_disp, win, &xprop);
813 if (xprop.value) XFree(xprop.value);
820 * Get a window icon name.
821 * @param win The window
822 * @return The windows icon name string
824 * Return the icon name of a window. String must be free'd when done with.
827 ecore_x_icccm_icon_name_get(Ecore_X_Window win)
831 LOGFN(__FILE__, __LINE__, __FUNCTION__);
833 if (XGetWMIconName(_ecore_x_disp, win, &xprop) >= Success)
842 if (xprop.encoding == ECORE_X_ATOM_UTF8_STRING)
844 t = strdup((char *)xprop.value);
849 /* convert to utf8 */
850 #ifdef X_HAVE_UTF8_STRING
851 ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
854 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
858 if ((ret == XLocaleNotSupported) ||
859 (ret == XNoMemory) || (ret == XConverterNotFound))
861 t = strdup((char *)xprop.value);
863 else if (ret >= Success)
865 if ((num >= 1) && (list))
870 XFreeStringList(list);
874 if (xprop.value) XFree(xprop.value);
882 * Add a subwindow to the list of windows that need a different colormap installed.
883 * @param win The toplevel window
884 * @param subwin The subwindow to be added to the colormap windows list
887 ecore_x_icccm_colormap_window_set(Ecore_X_Window win, Ecore_X_Window subwin)
890 unsigned char *old_data = NULL;
891 unsigned char *data = NULL;
892 Window *oldset = NULL;
893 Window *newset = NULL;
895 LOGFN(__FILE__, __LINE__, __FUNCTION__);
896 if (!ecore_x_window_prop_property_get(win,
897 ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
898 XA_WINDOW, 32, &old_data, &num))
900 newset = calloc(1, sizeof(Window));
905 data = (unsigned char *)newset;
909 newset = calloc(num + 1, sizeof(Window));
910 oldset = (Window *) old_data;
913 for (i = 0; i < num; ++i)
915 if (oldset[i] == subwin)
917 if (old_data) XFree(old_data);
923 newset[i] = oldset[i];
926 newset[num++] = subwin;
927 if (old_data) XFree(old_data);
928 data = (unsigned char *)newset;
931 ecore_x_window_prop_property_set(win,
932 ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
933 XA_WINDOW, 32, data, num);
938 * Remove a window from the list of colormap windows.
939 * @param win The toplevel window
940 * @param subwin The window to be removed from the colormap window list.
943 ecore_x_icccm_colormap_window_unset(Ecore_X_Window win, Ecore_X_Window subwin)
945 int num = 0, i, j, k = 0;
946 unsigned char *old_data = NULL;
947 unsigned char *data = NULL;
948 Window *oldset = NULL;
949 Window *newset = NULL;
951 LOGFN(__FILE__, __LINE__, __FUNCTION__);
952 if (!ecore_x_window_prop_property_get(win,
953 ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
954 XA_WINDOW, 32, &old_data, &num))
957 oldset = (Window *) old_data;
958 for (i = 0; i < num; i++)
960 if (oldset[i] == subwin)
964 XDeleteProperty(_ecore_x_disp,
965 win, ECORE_X_ATOM_WM_COLORMAP_WINDOWS);
966 if (old_data) XFree(old_data);
972 newset = calloc(num - 1, sizeof(Window));
973 data = (unsigned char *)newset;
974 for (j = 0; j < num; ++j)
975 if (oldset[j] != subwin)
976 newset[k++] = oldset[j];
977 ecore_x_window_prop_property_set(win,
978 ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
979 XA_WINDOW, 32, data, k);
980 if (old_data) XFree(old_data);
988 if (old_data) XFree(old_data);
992 * Specify that a window is transient for another top-level window and should be handled accordingly.
993 * @param win the transient window
994 * @param forwin the toplevel window
997 ecore_x_icccm_transient_for_set(Ecore_X_Window win, Ecore_X_Window forwin)
999 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1000 XSetTransientForHint(_ecore_x_disp, win, forwin);
1004 * Remove the transient_for setting from a window.
1008 ecore_x_icccm_transient_for_unset(Ecore_X_Window win)
1010 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1011 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_TRANSIENT_FOR);
1015 * Get the window this window is transient for, if any.
1016 * @param win The window to check
1017 * @return The window ID of the top-level window, or 0 if the property does not exist.
1020 ecore_x_icccm_transient_for_get(Ecore_X_Window win)
1024 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1025 if (XGetTransientForHint(_ecore_x_disp, win, &forwin))
1026 return (Ecore_X_Window) forwin;
1033 * Set the window role hint.
1034 * @param win The window
1035 * @param role The role string
1038 ecore_x_icccm_window_role_set(Ecore_X_Window win, const char *role)
1040 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1041 ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_WINDOW_ROLE,
1046 * Get the window role.
1047 * @param win The window
1048 * @return The window's role string.
1051 ecore_x_icccm_window_role_get(Ecore_X_Window win)
1053 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1054 return ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_WINDOW_ROLE);
1058 * Set the window's client leader.
1059 * @param win The window
1060 * @param l The client leader window
1062 * All non-transient top-level windows created by an app other than
1063 * the main window must have this property set to the app's main window.
1066 ecore_x_icccm_client_leader_set(Ecore_X_Window win, Ecore_X_Window l)
1068 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1069 ecore_x_window_prop_window_set(win, ECORE_X_ATOM_WM_CLIENT_LEADER,
1074 * Get the window's client leader.
1075 * @param win The window
1076 * @return The window's client leader window, or 0 if unset */
1078 ecore_x_icccm_client_leader_get(Ecore_X_Window win)
1082 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1083 if (ecore_x_window_prop_window_get(win, ECORE_X_ATOM_WM_CLIENT_LEADER,
1090 ecore_x_icccm_iconic_request_send(Ecore_X_Window win, Ecore_X_Window root)
1095 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1096 if (!root) root = DefaultRootWindow(_ecore_x_disp);
1098 xev.xclient.type = ClientMessage;
1099 xev.xclient.serial = 0;
1100 xev.xclient.send_event = True;
1101 xev.xclient.display = _ecore_x_disp;
1102 xev.xclient.window = win;
1103 xev.xclient.format = 32;
1104 xev.xclient.message_type = ECORE_X_ATOM_WM_CHANGE_STATE;
1105 xev.xclient.data.l[0] = IconicState;
1107 XSendEvent(_ecore_x_disp, root, False,
1108 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1111 /* FIXME: there are older E hints, gnome hints and mwm hints and new netwm */
1112 /* hints. each should go in their own file/section so we know which */
1113 /* is which. also older kde hints too. we should try support as much */
1114 /* as makese sense to support */