[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#783811: jessie-pu: package ibus-cangjie/2.2-2



Package: release.debian.org
Severity: normal
Tags: jessie
User: release.debian.org@packages.debian.org
Usertags: pu

The attachment is debdiff for Jessie point release to fix #782453. The
issue is reported and patched by upstream to fix the following issues:


    The 2.3 release fixes:
    
    * a serious usability issue, where we would in some cases suggest
      duplicate characters to the users:
      https://github.com/Cangjians/ibus-cangjie/issues/63

    * a python traceback (in the background, not crashing the engine,
      but which was nevertheless triggering automatic crash catchers):
      https://github.com/Cangjians/ibus-cangjie/issues/57

    * an incorrect translation for Taiwan users:
      https://github.com/Cangjians/ibus-cangjie/issues/61
    
    And the 2.4 release works around another serious usability issue,
    where the candidate popup was misplaced (i.e not at the input
    cursor, but at the bottom of the screen) on some applications, most
    notably Firefox (which is quite the common app):

    https://github.com/Cangjians/ibus-cangjie/issues/60


Please let me know if there is any problem in the patch, and I will
cooperate with upstream to fix it to ensure it can be in Debian 8.1,
thanks.

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- 
ChangZhuo Chen (陳昌倬) <czchen@gmail.com>
http://czchen.info/
Key fingerprint = EC9F 905D 866D BE46 A896  C827 BE0C 9242 03F4 552D
diff -Nru ibus-cangjie-2.2/debian/changelog ibus-cangjie-2.2/debian/changelog
--- ibus-cangjie-2.2/debian/changelog	2015-04-30 17:42:11.000000000 +0800
+++ ibus-cangjie-2.2/debian/changelog	2015-04-30 18:17:21.000000000 +0800
@@ -1,3 +1,9 @@
+ibus-cangjie (2.2-2+deb8u1) jessie; urgency=medium
+
+  * Backport 2.4 bugfix (Closes: 782453)
+
+ -- ChangZhuo Chen (陳昌倬) <czchen@gmail.com>  Thu, 30 Apr 2015 18:16:50 +0800
+
 ibus-cangjie (2.2-2) unstable; urgency=medium
 
   [ChangZhuo Chen]
diff -Nru ibus-cangjie-2.2/debian/patches/0002-backport-2.4-bugfix.patch ibus-cangjie-2.2/debian/patches/0002-backport-2.4-bugfix.patch
--- ibus-cangjie-2.2/debian/patches/0002-backport-2.4-bugfix.patch	1970-01-01 08:00:00.000000000 +0800
+++ ibus-cangjie-2.2/debian/patches/0002-backport-2.4-bugfix.patch	2015-04-30 18:44:02.000000000 +0800
@@ -0,0 +1,96 @@
+Description: Backport 2.4 bugfix
+---
+Origin: upstream
+Bug-Debian: http://bugs.debian.org/782453
+--- ibus-cangjie-2.2.orig/po/zh_TW.po
++++ ibus-cangjie-2.2/po/zh_TW.po
+@@ -98,7 +98,7 @@ msgstr "輸入法版本"
+ msgid ""
+ "Only characters common in Hong Kong can be inputted by default.\n"
+ "The following additional characters can be enabled:"
+-msgstr "預設情況下只能輸入香港常用字。\n可以額外啟用下列額字元:"
++msgstr "預設情況下只能輸入香港常用字。\n可以額外啟用下列字元:"
+ 
+ #. The Taiwanese Zhuyin alphabet is known under two names in English.
+ #. Obviously, if it only has one name in your language, don't try to keep two
+--- ibus-cangjie-2.2.orig/src/engine.py
++++ ibus-cangjie-2.2/src/engine.py
+@@ -249,7 +249,12 @@ class Engine(IBus.Engine):
+                 self.get_candidates(by_shortcode=True)
+ 
+             else:
+-                self.get_candidates()
++                try:
++                    self.get_candidates()
++
++                except cangjie.errors.CangjieNoCharsError:
++                    self.play_error_bell()
++                    return True
+ 
+         if self.lookuptable.get_number_of_candidates():
+             self.do_select_candidate(1)
+@@ -394,9 +399,16 @@ class Engine(IBus.Engine):
+         else:
+             chars = self.cangjie.get_characters_by_shortcode(code)
+ 
++        # Finding an element in a dict is **much** faster than in a list
++        seen = {}
++
+         for c in sorted(chars, key=attrgetter("frequency"), reverse=True):
++            if c.chchar in seen:
++                continue
++
+             self.lookuptable.append_candidate(IBus.Text.new_from_string(c.chchar))
+             num_candidates += 1
++            seen[c.chchar] = True
+ 
+         if num_candidates == 1:
+             self.do_select_candidate(1)
+@@ -421,6 +433,20 @@ class Engine(IBus.Engine):
+         text = IBus.Text.new_from_string(self.current_radicals)
+         super(Engine, self).update_auxiliary_text(text, len(self.current_radicals)>0)
+ 
++        # We don't use pre-edit at all for Cangjie or Quick
++        #
++        # However, some applications (most notably Firefox) fail to correctly
++        # position the candidate popup, as if they got confused by the absence
++        # of a pre-edit text. :(
++        #
++        # This is a horrible hack, but it fixes the immediate problem.
++        if self.current_radicals:
++            super(Engine, self).update_preedit_text(IBus.Text.new_from_string('\u200B'), 0, True)
++
++        else:
++            super(Engine, self).update_preedit_text(IBus.Text.new_from_string(''), 0, False)
++        # End of the horrible workaround
++
+     def update_lookup_table(self):
+         """Update the lookup table."""
+         if not self.current_input:
+--- ibus-cangjie-2.2.orig/src/setup.py
++++ ibus-cangjie-2.2/src/setup.py
+@@ -99,6 +99,9 @@ class Setup(object):
+         We need to react, in case the value was changed from somewhere else,
+         for example from another setup UI.
+         """
++        if key == "halfwidth-chars":
++            return
++
+         if key == "version":
+             new_value = self.settings.get_int(key)
+ 
+--- ibus-cangjie-2.2.orig/tests/run_tests.in
++++ ibus-cangjie-2.2/tests/run_tests.in
+@@ -47,6 +47,12 @@ class MockEngine:
+         # We don't need anything here for the unit tests
+         pass
+ 
++    def update_preedit_text(self, text, cursor_pos, visible):
++        # We don't need anything here for the unit tests
++        #
++        # We only have this for an ugly workaround.
++        pass
++
+ 
+ class MockLookupTable:
+     def __init__(self):
diff -Nru ibus-cangjie-2.2/debian/patches/series ibus-cangjie-2.2/debian/patches/series
--- ibus-cangjie-2.2/debian/patches/series	2015-04-30 17:51:01.000000000 +0800
+++ ibus-cangjie-2.2/debian/patches/series	2015-04-30 18:15:28.000000000 +0800
@@ -1 +1,2 @@
 0001-install-engine-to-correct-dir.diff
+0002-backport-2.4-bugfix.patch

Attachment: signature.asc
Description: Digital signature


Reply to: