diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-23 17:13:36 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-23 17:13:36 -0500 |
commit | 2f4ee8ef5d1fe9a8daa9d342d71b021e6a25ca01 (patch) | |
tree | c7c69fbe21ff704ebb8cf74b25627111ed30efdd /experimental/tqtinterface/qt4/src/kernel/tqwidget.cpp | |
parent | 5584c3586a63c9e18513e8df2d6823ec6b33dfc7 (diff) | |
download | tde-2f4ee8ef5d1fe9a8daa9d342d71b021e6a25ca01.tar.gz tde-2f4ee8ef5d1fe9a8daa9d342d71b021e6a25ca01.zip |
Apply all Qt3.3.8d patches
NOTE: This will *likely* break compilation of TQt4
Please wait a few days for fixes to be committed as needed!
Diffstat (limited to 'experimental/tqtinterface/qt4/src/kernel/tqwidget.cpp')
-rw-r--r-- | experimental/tqtinterface/qt4/src/kernel/tqwidget.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/experimental/tqtinterface/qt4/src/kernel/tqwidget.cpp b/experimental/tqtinterface/qt4/src/kernel/tqwidget.cpp index 9e60bacf7..67d0e1be9 100644 --- a/experimental/tqtinterface/qt4/src/kernel/tqwidget.cpp +++ b/experimental/tqtinterface/qt4/src/kernel/tqwidget.cpp @@ -5953,8 +5953,24 @@ void TQWidget::setFocus() if ( isActiveWindow() ) { TQWidget * prev = tqApp->focus_widget; if ( prev ) { - if ( prev != this ) + // This part is never executed when TQ_WS_X11? Preceding XFocusOut + // had already reset focus_widget when received XFocusIn + + // Don't reset input context explicitly here. Whether reset or not + // when focusing out is a responsibility of input methods. For + // example, Japanese input context should not be reset here. The + // context sometimes contains a whole paragraph and has minutes of + // lifetime different to ephemeral one in other languages. The + // input context should be survived until focused again. So we + // delegate the responsibility to input context via + // unfocusInputContext(). + if ( prev != this && prev->isInputMethodEnabled() ) { +#if 0 prev->resetInputContext(); +#else + prev->unfocusInputContext(); +#endif + } } #if defined(TQ_WS_WIN) else { @@ -5962,9 +5978,8 @@ void TQWidget::setFocus() } #endif tqApp->focus_widget = this; -#if defined(TQ_WS_X11) - focusInputContext(); -#endif + if( isInputMethodEnabled() ) + focusInputContext(); #if defined(TQ_WS_WIN) if ( !tqtopLevelWidget()->isPopup() ) @@ -6012,7 +6027,11 @@ void TQWidget::clearFocus() focusProxy()->clearFocus(); return; } else if ( hasFocus() ) { +#if !defined(TQ_WS_X11) resetInputContext(); +#else + unfocusInputContext(); +#endif TQWidget* w = tqApp->tqfocusWidget(); // clear active focus tqApp->focus_widget = 0; @@ -7338,7 +7357,13 @@ bool TQWidget::event( TQEvent *e ) break; case TQEvent::MouseButtonPress: + // Don't reset input context here. Whether reset or not is + // a responsibility of input method. reset() will be + // called by mouseHandler() of input method if necessary + // via mousePressEvent() of text widgets. +#if 0 resetInputContext(); +#endif mousePressEvent( (TQMouseEvent*)e ); if ( ! ((TQMouseEvent*)e)->isAccepted() ) return FALSE; |