From 9a205474ccf3eeb5cc25399afe55c44509dfbb67 Mon Sep 17 00:00:00 2001 From: jahorton Date: Tue, 14 Sep 2021 12:55:34 +0700 Subject: [PATCH] change(web): OSK cookie notes KMW version --- web/source/osk/oskManager.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/source/osk/oskManager.ts b/web/source/osk/oskManager.ts index 00985497a0..c3f43f18cd 100644 --- a/web/source/osk/oskManager.ts +++ b/web/source/osk/oskManager.ts @@ -515,6 +515,7 @@ namespace com.keyman.osk { c['userSet'] = this.userPositioned ? 1 : 0; c['left'] = p.left; c['top'] = p.top; + c['_version'] = utils.Version.CURRENT.toString(); if(this.vkbd) { c['width'] = this.width.val; @@ -538,6 +539,7 @@ namespace com.keyman.osk { this.userPositioned = util.toNumber(c['userSet'], 0) == 1; this.x = util.toNumber(c['left'],-1); this.y = util.toNumber(c['top'],-1); + let cookieVersionString = c['_version']; // Restore OSK size - font size now fixed in relation to OSK height, unless overridden (in em) by keyboard let dfltWidth=0.3*screen.width; @@ -563,7 +565,10 @@ namespace com.keyman.osk { newHeight=0.5*screen.height; } - if(isNewCookie) { + // if(!cookieVersionString) - this component was not tracked until 15.0. + // Before that point, the OSK's title bar and resize bar heights were not included + // in the OSK's cookie-persisted height. + if(isNewCookie || !cookieVersionString) { // Adds some space to account for the OSK's header and footer, should they exist. if(this.headerView && this.headerView.layoutHeight.absolute) { newHeight += this.headerView.layoutHeight.val;