LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: 寒水远山

用XIM输入假死的问题

[复制链接]
 楼主| 发表于 2006-8-5 21:08:50 | 显示全部楼层
Post by Thruth
QT3 的 bug 吧?

请问怎么解决这个bug`?
回复 支持 反对

使用道具 举报

发表于 2006-8-6 14:12:23 | 显示全部楼层
qt 打Ç immodules 补丁吗?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-8-7 19:12:03 | 显示全部楼层
Post by KanKer
qt 打Ç immodules 补丁吗?

不太清楚  我用的是Kubuntu的KDE Qt是自动安装的  输入框右键里面有"Select Input Method"
回复 支持 反对

使用道具 举报

发表于 2006-8-8 09:14:57 | 显示全部楼层
那就是打过了。fcitx-3.x 在未打 immodules 补丁的 qt 上会出现按一个键出多个字母的现象,不过给 qt 打个小补丁,禁止在窗口标题栏调出输入法后可以解决这个问题,用 3.2 以上版本偶而会出现假死现象,不严重。用 3.1.1 便没有任何问题了。
补丁如下:

  1. --- qt-x11-free-3.3.6-snapshot-20060104/src/kernel/qwidget_x11.cpp.orig        2006-01-04 00:54:31.000000000 +0000
  2. +++ qt-x11-free-3.3.6-snapshot-20060104/src/kernel/qwidget_x11.cpp        2006-01-10 18:37:55.000000000 +0000
  3. @@ -1440,7 +1440,7 @@
  4. void QWidget::setActiveWindow()
  5. {
  6.      QWidget *tlw = topLevelWidget();
  7. -    if ( tlw->isVisible() && !tlw->topData()->embedded && !qt_deferred_map_contains(tlw) ) {
  8. +    if ( tlw->isVisible() && !tlw->topData()->embedded && !qt_deferred_map_contains(tlw) && !tlw->isDesktop() && !tlw->isPopup()) {
  9.         XSetInputFocus( x11Display(), tlw->winId(), RevertToNone, qt_x_time);

  10. #ifndef QT_NO_XIM
  11. @@ -2674,7 +2674,7 @@
  12.      QTLWExtra *topdata = tlw->topData();

  13. #ifndef QT_NO_XIM
  14. -    if (qt_xim) {
  15. +    if (qt_xim && !tlw->isDesktop() && !tlw->isPopup()) {
  16.         if (! topdata->xic) {
  17.             QInputContext *qic = new QInputContext(tlw);
  18.             topdata->xic = (void *) qic;
  19. @@ -2709,6 +2709,9 @@
  20.         QWidget *tlw = topLevelWidget();
  21.         QTLWExtra *topdata = tlw->topData();

  22. +        //check tlw is desktop or popup or not
  23. +        if (tlw->isDesktop() || tlw->isPopup())
  24. +                return
  25.         // trigger input context creation if it hasn't happened already
  26.         createInputContext();

  27. @@ -2727,6 +2730,9 @@
  28.      QWidget *tlw = topLevelWidget();
  29.      QTLWExtra *topdata = tlw->topData();

  30. +        //check tlw is desktop or popup or not
  31. +        if (tlw->isDesktop() || tlw->isPopup())
  32. +                return
  33.      // trigger input context creation if it hasn't happened already
  34.      createInputContext();

  35. --- qt-x11-free-3.3.6-snapshot-20060110/src/kernel/qapplication_x11.cpp.orig        2006-01-10 19:19:46.000000000 +0000
  36. +++ qt-x11-free-3.3.6-snapshot-20060110/src/kernel/qapplication_x11.cpp        2006-01-13 00:32:04.000000000 +0000
  37. @@ -5046,7 +5046,7 @@

  38.      if ( type == QEvent::KeyPress ) {
  39.         bool mb=FALSE;
  40. -        if ( qt_xim ) {
  41. +        if ( qt_xim && !tlw->isDesktop() && !tlw->isPopup() ) {
  42.             QTLWExtra*  xd = tlw->topData();
  43.             QInputContext *qic = (QInputContext *) xd->xic;
  44.             if ( qic ) {
  45. --- qt-x11-free-3.3.6-snapshot-20060110/src/kernel/qinputcontext_x11.cpp.xim_fix        2006-01-10 00:50:32.000000000 +0000
  46. +++ qt-x11-free-3.3.6-snapshot-20060110/src/kernel/qinputcontext_x11.cpp        2006-01-17 01:01:08.000000000 +0000
  47. @@ -145,7 +145,7 @@
  48.         }

  49.         bool send_imstart = FALSE;
  50. -        if (qApp->focusWidget() != qic->focusWidget && qic->text.isEmpty()) {
  51. +        if (qApp->focusWidget() != qic->focusWidget) {
  52.             if (qic->focusWidget) {
  53. #ifdef QT_XIM_DEBUG
  54.                 qDebug( "sending IMEnd (empty) to %p", qic->focusWidget );
  55. @@ -324,7 +324,7 @@
  56.         return;
  57.      }

  58. -    if (! widget->isTopLevel()) {
  59. +    if (! widget->isTopLevel() || widget->isDesktop() || widget->isPopup()) {
  60.         qWarning("QInputContext: cannot create input context for non-toplevel widgets");
  61.         return;
  62.      }
复制代码
回复 支持 反对

使用道具 举报

发表于 2006-8-8 09:37:53 | 显示全部楼层
这个假死的现象的确很讨厌,但3.1.1和3.2.1在这方面并没有什么区别才是
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表