Loading ...
Sorry, an error occurred while loading the content.

Vim can't start preedit with some XIM on gtk2.

Expand Messages
  • Yasuhiro Matsumoto
    Hello all. Vim can t start preedit with some XIM on gtk2. I use kinput2 version 3.0 I notice that gtk2 s behavior is not same as gtk s one. following patch
    Message 1 of 3 , Apr 24, 2003
    • 0 Attachment
      Hello all.

      Vim can't start preedit with some XIM on gtk2.
      I use kinput2 version 3.0

      I notice that gtk2's behavior is not same as gtk's one.
      following patch make the same as gtk's behavior.
      (if imactivatekey is not set, the behaviror depend on XIM serevr)

      on my environment, it seems ok to me.
      Bram, please check and include.

      Thanks.

      *** src/mbyte.c~ Tue Apr 22 00:25:21 2003
      --- src/mbyte.c Thu Apr 24 17:05:43 2003
      ***************
      *** 2968,2973 ****
      --- 2968,2991 ----
      }

      /*
      + * Callback invoked after start to the preedit.
      + */
      + static void
      + im_preedit_start_cb(GtkIMContext *context, gpointer data)
      + {
      + im_is_active = TRUE;
      + }
      +
      + /*
      + * Callback invoked after end to the preedit.
      + */
      + static void
      + im_preedit_end_cb(GtkIMContext *context, gpointer data)
      + {
      + im_is_active = FALSE;
      + }
      +
      + /*
      * Callback invoked after changes to the preedit string. If the preedit
      * string was empty before, remember the preedit start column so we know
      * where to apply feedback attributes. Delete the previous preedit string
      ***************
      *** 3180,3185 ****
      --- 3198,3207 ----
      G_CALLBACK(&im_commit_cb), NULL);
      g_signal_connect(G_OBJECT(xic), "preedit_changed",
      G_CALLBACK(&im_preedit_changed_cb), NULL);
      + g_signal_connect(G_OBJECT(xic), "preedit_start",
      + G_CALLBACK(&im_preedit_start_cb), NULL);
      + g_signal_connect(G_OBJECT(xic), "preedit_end",
      + G_CALLBACK(&im_preedit_end_cb), NULL);

      gtk_im_context_set_client_window(xic, gui.drawarea->window);
      }
      ***************
      *** 3378,3390 ****
      if (gtk_main_level() > 0)
      gtk_main_quit();
      }
      ! return TRUE;
      }

      /* Don't filter events through the IM context if IM isn't active
      * right now. Unlike with GTK+ 1.2 we cannot rely on the IM module
      * not doing anything before the activation key was sent. */
      ! if (im_is_active)
      return gtk_im_context_filter_keypress(xic, event);
      }

      --- 3400,3412 ----
      if (gtk_main_level() > 0)
      gtk_main_quit();
      }
      ! return FALSE;
      }

      /* Don't filter events through the IM context if IM isn't active
      * right now. Unlike with GTK+ 1.2 we cannot rely on the IM module
      * not doing anything before the activation key was sent. */
      ! if (im_activatekey_keyval == GDK_VoidSymbol || im_is_active)
      return gtk_im_context_filter_keypress(xic, event);
      }

      --

      - Yasuhiro


      _________________________________________________________________
      Help STOP SPAM with the new MSN 8 and get 2 months FREE*
      http://join.msn.com/?page=features/junkmail
    • Bram Moolenaar
      ... As usual, I don t use this code and can t check it. Thus I m glad you are looking into this. I ll include the patch, unless someone tells me this is not a
      Message 2 of 3 , Apr 24, 2003
      • 0 Attachment
        Yasuhiro Matsumoto wrote:

        > Vim can't start preedit with some XIM on gtk2.
        > I use kinput2 version 3.0
        >
        > I notice that gtk2's behavior is not same as gtk's one.
        > following patch make the same as gtk's behavior.
        > (if imactivatekey is not set, the behaviror depend on XIM serevr)
        >
        > on my environment, it seems ok to me.
        > Bram, please check and include.

        As usual, I don't use this code and can't check it. Thus I'm glad you
        are looking into this.

        I'll include the patch, unless someone tells me this is not a good
        solution.

        --
        hundred-and-one symptoms of being an internet addict:
        48. You get a tatoo that says "This body best viewed with Netscape 3.1 or
        higher."

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
      • Nam SungHyun
        ... With the patch, I have a problem with imhangul(GTK IM module) and ami(XIM). With imhangul, I can input Korean, but whenever I typed imactivatekey, There
        Message 3 of 3 , Apr 24, 2003
        • 0 Attachment
          On Thu, 24 Apr 2003 17:50:37 +0900, Yasuhiro Matsumoto wrote:
          >
          > Vim can't start preedit with some XIM on gtk2.
          > I use kinput2 version 3.0
          >
          > I notice that gtk2's behavior is not same as gtk's one.
          > following patch make the same as gtk's behavior.
          > (if imactivatekey is not set, the behaviror depend on XIM serevr)
          >
          > on my environment, it seems ok to me.
          > Bram, please check and include.

          With the patch, I have a problem with imhangul(GTK IM module)
          and ami(XIM).

          With imhangul, I can input Korean, but whenever I typed imactivatekey,
          There inputs extra space.
          With ami, I cannot input Korean. Cursor color changed. But can input
          English only.

          Regards,
          namsh
        Your message has been successfully submitted and would be delivered to recipients shortly.