From d07849ff3ef4cfd8ee59eb7a01bdcb6173e788f0 Mon Sep 17 00:00:00 2001 From: Huang Peng Date: Tue, 16 Sep 2008 12:34:27 +0800 Subject: Call setFocusWidget to replace focusOut --- client/qt4/ibus-input-context.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'client/qt4/ibus-input-context.cpp') diff --git a/client/qt4/ibus-input-context.cpp b/client/qt4/ibus-input-context.cpp index c5e85c7..102a241 100644 --- a/client/qt4/ibus-input-context.cpp +++ b/client/qt4/ibus-input-context.cpp @@ -88,9 +88,9 @@ IBusInputContext::reset() void IBusInputContext::update () { - QWidget *widget; + QWidget *widget = focusWidget (); - if ((widget = focusWidget ()) == NULL) + if (widget == NULL) return; QRect rect = widget->inputMethodQuery(Qt::ImMicroFocus).toRect (); @@ -147,11 +147,11 @@ IBusInputContext::setFocusWidget (QWidget *widget) void IBusInputContext::widgetDestroyed (QWidget *widget) { - if (has_focus) { - client->focusOut (this); - has_focus = false; - } QInputContext::widgetDestroyed (widget); + + if (has_focus) + setFocusWidget (NULL); + update (); } -- cgit