Esempio n. 1
0
void QHimePlatformInputContext::setFocusObject(QObject* object)
{
    dbg("QHimePlatformInputContext::setFocusObject\n");
    QWindow *window = qApp->focusWindow();
    if (!window) {
        dbg("no window, focus out\n");
        focused_win = 0;
        char *rstr = NULL;
        hime_im_client_focus_out2(hime_ch, &rstr);
        if (rstr) {
            send_str(rstr);
        } else {
            dbg("no str in preedit\n");
        }
        return;
    }

    WId win = window->winId();

    if (focused_win && win != focused_win) {
        if (hime_ch) {
            hime_im_client_focus_out(hime_ch);
        }
    }

    focused_win = win;

    if (hime_ch) {
        hime_im_client_set_window(hime_ch, win);
        hime_im_client_focus_in(hime_ch);
        cursorMoved();
    }
}
Esempio n. 2
0
void QHIMEInputContext::setHolderWidget( QWidget *widget )
{

    if ( ! widget )
	return;

    QInputContext::setHolderWidget( widget );

//    printf("setHolderWidget %x\n",  widget->winId());

    if (! widget->isTopLevel()) {
	qWarning("QInputContext: cannot create input context for non-toplevel widgets");
	return;
    }

    if (hime_ch) {
        hime_im_client_set_window(hime_ch, widget->winId());
    }
}