Skip to content

Commit 357c17f

Browse files
committed
Merge branch 'hotfix/0.9.26.2'
2 parents 4ff0db0 + c9a8ea0 commit 357c17f

File tree

11 files changed

+95
-45
lines changed

11 files changed

+95
-45
lines changed

CHANGES.md

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
RIME 主葉:https://rimeime.github.io
55

6+
鼠鬚管 0.9.26.2 <2014-12-23>
7+
---
8+
9+
* 修復:安裝後輸入法在一些 app 中無法啓用 [#43](https://github.com/lotem/squirrel/issues/43)
10+
611
鼠鬚管 0.9.26.1 <2014-12-22>
712
---
813

Info.plist

+5-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>0.9.26.1</string>
22+
<string>0.9.26.2</string>
2323
<key>InputMethodConnectionName</key>
2424
<string>Squirrel_1_Connection</string>
2525
<key>InputMethodServerControllerClass</key>
@@ -44,20 +44,19 @@
4444
<key>SUPublicDSAKeyFile</key>
4545
<string>dsa_pub.pem</string>
4646
<key>SUFeedURL</key>
47-
<string>http://rimeime.github.io/release/squirrel/appcast.xml</string>
47+
<string>http://rimeime.github.io/release/squirrel/appcast.xml</string>
4848
<key>SUEnableAutomaticChecks</key>
4949
<true/>
50-
5150
<key>ComponentInputModeDict</key>
5251
<dict>
5352
<key>tsInputModeListKey</key>
5453
<dict>
5554
<key>com.googlecode.rimeime.inputmethod.Squirrel</key>
5655
<dict>
5756
<key>TISInputSourceID</key>
58-
<string>com.googlecode.rimeime.inputmethod.Squirrel</string>
57+
<string>com.googlecode.rimeime.inputmethod.Squirrel.Rime</string>
5958
<key>TISIntendedLanguage</key>
60-
<string>zh-Hans</string>
59+
<string>zh</string>
6160
<key>tsInputModeAlternateMenuIconFileKey</key>
6261
<string>rime.pdf</string>
6362
<key>tsInputModeCharacterRepertoireKey</key>
@@ -83,7 +82,7 @@
8382
</dict>
8483
<key>tsVisibleInputModeOrderedArrayKey</key>
8584
<array>
86-
<string>com.googlecode.rimeime.inputmethod.Squirrel</string>
85+
<string>com.googlecode.rimeime.inputmethod.Squirrel.Rime</string>
8786
</array>
8887
</dict>
8988
</dict>

Makefile

+8-5
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,19 @@ debug: $(DEPENDS)
5252
rm -f build/Squirrel.app
5353
cd build ; ln -s Debug/Squirrel.app Squirrel.app
5454

55+
SQUIRREL_APP_PATH = /Library/Input Methods/Squirrel.app
56+
5557
install-debug:
56-
rm -rf "/Library/Input Methods/Squirrel.app/Contents/Frameworks"
57-
rm -rf "/Library/Input Methods/Squirrel.app/Contents/MacOS"
58+
rm -rf "$(SQUIRREL_APP_PATH)/Contents/Frameworks"
59+
rm -rf "$(SQUIRREL_APP_PATH)/Contents/MacOS"
60+
5861
cp -R build/Debug/Squirrel.app "/Library/Input Methods"
59-
"/Library/Input Methods/Squirrel.app/Contents/Resources/postflight"
62+
"$(SQUIRREL_APP_PATH)/Contents/Resources/postflight"
6063

6164
install-release:
62-
rm -rf "/Library/Input Methods/Squirrel.app"
65+
rm -rf "$(SQUIRREL_APP_PATH)"
6366
cp -R build/Release/Squirrel.app "/Library/Input Methods"
64-
"/Library/Input Methods/Squirrel.app/Contents/Resources/postflight"
67+
"$(SQUIRREL_APP_PATH)/Contents/Resources/postflight"
6568

6669
clean:
6770
rm -rf build > /dev/null 2>&1 || true

Squirrel.xcodeproj/project.pbxproj

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
44F01538152B2D9300EFDAC3 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 44F01492152AF6AF00EFDAC3 /* Sparkle.framework */; };
2828
44F7708F152B3334005CF491 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 44F7708E152B3334005CF491 /* dsa_pub.pem */; };
2929
44F84AD714E94C490005D70B /* SquirrelPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = 44F84AD614E94C490005D70B /* SquirrelPanel.m */; };
30+
44FED9BA1A48502900037B05 /* preflight in Resources */ = {isa = PBXBuildFile; fileRef = 44FED9B91A48502900037B05 /* preflight */; };
3031
7B53068F1A30104000486AC2 /* double_pinyin_pyjj.schema.yaml in Copy Shared Support Files */ = {isa = PBXBuildFile; fileRef = 7B53068D1A30102D00486AC2 /* double_pinyin_pyjj.schema.yaml */; };
3132
7BD9C04C1A2C689B008C0913 /* bopomofo_tw.schema.yaml in Copy Shared Support Files */ = {isa = PBXBuildFile; fileRef = 7BD9BFF61A2C686C008C0913 /* bopomofo_tw.schema.yaml */; };
3233
7BD9C04D1A2C689B008C0913 /* bopomofo.schema.yaml in Copy Shared Support Files */ = {isa = PBXBuildFile; fileRef = 7BD9BFF71A2C686C008C0913 /* bopomofo.schema.yaml */; };
@@ -232,6 +233,7 @@
232233
44F84AD614E94C490005D70B /* SquirrelPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SquirrelPanel.m; sourceTree = "<group>"; };
233234
44FA4D891685997300116C1F /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Localizable.strings; sourceTree = "<group>"; };
234235
44FA4D8E16859B2900116C1F /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Localizable.strings; sourceTree = "<group>"; };
236+
44FED9B91A48502900037B05 /* preflight */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = preflight; sourceTree = "<group>"; };
235237
7B53068D1A30102D00486AC2 /* double_pinyin_pyjj.schema.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = double_pinyin_pyjj.schema.yaml; path = data/brise/double_pinyin_pyjj.schema.yaml; sourceTree = "<group>"; };
236238
7BD9BF631A2C63AD008C0913 /* HKVariants.ocd */ = {isa = PBXFileReference; lastKnownFileType = file; path = HKVariants.ocd; sourceTree = "<group>"; };
237239
7BD9BF641A2C63AD008C0913 /* s2t.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = s2t.json; sourceTree = "<group>"; };
@@ -381,6 +383,7 @@
381383
29B97317FDCFA39411CA2CEA /* Resources */ = {
382384
isa = PBXGroup;
383385
children = (
386+
44FED9B91A48502900037B05 /* preflight */,
384387
44986A93184B421700B3278D /* LICENSE.txt */,
385388
44986A94184B421700B3278D /* README.txt */,
386389
44CD7D9E1828D981006E9222 /* rime.pdf */,
@@ -552,6 +555,7 @@
552555
44986A96184B421700B3278D /* README.txt in Resources */,
553556
44943BB815066A540005EE85 /* postflight in Resources */,
554557
44F7708F152B3334005CF491 /* dsa_pub.pem in Resources */,
558+
44FED9BA1A48502900037B05 /* preflight in Resources */,
555559
44CD7D9F1828D981006E9222 /* rime.pdf in Resources */,
556560
4493402B158A4ABC0041A35A /* squirrel-app.icns in Resources */,
557561
448CCCDD166B2E0500337E78 /* Growl Registration Ticket.growlRegDict in Resources */,

input_source.m

+39-13
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
"/Library/Input Methods/Squirrel.app";
55
static NSString *const kSourceID =
66
@"com.googlecode.rimeime.inputmethod.Squirrel";
7+
static NSString *const kInputModeID =
8+
@"com.googlecode.rimeime.inputmethod.Squirrel.Rime";
79

810
void RegisterInputSource() {
11+
NSLog(@"RegisterInputSource.");
912
CFURLRef installedLocationURL = CFURLCreateFromFileSystemRepresentation(
1013
NULL, kInstalledLocation, strlen((const char *)kInstalledLocation), NO);
1114
if (installedLocationURL) {
@@ -14,40 +17,63 @@ void RegisterInputSource() {
1417
}
1518

1619
void ActivateInputSource() {
20+
NSLog(@"ActivateInputSource.");
1721
CFArrayRef sourceList = TISCreateInputSourceList(NULL, true);
1822
for (int i = 0; i < CFArrayGetCount(sourceList); ++i) {
1923
TISInputSourceRef inputSource = (TISInputSourceRef)(CFArrayGetValueAtIndex(
2024
sourceList, i));
2125
NSString *sourceID = (NSString *)(TISGetInputSourceProperty(
2226
inputSource, kTISPropertyInputSourceID));
23-
if ([sourceID isEqualToString:kSourceID]) {
27+
//NSLog(@"examining input source '%@", sourceID);
28+
if ([sourceID isEqualToString:kSourceID] ||
29+
[sourceID isEqualToString:kInputModeID]) {
2430
TISEnableInputSource(inputSource);
25-
TISSelectInputSource(inputSource);
26-
break;
31+
CFBooleanRef isSelectable = (CFBooleanRef)TISGetInputSourceProperty(
32+
inputSource, kTISPropertyInputSourceIsSelectCapable);
33+
if (CFBooleanGetValue(isSelectable)) {
34+
NSLog(@"selecting input source '%@'.", sourceID);
35+
TISSelectInputSource(inputSource);
36+
}
37+
NSLog(@"'%@' should have been activated.", sourceID);
38+
}
39+
}
40+
}
41+
42+
void DeactivateInputSource() {
43+
NSLog(@"DeactivateInputSource.");
44+
CFArrayRef sourceList = TISCreateInputSourceList(NULL, true);
45+
for (int i = CFArrayGetCount(sourceList); i > 0; --i) {
46+
TISInputSourceRef inputSource = (TISInputSourceRef)(CFArrayGetValueAtIndex(
47+
sourceList, i - 1));
48+
NSString *sourceID = (NSString *)(TISGetInputSourceProperty(
49+
inputSource, kTISPropertyInputSourceID));
50+
//NSLog(@"examining input source '%@", sourceID);
51+
if ([sourceID isEqualToString:kSourceID] ||
52+
[sourceID isEqualToString:kInputModeID]) {
53+
TISDisableInputSource(inputSource);
54+
NSLog(@"'%@' should have been deactivated.", sourceID);
2755
}
2856
}
2957
}
3058

3159
BOOL IsInputSourceActive() {
32-
BOOL isActive = NO;
60+
int active = 0;
3361
CFArrayRef sourceList = TISCreateInputSourceList(NULL, true);
3462
for (int i = 0; i < CFArrayGetCount(sourceList); ++i) {
3563
TISInputSourceRef inputSource = (TISInputSourceRef)(CFArrayGetValueAtIndex(
3664
sourceList, i));
3765
NSString *sourceID = (NSString *)(TISGetInputSourceProperty(
3866
inputSource, kTISPropertyInputSourceID));
39-
if ([sourceID isEqualToString:kSourceID]) {
67+
NSLog(@"examining input source '%@'", sourceID);
68+
if ([sourceID isEqualToString:kSourceID] ||
69+
[sourceID isEqualToString:kInputModeID]) {
4070
CFBooleanRef isEnabled = (CFBooleanRef)(TISGetInputSourceProperty(
4171
inputSource, kTISPropertyInputSourceIsEnabled));
42-
CFBooleanRef isSelected = (CFBooleanRef)(TISGetInputSourceProperty(
43-
inputSource, kTISPropertyInputSourceIsEnabled));
44-
if (CFBooleanGetValue(isEnabled) || CFBooleanGetValue(isSelected)) {
45-
isActive = YES;
46-
break;
72+
if (CFBooleanGetValue(isEnabled)) {
73+
++active;
4774
}
4875
}
4976
}
50-
return isActive;
77+
NSLog(@"IsInputSourceActive: %d / 2", active);
78+
return active == 2; // 1 active input method + 1 active input mode
5179
}
52-
53-

main.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
void RegisterInputSource();
99
void ActivateInputSource();
10-
BOOL IsInputSourceActive();
10+
void DeactivateInputSource();
11+
//BOOL IsInputSourceActive();
1112

1213
// Each input method needs a unique connection name.
1314
// Note that periods and spaces are not allowed in the connection name.
@@ -35,10 +36,9 @@ int main(int argc, char *argv[])
3536

3637
if (argc > 1 && !strcmp("--install", argv[1])) {
3738
// register and enable Squirrel
38-
if (!IsInputSourceActive()) {
39-
RegisterInputSource();
40-
ActivateInputSource();
41-
}
39+
RegisterInputSource();
40+
DeactivateInputSource();
41+
ActivateInputSource();
4242
return 0;
4343
}
4444

package/Package.pmdoc/01squirrel-contents.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<pkg-contents spec="1.12">
3-
<f n="Squirrel.app" o="root" g="wheel" p="16877" pt="/Users/lotem/squirrel/build/Release/Squirrel.app" m="true" t="file">
3+
<f n="Squirrel.app" o="root" g="wheel" p="16877" pt="/Users/lotem/work/squirrel/build/Release/Squirrel.app" m="true" t="file">
44
<f n="Contents" o="root" g="wheel" p="16877">
55
<f n="Frameworks" o="root" g="wheel" p="16877">
66
<f n="Growl.framework" o="root" g="wheel" p="16877">
@@ -578,6 +578,7 @@
578578
<f n="Growl Registration Ticket.growlRegDict" o="root" g="wheel" p="33188"/>
579579
<f n="LICENSE.txt" o="root" g="wheel" p="33188"/>
580580
<f n="postflight" o="root" g="wheel" p="33261"/>
581+
<f n="preflight" o="root" g="wheel" p="33261"/>
581582
<f n="README.txt" o="root" g="wheel" p="33188"/>
582583
<f n="rime.pdf" o="root" g="wheel" p="33188"/>
583584
<f n="squirrel-app.icns" o="root" g="wheel" p="33188"/>

package/Package.pmdoc/01squirrel.xml

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0"?>
2-
<pkgref spec="1.12" uuid="1EE5C324-906B-44CD-BE11-21352CB4606C">
2+
<pkgref spec="1.12" uuid="B0722148-4346-435C-820C-A061B907E4BC">
33
<config>
44
<identifier>com.googlecode.rimeime.Squirrel.pkg</identifier>
5-
<version>0.9.26.1</version>
5+
<version>0.9.26.2</version>
66
<description/>
77
<post-install type="req-logout"/>
88
<requireAuthorization/>
9-
<installFrom mod="true" includeRoot="true">/Users/lotem/squirrel/build/Release/Squirrel.app</installFrom>
9+
<installFrom includeRoot="true">/Users/lotem/work/squirrel/build/Release/Squirrel.app</installFrom>
1010
<installTo mod="true">/Library/Input Methods</installTo>
1111
<flags>
1212
<followSymbolicLinks/>
@@ -15,21 +15,22 @@
1515
<mod>installTo</mod>
1616
<mod>postInstall</mod>
1717
<mod>relocatable</mod>
18-
<mod>installFrom.path</mod>
1918
<mod>scripts.postinstall.path</mod>
19+
<mod>scripts.preinstall.path</mod>
2020
<mod>identifier</mod>
2121
<mod>parent</mod>
2222
<mod>version</mod>
2323
<mod>installTo.path</mod>
2424
</config>
2525
<scripts>
26+
<preinstall relative="true" mod="true">../preflight</preinstall>
2627
<postinstall relative="true" mod="true">../postflight</postinstall>
2728
</scripts>
2829
<contents>
2930
<file-list>01squirrel-contents.xml</file-list>
30-
<component id="com.googlecode.rimeime.inputmethod.Squirrel" path="/Users/lotem/squirrel/build/Release/Squirrel.app" version="0.9.26.1" isDowngradeable="true">
31-
<component id="com.growl.growlframework" path="/Users/lotem/squirrel/build/Release/Squirrel.app/Contents/Frameworks/Growl.framework" version="1.3.1"/>
32-
<component id="org.andymatuschak.Sparkle" path="/Users/lotem/squirrel/build/Release/Squirrel.app/Contents/Frameworks/Sparkle.framework" version="313"/>
31+
<component id="com.googlecode.rimeime.inputmethod.Squirrel" path="/Users/lotem/work/squirrel/build/Release/Squirrel.app" version="0.9.26.1" isDowngradeable="true">
32+
<component id="com.growl.growlframework" path="/Users/lotem/work/squirrel/build/Release/Squirrel.app/Contents/Frameworks/Growl.framework" version="1.3.1"/>
33+
<component id="org.andymatuschak.Sparkle" path="/Users/lotem/work/squirrel/build/Release/Squirrel.app/Contents/Frameworks/Sparkle.framework" version="313"/>
3334
</component>
3435
<filter>/CVS$</filter>
3536
<filter>/\.svn$</filter>

package/Package.pmdoc/index.xml

+9-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
&#x4ECA;&#x7531;&#x3014;RIME&#xFF0F;&#x4E2D;&#x5DDE;&#x97FB;&#x8F38;&#x5165;&#x6CD5;&#x5F15;&#x64CE;&#x3015;&#x5F37;&#x529B;&#x9A45;&#x52D5;</description>
2323
<contents>
24-
<choice title="Squirrel" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false">
24+
<choice title="Squirrel" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="true">
2525
<pkgref id="com.googlecode.rimeime.Squirrel.pkg"/>
2626
</choice>
2727
</contents>
@@ -63,7 +63,7 @@
6363
-------------------------------------------------\
6464
6565
\f1 \'a1\'69\'b9\'ab\'c5\'bd\'ba\'de\'a1\'6a\'bf\'e9\'a4\'4a\'aa\'6b
66-
\f0 0.9.26.1\
66+
\f0 0.9.26.2\
6767
\
6868
6969
\f1 \'a6\'a1\'ae\'a4\'b0\'f3\'aa\'a9\'c5\'76\'a9\'d2\'b5\'4c
@@ -149,7 +149,12 @@ http://code.google.com/p/rimeime/wiki/CustomizationGuide\
149149
\f0 \
150150
\
151151
152-
\f2 \'ca\'f3\'f4\'50\'b9\'dc 0.9.26.1 <2014-12-22>\
152+
\f2 \'ca\'f3\'f4\'50\'b9\'dc 0.9.26.2 <2014-12-23>\
153+
---\
154+
\
155+
* \'d0\'de\'8f\'cd\'a3\'ba\'b0\'b2\'d1\'62\'e1\'e1\'dd\'94\'c8\'eb\'b7\'a8\'d4\'da\'d2\'bb\'d0\'a9 app \'d6\'d0\'9f\'6f\'b7\'a8\'86\'99\'d3\'c3 #43\
156+
\
157+
\'ca\'f3\'f4\'50\'b9\'dc 0.9.26.1 <2014-12-22>\
153158
---\
154159
\
155160
* \'d0\'de\'8f\'cd\'a3\'ba0.9.26 \'b0\'e6\'b1\'be\'d4\'4f\'d6\'c3 `translator/enable_user_dict: false` \'b0\'6c\'c9\'fa\'b1\'c0\'9d\'a2\
@@ -366,7 +371,7 @@ Rime \'cb\'e3\'b7\'a8\'8e\'ec\'d7\'83\'b8\'fc\'bc\'af\
366371
<mod>properties.systemDomain</mod>
367372
<mod>properties.title</mod>
368373
<mod>properties.customizeOption</mod>
374+
<mod>description</mod>
369375
<mod>properties.userDomain</mod>
370376
<mod>properties.anywhereDomain</mod>
371-
<mod>description</mod>
372377
</pkmkdoc>

preflight

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
SQUIRREL_APP_PATH="/Library/Input Methods/Squirrel.app"
3+
4+
echo "uninstalling previous version."
5+
rm -Rf "$SQUIRREL_APP_PATH"
6+
/usr/bin/true

update/appcast.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
<description>鼠鬚管 Appcast 更新頻道</description>
77
<language>zh</language>
88
<item>
9-
<title>鼠鬚管 0.9.26.1</title>
9+
<title>鼠鬚管 0.9.26.2</title>
1010
<sparkle:releaseNotesLink>http://rimeime.github.io/release/squirrel/</sparkle:releaseNotesLink>
1111
<sparkle:minimumSystemVersion>10.7.0</sparkle:minimumSystemVersion>
1212
<pubDate>Mon, 22 Dec 2014 12:00:00 +0800</pubDate>
13-
<enclosure url="http://dl.bintray.com/lotem/rime/Squirrel-0.9.26.1.zip"
13+
<enclosure url="http://dl.bintray.com/lotem/rime/Squirrel-0.9.26.2.zip"
1414
sparkle:version="0.9.26.1"
15-
sparkle:dsaSignature="MCwCFEqGaqRq/AoLV7IBX07zACAAJKMoAhQ1spXgkrwrSQ7kcaCnqIiIkQA5iw=="
16-
length="9578791"
15+
sparkle:dsaSignature="MC0CFBfjsjotU9lBev3WMt63ACedLiivAhUAgabxzAoM1MrrU8qnVP5Nqts+xx0="
16+
length="9579976"
1717
type="application/octet-stream"/>
1818
</item>
1919
</channel>

0 commit comments

Comments
 (0)