rem: while (!panel->done) { XEvent event;  WMNextEvent(dpy, &event); WMHandleEvent(&event); }
add: WMRunModalLoop(WMWidgetScreen(panel->win), WMWidgetView(panel->win));
context: wInputDialog(WScreen *scr, char *title, char *message, char **text){    WWindow *wwin;    Window parent;    WMInputPanel *panel;    char *result;        panel = WMCreateInputPanel(scr->wmscreen, NULL, title, message, *text,			       _("OK"), _("Cancel"));    parent = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, 320, 160, 0, 0, 0);    XSelectInput(dpy, parent, KeyPressMask|KeyReleaseMask);    XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);    wwin = wManageInternalWindow(scr, parent, None, NULL, 				 (scr->scr_width - 320)/2,				 (scr->scr_height - 160)/2, 320, 160);    wwin->client_leader = WMWidgetXID(panel->win);    WMMapWidget(panel->win);        wWindowMap(wwin);        while (!panel->done) {	XEvent event;		WMNextEvent(dpy, &event);	WMHandleEvent(&event);    }        if (panel->result == WAPRDefault)	result = WMGetTextFieldText(panel->text);    else	result = NULL;        wUnmanageWindow(wwin, False, False);        WMDestroyInputPanel(panel);    XDestroyWindow(dpy, parent);    if (result==NULL)	return False;    else {        if (*text)            wfree(*text);        *text = result;        return True;    }}