From e54a0d0d70bca6f38789a41b5940f187eff7a579 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 26 Feb 2019 05:56:22 +1100 Subject: [PATCH 01/10] [Linux] Update history --- linux/history.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/history.md b/linux/history.md index 15546f33d6..2c6cec5b3b 100644 --- a/linux/history.md +++ b/linux/history.md @@ -1,6 +1,6 @@ # Keyman for Linux Version History -## 2019-02-25 11.0.120 stable +## 2019-02-25 11.0.124 stable * 11.0 Stable release ## 2019-02-22 11.0.111 beta From 3dec4d3559b85bf4deab0074b0052079eef8ced4 Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Tue, 26 Feb 2019 08:24:19 +0700 Subject: [PATCH 02/10] Addresses minification break in KMW's toolbar UI module --- web/source/kmwuitoolbar.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/source/kmwuitoolbar.ts b/web/source/kmwuitoolbar.ts index 6f4d1e76a7..d24b742efe 100644 --- a/web/source/kmwuitoolbar.ts +++ b/web/source/kmwuitoolbar.ts @@ -337,7 +337,7 @@ if(!window['keyman']['ui']['name']) { if(Keyboards[j]['RegionCode'] != i) continue; // Not this region // Get JUST the language code for this section. BCP-47 codes can include more! - var bcpSubtags: string[] = keymanweb['util'].getLanguageCodes(Keyboards[j]['LanguageCode']); + var bcpSubtags: string[] = keymanweb['util']['getLanguageCodes'](Keyboards[j]['LanguageCode']); if(bcpSubtags[0] == languageCode) continue; // Same language as previous keyboard languageCode = bcpSubtags[0]; @@ -351,7 +351,7 @@ if(!window['keyman']['ui']['name']) { { if(Keyboards[j]['RegionCode'] != i) continue; // Not this region - var bcpSubtags: string[] = keymanweb['util'].getLanguageCodes(Keyboards[j]['LanguageCode']); + var bcpSubtags: string[] = keymanweb['util']['getLanguageCodes'](Keyboards[j]['LanguageCode']); if(bcpSubtags[0] == languageCode) { // Same language as previous keyboard, so add it to that entry var x = ui.languages[languageCode].keyboards; From 03f63e48df626f04fc65e7b0ceb96263f1d54a54 Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Tue, 26 Feb 2019 08:48:33 +0700 Subject: [PATCH 03/10] History.md update --- web/history.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/history.md b/web/history.md index 44dfb22f0d..db96296f55 100644 --- a/web/history.md +++ b/web/history.md @@ -1,5 +1,8 @@ # KeymanWeb Version History +## 2019-02-26 11.0.221 stable +* Fixes bug with the Toolbar UI (#1629) + ## 2019-02-25 11.0.220 stable * 11.0 Stable release From 2a56b5473168a8e047996e063671b1831da04e1a Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Tue, 26 Feb 2019 11:52:20 +0700 Subject: [PATCH 04/10] Fixes #1628 --- web/source/kmwosk.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/web/source/kmwosk.ts b/web/source/kmwosk.ts index daa89bcab7..ba805a0354 100644 --- a/web/source/kmwosk.ts +++ b/web/source/kmwosk.ts @@ -25,6 +25,7 @@ namespace com.keyman { export abstract class OSKKey { spec: OSKKeySpec; + layer: string; // The layer in which the key resides (not the key spec's 'act as layer' property) constructor(spec: OSKKeySpec) { this.spec = spec; @@ -139,7 +140,7 @@ namespace com.keyman { // Use special case lookup for modifier keys if(spec['sp'] == '1' || spec['sp'] == '2') { // Unique layer-based transformation. - var tId=((spec['text'] == '*Tab*' && spec.layer == 'shift') ? '*TabLeft*' : spec['text']); + var tId=((spec['text'] == '*Tab*' && this.layer == 'shift') ? '*TabLeft*' : spec['text']); // Transforms our *___* special key codes into their corresponding PUA character codes for keyboard display. keyText=this.renameSpecialKey(tId); @@ -213,7 +214,7 @@ namespace com.keyman { getId(): string { // Define each key element id by layer id and key id (duplicate possible for SHIFT - does it matter?) - return this.spec.layer+'-'+this.spec.id; + return this.layer+'-'+this.spec.id; } // Produces a small reference label for the corresponding physical key on a US keyboard. @@ -277,7 +278,7 @@ namespace com.keyman { let spec = this.spec; let isDesktop = util.device.formFactor == 'desktop' - spec.layer = layerId; + this.layer = layerId; let kDiv=util._CreateElement('div'); kDiv['keyId']=spec['id']; @@ -372,8 +373,8 @@ namespace com.keyman { getId(): string { let spec = this.spec; // Create (temporarily) unique ID by prefixing 'popup-' to actual key ID - if(typeof(spec['layer']) == 'string' && spec['layer'] != '') { - return 'popup-'+spec['layer']+'-'+spec['id']; + if(typeof(this.layer) == 'string' && this.layer != '') { + return 'popup-'+ this.layer +'-'+spec['id']; } else { // We only create subkeys when they're needed - the currently-active layer should be fine. return 'popup-' + ( window['keyman']).osk.layerId + '-'+spec['id']; From b54363e38c72532d30895a956c6d1569c25aa5c9 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 26 Feb 2019 13:50:36 +0700 Subject: [PATCH 05/10] Check activity is not finishing before showing error dialog Reference: https://stackoverflow.com/questions/7811993/error-binderproxy45d459c0-is-not-valid-is-your-activity-running --- .../java/com/tavultesoft/kmea/LanguageListActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/LanguageListActivity.java b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/LanguageListActivity.java index 077838b8c5..31795c5ec4 100644 --- a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/LanguageListActivity.java +++ b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/LanguageListActivity.java @@ -640,7 +640,11 @@ public final class LanguageListActivity extends AppCompatActivity implements OnK }); alertDialog = alertDialogBuilder.create(); - alertDialog.show(); + if (!((AppCompatActivity)context).isFinishing()) { + alertDialog.show(); + } else { + alertDialog.dismiss(); + } } } \ No newline at end of file From 6562ffc4ee9af53c3ee83fd8fef17a824c7a7e1b Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 26 Feb 2019 13:53:20 +0700 Subject: [PATCH 06/10] Update history.md --- android/history.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/history.md b/android/history.md index a0ddc1fc9c..dd19852258 100644 --- a/android/history.md +++ b/android/history.md @@ -1,5 +1,9 @@ # Keyman for Android +## 2019-02-26 11.0.2101 stable +* Bug fix: + * Fix crash from language picker trying to show error dialog (#1634) + ## 2019-02-25 11.0.2100 stable * 11.0 Stable release From 18b0299064a2173fe7175608be6ab0d560516910 Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Tue, 26 Feb 2019 15:33:33 +0700 Subject: [PATCH 07/10] Slight rework and polish for the fix. --- web/source/kmwosk.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/web/source/kmwosk.ts b/web/source/kmwosk.ts index ba805a0354..ebc9ba1744 100644 --- a/web/source/kmwosk.ts +++ b/web/source/kmwosk.ts @@ -25,10 +25,11 @@ namespace com.keyman { export abstract class OSKKey { spec: OSKKeySpec; - layer: string; // The layer in which the key resides (not the key spec's 'act as layer' property) + readonly layer: string; // The layer in which the key resides (not the key spec's 'act as layer' property) - constructor(spec: OSKKeySpec) { + constructor(spec: OSKKeySpec, layer: string) { this.spec = spec; + this.layer = layer; } abstract getId(): string; @@ -208,8 +209,8 @@ namespace com.keyman { } export class OSKBaseKey extends OSKKey { - constructor(spec: OSKKeySpec) { - super(spec); + constructor(spec: OSKKeySpec, layer: string) { + super(spec, layer); } getId(): string { @@ -272,14 +273,12 @@ namespace com.keyman { btn.appendChild(skIcon); } - construct(layout, layerId: string, rowStyle: CSSStyleDeclaration, totalPercent: number): {element: HTMLDivElement, percent: number} { + construct(layout, rowStyle: CSSStyleDeclaration, totalPercent: number): {element: HTMLDivElement, percent: number} { let util = (window['keyman']).util; let osk = (window['keyman']).osk; let spec = this.spec; let isDesktop = util.device.formFactor == 'desktop' - this.layer = layerId; - let kDiv=util._CreateElement('div'); kDiv['keyId']=spec['id']; kDiv.className='kmw-key-square'; @@ -366,8 +365,8 @@ namespace com.keyman { } export class OSKSubKey extends OSKKey { - constructor(spec: OSKKeySpec) { - super(spec); + constructor(spec: OSKKeySpec, layer: string) { + super(spec, layer); } getId(): string { @@ -1024,12 +1023,13 @@ if(!window['keyman']['initialized']) { osk.prependBaseKey(e); } var idx = e.id.split('-'), baseId = idx[idx.length-1]; + var baseLayer: string = idx.length > 1 ? idx[0] : 'default'; // idx.length should always be > 1, but just in case. // If not, insert at start if(device.formFactor == 'phone' && e.subKeys[0].id != baseId) { var eCopy={'id':baseId,'layer':''}; if(idx.length > 1) { - eCopy['layer'] = idx[0]; + eCopy['layer'] = baseLayer; } for(i=0; i Date: Tue, 26 Feb 2019 11:40:44 +0700 Subject: [PATCH 08/10] Use more generic preprocessor macro 64bit __x86_64__ is only for Intel __LP64__ and _LP64 are for any arch that has 64bit `long int` and pointers, and 32bit `int` same as Intel. --- common/engine/keyboardprocessor/src/kmx/kmx_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/engine/keyboardprocessor/src/kmx/kmx_base.h b/common/engine/keyboardprocessor/src/kmx/kmx_base.h index a47ba53621..fee31403ac 100644 --- a/common/engine/keyboardprocessor/src/kmx/kmx_base.h +++ b/common/engine/keyboardprocessor/src/kmx/kmx_base.h @@ -10,7 +10,7 @@ #define strncasecmp _strnicmp #endif -#if __x86_64__ +#if defined(__LP64__) || defined(_LP64) /* 64-bit, g++ */ #define KMX_64BIT #endif From 890aef1cff53bb8440f6d0bddc359dc659f09074 Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Wed, 27 Feb 2019 08:16:50 +0700 Subject: [PATCH 09/10] Web history.md. --- web/history.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/history.md b/web/history.md index db96296f55..0ee1a18e31 100644 --- a/web/history.md +++ b/web/history.md @@ -1,5 +1,8 @@ # KeymanWeb Version History +## 2019-02-27 11.0.222 stable +* Fixes bug with OSK keys set as if on a different layer from the one they are actually on (#1628) + ## 2019-02-26 11.0.221 stable * Fixes bug with the Toolbar UI (#1629) From 6ec3ddb6473d9dbfea499db288720a944fc8ffb4 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Wed, 27 Feb 2019 09:43:57 +0700 Subject: [PATCH 10/10] Moved activity check per review comment --- .../java/com/tavultesoft/kmea/LanguageListActivity.java | 8 ++------ android/history.md | 5 ++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/LanguageListActivity.java b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/LanguageListActivity.java index 31795c5ec4..b094b29718 100644 --- a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/LanguageListActivity.java +++ b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/LanguageListActivity.java @@ -156,7 +156,7 @@ public final class LanguageListActivity extends AppCompatActivity implements OnK Toast.makeText(context, context.getString(R.string.font_failed_to_download), Toast.LENGTH_LONG).show(); } finish(); - } else { + } else if (!((AppCompatActivity)context).isFinishing()) { String title = String.format("%s: %s", languageName, keyboardName); showErrorDialog(context, title, context.getString(R.string.keyboard_failed_to_download)); } @@ -640,11 +640,7 @@ public final class LanguageListActivity extends AppCompatActivity implements OnK }); alertDialog = alertDialogBuilder.create(); - if (!((AppCompatActivity)context).isFinishing()) { - alertDialog.show(); - } else { - alertDialog.dismiss(); - } + alertDialog.show(); } } \ No newline at end of file diff --git a/android/history.md b/android/history.md index dd19852258..f1f68a88b2 100644 --- a/android/history.md +++ b/android/history.md @@ -1,9 +1,12 @@ # Keyman for Android -## 2019-02-26 11.0.2101 stable +## 2019-02-27 11.0.2102 stable * Bug fix: * Fix crash from language picker trying to show error dialog (#1634) +## 2019-02-26 11.0.2101 stable +* No changes to Keyman for Android (updated Keyman Web Engine, #1629) + ## 2019-02-25 11.0.2100 stable * 11.0 Stable release