static void
DestroyAllIM(XawVendorShellExtPart *ve)
{
    XawIcTableList	p;
    contextErrDataRec *contextErrData;

    /*
     * Destory all ICs
     */
    if (IsSharedIC(ve)) {
        if ((p = ve->ic.shared_ic_table) && p->xic) {
            DestroyIC(p->widget, ve);
            p->xic = NULL;
            p->ic_focused = FALSE;
        }
    } else {
	for (p = ve->ic.ic_table; p; p = p->next) {
	    if (p->xic == NULL) continue;
	    DestroyIC(p->widget, ve);
	    p->xic = NULL;
	    p->ic_focused = FALSE;
	}
    }
    if (!ve->im.xim) return;
    /*
     * Close Input Method
     */
    if (!XFindContext(XDisplayOfIM(ve->im.xim), (Window)(uintptr_t)ve->im.xim, errContext,
		      (XPointer*)&contextErrData)) {
	if (contextErrData) XtFree((char *)contextErrData);
    }
    XDeleteContext(XDisplayOfIM(ve->im.xim), (Window)(uintptr_t)ve->im.xim, errContext);
    CloseIM(ve);
    ve->im.xim = NULL;

    /*
     * resize vendor shell to core size
     */
    (void) SetVendorShellHeight(ve, 0);
    /*
    XawVendorShellExtResize(vw);
    */
    return;
}
static void
Unregister(Widget inwidg, XawVendorShellExtPart *ve)
{
    if (!IsRegistered(inwidg, ve)) return;

    DestroyIC(inwidg, ve);

    UnregisterFromVendorShell(inwidg, ve);

    if (NoRegistered(ve))
	{
	    CloseIM(ve);
	    ve->im.xim = NULL;
	    /*
	     * resize vendor shell to core size
	    */
	    (void) SetVendorShellHeight(ve, 0);
	}
}
Exemple #3
0
Bool MyDestroyICHandler (IMChangeICStruct * call_data)
{
    if (CurrentIC == (IC *) FindIC (call_data->icid)) {
        CloseInputWindow();
        if (!bUseDBus)
            XUnmapWindow (dpy, VKWindow);
    }

    DestroyIC (call_data);
    DestroyICID(call_data->icid);

#ifdef _ENABLE_DBUS
    if (bUseDBus) {
        strcpy(logo_prop.label, "Fcitx");
        updateProperty(&logo_prop);
    }
#endif

    return True;
}