Xpra: Ticket #1444: osx keyboard layout detection

The OSX client doesn't do any keyboard layout detection. Let's fix that.

r15090 + r15091 adds the Keyboard_info helper for osx and r15092 tries to detect the keyboard layout used by the client.

Somewhat related to #1171 (OSX server keyboard layout support).

Thu, 16 Feb 2017 17:45:27 GMT - Antoine Martin: owner changed

@afarr: do you have any non-US keyboard users? Does this help? Does the "Keyboard_info" tool show sensible values for those cases?

Wed, 01 Mar 2017 00:49:10 GMT - alas:

Got the same results with a supposedly Korean keyboard.

Will do some more research to figure out where I'm going wrong and comment again. In the meantime, I suppose I shouldn't be surprised that the keyboard info tool is outputting the following.

Schadenfreude:Helpers Schadenfreude$ ./Keyboard_info
** (process:1829): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'
** (process:1829): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'
** (process:1829): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
2017-02-28 16:48:23.329 Keyboard info[1829:35808] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
Server Managed                    : None
Missing from pointer events       : lock, control
Layout:     'us'
Layouts:    'us', 'us'
Variant:    ''
Repeat:     None

Fri, 14 Jul 2017 17:43:03 GMT - Antoine Martin:

Interesting, I changed my preferences to a US keyboard, even showed the little keyboard indicator widget in the menu bar with the US flag, but the tool still showed a British layout... Googled again and found this better answer: NSTextInputContext. This code actually works and replaces the older version in r16345. (this will be backported)

Since the full list of possible "input sources" identifiers is not specified by Apple, it's quite likely that some will be missing, but at least the most common ones are defined and should be detected. (tested with US, British, French and Thai)

Tue, 25 Jul 2017 17:07:49 GMT - Antoine Martin: status changed; resolution set

Wed, 06 Dec 2017 10:51:47 GMT - Antoine Martin:

See also: #1578, #1665.

Sat, 23 Jan 2021 05:24:29 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1444