Commit graph

396 commits

Author SHA1 Message Date
Marc Durdin
63d2dcde46 chore(mac): update readme 2021-04-29 15:55:10 +10:00
Marc Durdin
2415f66fc7 chore: support for xcode 12
Fixes #4994.
2021-04-29 15:00:26 +10:00
Marc Durdin
eeb8153252 fix(mac): prevent duplicate keyboards in list
Fixes #4058.
Fixes #4528.

Prevents duplicate keyboards from appearing in the list. If there are
already duplicates in the list, they will be cleaned up the next time a
keyboard is added or removed in Configuration.
2021-03-15 20:14:56 +11:00
Marc Durdin
2e4d19be99
Merge pull request #4673 from keymanapp/fix/mac/3979-local-help
fix(mac): show local help in app
2021-03-15 20:12:42 +11:00
Marc Durdin
637cc064da fix(mac): show local help in app
Fixes #3979.

Instead of loading help.keyman.com in the support frame, we now load a
local copy of the help. External links within the help will open in the
user's browser. This avoids issues of navigation to keyboard download
and other sites which won't work well.

Also, adds Back, Forward and Home buttons to the window so the user can
navigate more easily with mouse.

Finally, this means that the local help will always be synchronised with
the app version and brings the macOS help in line with the other
platforms.
2021-03-15 17:21:19 +11:00
Marc Durdin
3ba46ad07a chore(mac): missed about window 2021-03-15 16:26:34 +11:00
Marc Durdin
0f655f99b3 chore(mac): tweak close notification 2021-03-15 16:24:53 +11:00
Marc Durdin
f8e40182fe fix(mac): release window resources on close
Fixes #3972.

Ensure that window controllers are released when we close the window, so
that we are starting again when we want to use the window again in the
future.

There are a number of ugly patterns in this code, but fixing those is
outside scope for the beta.
2021-03-15 16:05:26 +11:00
Marc Durdin
0c01f7c41d fix(mac): register configuration window on load
Fixes #3945.

When the configuration window is opened via `showPreferences`, we were
not aware that the configuration window had been opened, so subsequent
references to it would recreate it.
2021-03-15 14:59:30 +11:00
Darcy Wong
6d2354332d chore(mac): Check in markdown help 2021-02-11 15:02:16 +07:00
Darcy Wong
84d2aa6539
Merge pull request #3977 from keymanapp/chore/mac/history-stable-13
chore(mac/resources): Catch up mac history for 13.0 releases
2020-11-27 12:36:30 +07:00
Marc Durdin
ab0ed0c614 chore: address review comments 2020-11-27 15:58:21 +11:00
Darcy Wong
02843d1aaf chore(mac/resources): Catch up mac history for 13.0 releases 2020-11-27 11:29:45 +07:00
Marc Durdin
737ff45952 chore(mac): englishspanish test keyboard 2020-11-27 15:19:32 +11:00
Marc Durdin
5bcbcb260f
Merge pull request #3961 from keymanapp/fix/mac/2488-duplicate-package-filenames
fix(mac): Handle duplicate filenames for packages
2020-11-27 13:13:58 +11:00
Marc Durdin
be544f49a7 fix(mac): Handle duplicate filenames for packages
If multiple copies of a package are saved by a browser, the browser will
typically append a ` (#)` to the filename, where `#` is a number. This
should be stripped off before installation to prevent duplicates of the
package being installed.

Fixes #2488.
2020-11-26 14:44:38 +11:00
Marc Durdin
9757e4330b fix(mac): improve robustness of altool call
Handles temporary failures calling altool where Apple servers return
"Could not find the RequestUUID" for a few minutes post-upload.

Example log we are handling:

```
[04:50:44][Step 5/5] Zipping Keyman.app for notarization to /Users/mcdurdin/buildAgent/work/99b311828f4ee7c/keyman/mac/Keyman4MacIM/build/Release/Keyman.zip
[04:50:44][Step 5/5] Uploading Keyman.zip to Apple for notarization
[04:51:23][Step 5/5] <?xml version="1.0" encoding="UTF-8"?>
[04:51:23][Step 5/5] <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
[04:51:23][Step 5/5] <plist version="1.0">
[04:51:23][Step 5/5] <dict>
[04:51:23][Step 5/5] 	<key>notarization-upload</key>
[04:51:23][Step 5/5] 	<dict>
[04:51:23][Step 5/5] 		<key>RequestUUID</key>
[04:51:23][Step 5/5] 		<string>fd45e30c-5a96-4d02-9196-0923d4e5e90f</string>
[04:51:23][Step 5/5] 	</dict>
[04:51:23][Step 5/5] 	<key>os-version</key>
[04:51:23][Step 5/5] 	<string>10.15.3</string>
[04:51:23][Step 5/5] 	<key>success-message</key>
[04:51:23][Step 5/5] 	<string>No errors uploading '/Users/mcdurdin/buildAgent/work/99b311828f4ee7c/keyman/mac/Keyman4MacIM/build/Release/Keyman.zip'.</string>
[04:51:23][Step 5/5] 	<key>tool-path</key>
[04:51:23][Step 5/5] 	<string>/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework</string>
[04:51:23][Step 5/5] 	<key>tool-version</key>
[04:51:23][Step 5/5] 	<string>4.01.1182</string>
[04:51:23][Step 5/5] </dict>
[04:51:23][Step 5/5] </plist>
[04:51:23][Step 5/5]
[04:51:23][Step 5/5] Waiting 30 seconds for status
[04:51:55][Step 5/5] <?xml version="1.0" encoding="UTF-8"?>
[04:51:55][Step 5/5] <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
[04:51:55][Step 5/5] <plist version="1.0">
[04:51:55][Step 5/5] <dict>
[04:51:55][Step 5/5] 	<key>os-version</key>
[04:51:55][Step 5/5] 	<string>10.15.3</string>
[04:51:55][Step 5/5] 	<key>product-errors</key>
[04:51:55][Step 5/5] 	<array>
[04:51:55][Step 5/5] 		<dict>
[04:51:55][Step 5/5] 			<key>code</key>
[04:51:55][Step 5/5] 			<integer>1519</integer>
[04:51:55][Step 5/5] 			<key>message</key>
[04:51:55][Step 5/5] 			<string>Could not find the RequestUUID.</string>
[04:51:55][Step 5/5] 			<key>userInfo</key>
[04:51:55][Step 5/5] 			<dict>
[04:51:55][Step 5/5] 				<key>NSLocalizedDescription</key>
[04:51:55][Step 5/5] 				<string>Could not find the RequestUUID.</string>
[04:51:55][Step 5/5] 				<key>NSLocalizedFailureReason</key>
[04:51:55][Step 5/5] 				<string>Apple Services operation failed.</string>
[04:51:55][Step 5/5] 				<key>NSLocalizedRecoverySuggestion</key>
[04:51:55][Step 5/5] 				<string>Could not find the RequestUUID.</string>
[04:51:55][Step 5/5] 			</dict>
[04:51:55][Step 5/5] 		</dict>
[04:51:55][Step 5/5] 	</array>
[04:51:55][Step 5/5] 	<key>tool-path</key>
[04:51:55][Step 5/5] 	<string>/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework</string>
[04:51:55][Step 5/5] 	<key>tool-version</key>
[04:51:55][Step 5/5] 	<string>4.01.1182</string>
[04:51:55][Step 5/5] </dict>
[04:51:55][Step 5/5] </plist>
[04:51:55][Step 5/5]
[04:51:55][Step 5/5] altool failed with code 1
```
2020-11-26 11:53:35 +11:00
Marc Durdin
0981473514 chore(mac): fix iso section key code 2020-11-25 18:56:23 +11:00
Marc Durdin
01b192796a feat(mac): user-controllable legacy app list
Fixes #1953.

Makes it possible to specify additional apps that need 'legacy' handling
without requiring an updated build of Keyman for Mac. The list should be
stored in user defaults under the `KMLegacyApps` key. It can be viewed
with the command:

```
defaults read keyman.inputmethod.Keyman KMLegacyApps
```

And updated with

```
defaults write keyman.inputmethod.Keyman KMLegacyApps -array value1 value2 ...
defaults write keyman.inputmethod.Keyman KMLegacyApps -array-add value1 value2 ...
```

Each entry should be a regex that matches the client app id.

For example:

```
defaults write keyman.inputmethod.Keyman KMLegacyApps -array com.microsoft.Word '^com.github.atom$'
```

(Note for purity, the `.` should be escaped in the regex but it'll
actually be fine without...)

This commit also adds the `keymanDataPath` method on
`KMInputMethodAppDelegate`, so we can place additional configuration
data there in the future (as opposed to in the shared config which is
less easy for users to edit.)
2020-11-25 16:56:52 +11:00
Marc Durdin
daff70bebf fix(mac): arrow keys now reset context
Fixes #3939.

Arrow keys, function keys and a handful of other keys should trigger a
context reload (for legacy apps, that means a context flush). This means
that deadkeys are also flushed when any of these keys are pressed, in
the same way as a Command key or a mouse click already did.
2020-11-25 13:15:12 +11:00
Marc Durdin
6a4038497b
Merge pull request #3944 from keymanapp/fix/mac/3935-legacy-mode-for-java
fix(mac): turn on legacy mode for Java apps
2020-11-25 12:50:03 +11:00
Marc Durdin
44399fc594
Merge pull request #3924 from keymanapp/feat/mac/2601-support-102nd-key
feat(mac): Add support for "ISO" keyboard layouts
2020-11-25 12:49:53 +11:00
Marc Durdin
506a2b52f3
Merge pull request #3933 from keymanapp/fix/mac/nsstring-to-nsurl
fix(mac/engine): wrong variable type
2020-11-25 12:49:31 +11:00
Marc Durdin
0f831f7df7
Merge pull request #3932 from keymanapp/fix/mac/build-sign-post-tweaking-plist
fix(mac): re-sign files post plist update
2020-11-25 12:49:19 +11:00
Marc Durdin
044631cd54 fix(mac): turn on legacy mode for Java apps
Relates to #3935.

This switches Java apps into legacy mode. However, Java itself will need
patching to support Keyman, as it makes assumptions about input methods,
including matching specific input methods by name, before enabling its
complex text support.

I am in process of submitting a bug report and may try and submit a
patch (although the process seems a little convoluted). It requires a
change to a single file, AWTView.m, with the following diff (against
JDK 16.0):

diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
index 3e80b5a6cf3..2ae1f4f3f12 100644
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
@@ -263,6 +263,16 @@ - (void) keyDown: (NSEvent *)event {
     fProcessingKeystroke = YES;
     fKeyEventsNeeded = YES;

+    if([(NSString *)kbdLayout containsString:@"keyman"]) {
+        // Keyman handles all key events; none should be
+        // passed through as default before Keyman processes them
+        fKeyEventsNeeded = NO;
+    }
     // Allow TSM to look at the event and potentially send back NSTextInputClient messages.
     [self interpretKeyEvents:[NSArray arrayWithObject:event]];

@@ -960,7 +989,9 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange

     if ((utf16Length > 2) ||
         ((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:codePoint]) ||
-        ((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"]))) {
+        ((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"])) ||
+        ([(NSString *)kbdLayout containsString:@"keyman"])
+        ) {
         aStringIsComplex = YES;
     }
2020-11-25 09:59:10 +11:00
Marc Durdin
d849c532de chore(mac): address review comments
* Make less WET
* Add comments
* Fix mixed up key labels
2020-11-24 08:27:37 +11:00
Marc Durdin
c8000c2d9c chore: cleanup 2020-11-24 08:24:30 +11:00
Marc Durdin
e32ab796bd feat(mac): Add support for "ISO" keyboard layouts
Fixes #2601.

This PR adds support for the 102nd key as found on European layouts. It
does not however reshape the Enter key and move the BKSLASH key, as that
is a much bigger job; functionally this makes it possible to press the
102nd key, which was the biggest gap.
2020-11-24 08:24:30 +11:00
Marc Durdin
b4f08b3604 chore: fix parameters 2020-11-24 08:10:50 +11:00
Marc Durdin
f692af2545 chore: fix test 2020-11-24 08:08:33 +11:00
Marc Durdin
258fed6511 fix: wrong variable type 2020-11-24 08:04:30 +11:00
Marc Durdin
e41df6f838 fix(mac): re-sign files post plist update
Cleans up a bunch of bits and pieces around the build process and makes
sure that files are re-signed after we update the Info.plist file.
2020-11-24 08:02:16 +11:00
Marc Durdin
960a04d450
Merge pull request #3880 from keymanapp/docs/mac-readme-refresh
Update README.md
2020-11-24 06:39:37 +11:00
Marc Durdin
fe7709b8e0
Update README.md 2020-11-23 18:56:09 +11:00
Marc Durdin
e1627260f3 chore(mac): use new keyboard install page
Fixes #3898.

This reworks the keyboard download window to use the new keyboard
install page and url pattern. Some refactoring of the downloadKeyboard
method was required to handle the new download patterns.
2020-11-20 13:39:12 +11:00
Marc Durdin
c2401514cb fix(mac): support page and copyright
Fixes #3849.

* Uses keyman-staging.com when on alpha or beta
* Updates copyright year at build time
* Fixes link to help documentation (/mac, not /macosx)
2020-11-20 05:55:53 +11:00
Marc Durdin
590f7782cc chore: fix command order 2020-11-19 10:32:07 +11:00
Marc Durdin
da8dbc59fb fix(mac): codesign resilience
This PR tries to make codesign more resilient to failure, by retrying
a build step that falls over with code 65. This code is not limited to
codesign but most frequently happens with it.

A more complete answer would be to do the codesigning step in build.sh
instead of in the project, which would give us more control of the
outcome, and maybe simplify the build process somewhat, but I will
leave that for now, because it is usually better to leave that to XCode.
2020-11-19 10:24:36 +11:00
Marc Durdin
66601f5f91 fix(mac): add icon for Keyman.app
Fixes #2717.
2020-11-19 10:08:35 +11:00
Marc Durdin
be8738e9b4 chore(mac): rewrite plists after build
Instead of updating the source plist files with version information,
do this on the built artifacts so that the source files do not get
continually clobbered.
2020-11-19 09:38:32 +11:00
Marc Durdin
c8070718d9 chore: fixup plists 2020-11-19 09:07:54 +11:00
Marc Durdin
d98f042e4b chore: fix podfile for tests 2020-11-19 08:51:33 +11:00
Marc Durdin
c20cd9e20f chore: add library to tests 2020-11-19 06:03:19 +11:00
Marc Durdin
ea86ce0fbe chore: typo 2020-11-18 20:18:43 +11:00
Marc Durdin
bede3948d2 feat(mac): Sentry support
I wasn't going to do this, but realised that crash reporting was going
to be a problem on mac because it still used crashlytics/fabric. Turned
out to be a good exercise to get me back into macOS world, and fairly
straightforward to get right (helps that the other platforms broke the
ice for me).
2020-11-18 17:13:20 +11:00
Marc Durdin
105ae22a63
Update README.md 2020-11-18 11:35:30 +11:00
Marc Durdin
8db88d72ee
Update README.md 2020-11-18 10:59:19 +11:00
Marc Durdin
cda1978567
Update README.md 2020-11-18 10:14:28 +11:00
jahorton
7e10c56354 docs(common): requested comment tweaks 2020-11-17 09:57:31 +07:00
jahorton
ad6489d9d3 chore(common): adds requested comments re: tentative META flag 2020-11-17 09:42:28 +07:00