Fix the condition when real focus doesn't change (#35)
Co-authored-by: Weng Xuetian <wengxt@gmail.com>
This commit is contained in:
parent
fe938a7717
commit
914bfdf95e
|
@ -425,9 +425,10 @@ void QFcitxPlatformInputContext::commit() { QPlatformInputContext::commit(); }
|
|||
|
||||
void QFcitxPlatformInputContext::setFocusObject(QObject *object) {
|
||||
// Since we have a wrapper, it's possible that real focus object is not
|
||||
// changed.
|
||||
// changed. Do not emit focusOut and focusIn if:
|
||||
// realFocusObject does not change.
|
||||
QObject *realFocusObject = focusObjectWrapper();
|
||||
if (realFocusObject != object && lastObject_ == object) {
|
||||
if (lastObject_ == realFocusObject) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -442,7 +443,7 @@ void QFcitxPlatformInputContext::setFocusObject(QObject *object) {
|
|||
|
||||
QWindow *window = focusWindowWrapper();
|
||||
lastWindow_ = window;
|
||||
lastObject_ = object;
|
||||
lastObject_ = realFocusObject;
|
||||
// Always create IC Data for window.
|
||||
if (window) {
|
||||
proxy = validICByWindow(window);
|
||||
|
|
Loading…
Reference in New Issue