Fix default values for touchbar APIs in NSTextViewDelegate. - #3843
Conversation
|
build |
|
This looks like as reasonable change, the header file / documentation doesn't state either way and looks like our initial binding got it wrong. I'm somewhat surprised that it worked when I originally bound/tested it, but adding additional asserts is something that happens. @spouliot - Can you confirm this is not an API breaking change? I'm pretty sure it is, but can't keep the rules in my head. |
chamons
left a comment
There was a problem hiding this comment.
👍 conditionally on safety of default value change is confirmed and tests pass.
|
By the way - 🎉 thanks for the contribution! |
Build success
|
|
Yeah, i know the attributes change the gen'ed code. My question was changing the default considered an "implicit" API break, and it sounds like the answer is no. I hacked up this example: https://github.com/xamarin/mac-samples/tree/master/TouchBarExample/TouchBarExample however, it uses none of the affected APIs. It would likely be an hour or so to extend it to to use the APIs in question. Thoughts? |
|
We had QA effort in porting the "large" Apple sample, but I don't believe it was ever completed. :( |
|
As long as you are fine with a sample and not an automated unit test then basically any app with NSTextView (and any registered event) should do. We only stumbled upon it because it was consistently crashing our app. |
dalexsoto
left a comment
There was a problem hiding this comment.
I think I am fine with these changes, it does not break public API and while it is undocumented it makes sense this way. That said +1 if we can just verify that we won't throw an exception for not providing a DefaultValue but my gut says we won't.
|
So I hacked up a little test, and the only delegate method that i can confirm will not accept nil is: which gives: You can see this in this example: https://gist.github.com/chamons/91de78a7b60d1e3281aeb39ffedd044b I am uncertain about the other three changes looking closer.
|
|
The other three methods work with the default values that are currently in AppKit.cs, but at the same time it kills the default touch bar behaviour. When the methods are not implemented (eg. NoDefaultValue) then the touch bar contains an emoticon selection and spell checker corrections. When they are implemented the touch bar is empty. Note that the whole interface was extended in macOS 10.12.x with the addition of touch bar support. All applications that were created before simply didn't have the selectors implemented because they didn't exist yet. The system provides its own default implementation. |
|
|
Fixes #3824.