The almighty nuke function. Use at your own risk! :)

SVN revision: 7552
This commit is contained in:
jeoparde 2003-10-12 07:12:09 +00:00 committed by jeoparde
parent 812140933f
commit 859c0c9bb4
2 changed files with 36 additions and 0 deletions

View File

@ -492,6 +492,7 @@ void ecore_x_double_click_time_set(double t);
double ecore_x_double_click_time_get(void);
void ecore_x_flush(void);
void ecore_x_sync(void);
void ecore_x_killall(Ecore_X_Window root);
void ecore_x_error_handler_set(void (*func) (void *data), const void *data);
void ecore_x_io_error_handler_set(void (*func) (void *data), const void *data);

View File

@ -371,6 +371,41 @@ ecore_x_sync(void)
XSync(_ecore_x_disp, False);
}
void
ecore_x_killall(Ecore_X_Window root)
{
int screens;
int i, j;
XGrabServer(_ecore_x_disp);
screens = ScreenCount(_ecore_x_disp);
/* Tranverse window tree starting from root, and drag each
* before the firing squad */
for (i = 0; i < screens; ++i)
{
Window root_r;
Window parent_r;
Window *children_r = NULL;
int num_children = 0;
Window root = RootWindow(d->display, i);
while (XQueryTree(_ecore_x_disp, root, &root_r, &parent_r,
&children_r, &num_children) && num_children > 0)
{
for (j = 0; j < num_children; ++j)
{
XKillClient(_ecore_x_disp, children_r[j]);
}
XFree(children_r);
}
}
XUngrabServer(_ecore_x_disp);
XSync(_ecore_x_disp, False);
}
static int
_ecore_x_fd_handler(void *data, Ecore_Fd_Handler *fd_handler)
{