Author: sasugaanija
Date: Wed Apr 16 04:15:27 2008
New Revision: 5419

Modified:
  trunk/emacs/uim-el-agent.c
  trunk/emacs/uim-util.el
  trunk/emacs/uim.el

Log:
Fix serious bug and a related problem:
When several buffers on different frames display preedits at the same time
and user switches the focus from some frame to another frame,
the buffers are crashed.

* emacs/uim-util.el
 - (uim-point): Remove
* emacs/uim.el
 - (uim-process-agent-output):
   * Use (point) instead of (uim-point).
   * Remove redundant cursor movement.
* emacs/uim-el-agent.c
 - (cmd_unfocused): Don't return the error even if uim.el sends
   an UNFOCUSED command to the already unfocused context (for XEmacs).



Modified: trunk/emacs/uim-el-agent.c
==============================================================================
--- trunk/emacs/uim-el-agent.c  (original)
+++ trunk/emacs/uim-el-agent.c  Wed Apr 16 04:15:27 2008
@@ -90,7 +90,7 @@
{
  uim_agent_context *ua = get_uim_agent_context(context_id);

-  if (ua == current) {
+  if (ua) {
        /* keep preedit if exists */
        show_preedit_uim_agent_context(ua);
        show_candidate_uim_agent_context(ua);

Modified: trunk/emacs/uim-util.el
==============================================================================
--- trunk/emacs/uim-util.el     (original)
+++ trunk/emacs/uim-util.el     Wed Apr 16 04:15:27 2008
@@ -299,8 +299,6 @@
(defun uim-goto-char (pt)
  (set-window-point (get-buffer-window (current-buffer)) pt))

-(defun uim-point ()
-  (window-point (get-buffer-window (current-buffer))))

(defun uim-get-vector-from-head (vec n)
  (if (and (<= n (length vec))

Modified: trunk/emacs/uim.el
==============================================================================
--- trunk/emacs/uim.el  (original)
+++ trunk/emacs/uim.el  Wed Apr 16 04:15:27 2008
@@ -1156,8 +1156,7 @@
          (setq preedit-existed t)
          (let ((inhibit-read-only t))
            (uim-remove-preedit))
-         (setq uim-preedit-displayed nil)
-         (uim-goto-char uim-original-cursor))
+         (setq uim-preedit-displayed nil))

        ;; restore cursor point
        (when (and uim-preedit-keymap-enabled uim-original-cursor)
@@ -1304,7 +1303,7 @@
            (when buffer-undo-list-saved
              (uim-save-undo))))

-      (setq uim-original-cursor (uim-point))
+      (setq uim-original-cursor (point))


      (if (or preedit candidate)
@@ -1334,7 +1333,7 @@

            (uim-goto-char uim-preedit-cursor)

-           (setq uim-candidate-cursor (uim-point))
+           (setq uim-candidate-cursor (point))

            ;; show candidate
            (when (and candidate

Reply via email to