forked from enlightenment/efl
be paranoi abotu validating xid's etc.
SVN revision: 5391
This commit is contained in:
parent
0791b79e3e
commit
e394ae50ca
|
@ -118,11 +118,15 @@ e_add_child(Window win, Window child)
|
||||||
E_XID *xid = NULL;
|
E_XID *xid = NULL;
|
||||||
|
|
||||||
if (XFindContext(disp, win, xid_context, (XPointer *) & xid) == XCNOENT)
|
if (XFindContext(disp, win, xid_context, (XPointer *) & xid) == XCNOENT)
|
||||||
{
|
return;
|
||||||
xid = e_validate_xid(win);
|
|
||||||
}
|
|
||||||
if (xid)
|
if (xid)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < xid->children_num; i++)
|
||||||
|
{
|
||||||
|
if (xid->children[i] == child) return;
|
||||||
|
}
|
||||||
xid->children_num++;
|
xid->children_num++;
|
||||||
if (!xid->children)
|
if (!xid->children)
|
||||||
xid->children = NEW(Window, xid->children_num);
|
xid->children = NEW(Window, xid->children_num);
|
||||||
|
@ -207,6 +211,7 @@ e_add_xid(Window win, int x, int y, int w, int h, int depth, Window parent)
|
||||||
xid->gravity = e_window_get_gravity(win);
|
xid->gravity = e_window_get_gravity(win);
|
||||||
xid->bw = 0;
|
xid->bw = 0;
|
||||||
XSaveContext(disp, xid->win, xid_context, (XPointer) xid);
|
XSaveContext(disp, xid->win, xid_context, (XPointer) xid);
|
||||||
|
e_add_child(parent, win);
|
||||||
return xid;
|
return xid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,6 +270,7 @@ e_validate_xid(Window win)
|
||||||
xid->gravity = att.win_gravity;
|
xid->gravity = att.win_gravity;
|
||||||
xid->bw = att.border_width;
|
xid->bw = att.border_width;
|
||||||
XSaveContext(disp, xid->win, xid_context, (XPointer) xid);
|
XSaveContext(disp, xid->win, xid_context, (XPointer) xid);
|
||||||
|
e_add_child(xid->parent, win);
|
||||||
}
|
}
|
||||||
return xid;
|
return xid;
|
||||||
}
|
}
|
||||||
|
@ -282,6 +288,7 @@ e_unvalidate_xid(Window win)
|
||||||
|
|
||||||
for (i = 0; i < xid->children_num; i++)
|
for (i = 0; i < xid->children_num; i++)
|
||||||
e_unvalidate_xid(xid->children[i]);
|
e_unvalidate_xid(xid->children[i]);
|
||||||
|
e_del_child(xid->parent, win);
|
||||||
IF_FREE(xid->children);
|
IF_FREE(xid->children);
|
||||||
FREE(xid);
|
FREE(xid);
|
||||||
XDeleteContext(disp, win, xid_context);
|
XDeleteContext(disp, win, xid_context);
|
||||||
|
@ -323,6 +330,7 @@ e_window_new(Window parent, int x, int y, int w, int h)
|
||||||
CWDontPropagate, &attr);
|
CWDontPropagate, &attr);
|
||||||
e_add_xid(win, x, y, w, h, default_depth, parent);
|
e_add_xid(win, x, y, w, h, default_depth, parent);
|
||||||
e_add_child(parent, win);
|
e_add_child(parent, win);
|
||||||
|
e_validate_xid(parent);
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,6 +357,7 @@ e_window_override_new(Window parent, int x, int y, int w, int h)
|
||||||
CWDontPropagate, &attr);
|
CWDontPropagate, &attr);
|
||||||
e_add_xid(win, x, y, w, h, default_depth, parent);
|
e_add_xid(win, x, y, w, h, default_depth, parent);
|
||||||
e_add_child(parent, win);
|
e_add_child(parent, win);
|
||||||
|
e_validate_xid(parent);
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,6 +377,7 @@ e_window_input_new(Window parent, int x, int y, int w, int h)
|
||||||
CWOverrideRedirect | CWDontPropagate, &attr);
|
CWOverrideRedirect | CWDontPropagate, &attr);
|
||||||
e_add_xid(win, x, y, w, h, 0, parent);
|
e_add_xid(win, x, y, w, h, 0, parent);
|
||||||
e_add_child(parent, win);
|
e_add_child(parent, win);
|
||||||
|
e_validate_xid(parent);
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue