Author: ek.kato
Date: Wed Aug 27 21:34:11 2008
New Revision: 5537

Modified:
   branches/1.5/gtk/gtk-im-uim.c
   branches/1.5/qt4/immodule/candidatewindow.cpp
   branches/1.5/scm/tutcode.scm
   branches/1.5/uim/skk.c
   branches/1.5/xim/ximim.cpp
   branches/1.5/xim/ximtrans.cpp

Log:
* Port r5531:5536 from trunk.


Modified: branches/1.5/gtk/gtk-im-uim.c
==============================================================================
--- branches/1.5/gtk/gtk-im-uim.c       (original)
+++ branches/1.5/gtk/gtk-im-uim.c       Wed Aug 27 21:34:11 2008
@@ -1250,11 +1250,11 @@
       uic->preedit_window = gtk_window_new(GTK_WINDOW_POPUP);
       preedit_label = gtk_label_new("");
       gtk_container_add(GTK_CONTAINER(uic->preedit_window), preedit_label);
+      gtk_widget_show(preedit_label);
     }
     uic->preedit_handler_id =
       g_signal_connect(G_OBJECT(ic), "preedit-changed",
                       G_CALLBACK(show_preedit), preedit_label);
-    gtk_widget_show_all(uic->preedit_window);
   } else {
     if (uic->preedit_handler_id) {
       g_signal_handler_disconnect(G_OBJECT(ic), uic->preedit_handler_id);

Modified: branches/1.5/qt4/immodule/candidatewindow.cpp
==============================================================================
--- branches/1.5/qt4/immodule/candidatewindow.cpp       (original)
+++ branches/1.5/qt4/immodule/candidatewindow.cpp       Wed Aug 27 21:34:11 2008
@@ -98,7 +98,7 @@

     isAlwaysLeft = false;

-    subWin = new SubWindow( 0 );
+    subWin = NULL;
 }

 CandidateWindow::~CandidateWindow()
@@ -123,11 +123,15 @@
     candidateIndex = -1;
     displayLimit = dLimit;
     pageIndex = 0;
+
+    if ( !subWin )
+        subWin = new SubWindow( this );
 }

 void CandidateWindow::deactivateCandwin()
 {
-    subWin->cancelHook();
+    if ( subWin )
+        subWin->cancelHook();

     hide();
     clearCandidates();
@@ -378,14 +382,16 @@

 void CandidateWindow::slotHookSubwindow( Q3ListViewItem * item )
 {
-    // cancel previous hook
-    subWin->cancelHook();
-
-    // hook annotation
-    QString annotationString = item->text( 2 );
-    if ( !annotationString.isEmpty() )
-    {
-        subWin->hookPopup( "Annotation", annotationString );
+    if ( subWin ) {
+        // cancel previous hook
+        subWin->cancelHook();
+
+        // hook annotation
+        QString annotationString = item->text( 2 );
+        if ( !annotationString.isEmpty() )
+        {
+            subWin->hookPopup( "Annotation", annotationString );
+        }
     }
 }

@@ -393,13 +399,15 @@
 void CandidateWindow::moveEvent( QMoveEvent *e )
 {
     // move subwindow
-    subWin->layoutWindow( e->pos().x() + width(), e->pos().y() );
+    if ( subWin )
+        subWin->layoutWindow( e->pos().x() + width(), e->pos().y() );
 }

 void CandidateWindow::resizeEvent( QResizeEvent *e )
 {
     // move subwindow
-    subWin->layoutWindow( pos().x() + e->size().width(), pos().y() );
+    if ( subWin )
+        subWin->layoutWindow( pos().x() + e->size().width(), pos().y() );
 }



Modified: branches/1.5/scm/tutcode.scm
==============================================================================
--- branches/1.5/scm/tutcode.scm        (original)
+++ branches/1.5/scm/tutcode.scm        Wed Aug 27 21:34:11 2008
@@ -335,7 +335,10 @@
                      (else
                        (quotient nth tutcode-nr-candidate-max))))
          (cur-offset (* cur-page tutcode-nr-candidate-max))
- (cur-labels (list-tail tutcode-heading-label-char-list cur-offset))
+         (cur-labels (list-tail
+                       tutcode-heading-label-char-list
+                       (remainder cur-offset
+ (length tutcode-heading-label-char-list))))
          (target-labels (member ch cur-labels))
          (offset (if target-labels
                    (- (length cur-labels) (length target-labels))

Modified: branches/1.5/uim/skk.c
==============================================================================
--- branches/1.5/uim/skk.c      (original)
+++ branches/1.5/uim/skk.c      Wed Aug 27 21:34:11 2008
@@ -3596,19 +3596,20 @@

     if (connect(sock, ai->ai_addr, ai->ai_addrlen) == 0)
       break;
-    else
-      /* FIXME: gettext here to expand %s in accordance with the
-       * locale for the selected notification agent. See also the TODO
-       * comment of uim-notify.h  -- YamaKen 2008-02-11 */
- uim_notify_fatal(N_("uim-skk: connect to %s port %s failed"), hostname, port);
+
     close(sock);
     sock = -1;
   }

   freeaddrinfo(aitop);

-  if (sock == -1)
+  if (sock == -1) {
+    /* FIXME: gettext here to expand %s in accordance with the
+     * locale for the selected notification agent. See also the TODO
+     * comment of uim-notify.h  -- YamaKen 2008-02-11 */
+ uim_notify_fatal(N_("uim-skk: connect to %s port %s failed"), hostname, port);
     return 0;
+  }

 #if 0
   uim_notify_info("uim-skk: SKKSERVER=%s", hostname);

Modified: branches/1.5/xim/ximim.cpp
==============================================================================
--- branches/1.5/xim/ximim.cpp  (original)
+++ branches/1.5/xim/ximim.cpp  Wed Aug 27 21:34:11 2008
@@ -126,7 +126,6 @@
     if (!ic) {
        mConn->push_error_packet(mID, icid,
                                 ERR_Style, "invalid im style");
-       mConn->terminate();
        return;
     }
     std::pair<C16, XimIC *> n(ic->get_icid(), ic);

Modified: branches/1.5/xim/ximtrans.cpp
==============================================================================
--- branches/1.5/xim/ximtrans.cpp       (original)
+++ branches/1.5/xim/ximtrans.cpp       Wed Aug 27 21:34:11 2008
@@ -613,10 +613,6 @@
        rlen += 4;
     }

-    // since only one IMAttribute...
-    t->pushC16(imid);
-    t->pushC16(16); // length
-
     // XIMATTRIBUTE
     C16 nr_style;
     struct input_style *is = get_im_by_id(imid)->getInputStyles();
@@ -624,8 +620,12 @@
        ;
     }

+    // since only one IMAttribute...
+    t->pushC16(imid);
+    t->pushC16((C16)(8 + nr_style * 4));
+
     t->pushC16(0); // attribute id
-    t->pushC16((C16)(nr_style * 4)); // length
+    t->pushC16((C16)(4 + nr_style * 4)); // length

     t->pushC16(nr_style); // number
     t->pushC16(0);

Reply via email to