Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 16060 [details]
complete example implementation that crashes
Implementing INSWindowRestoration causes a crash when performing window restoration.
Unable to locate the block to delegate conversion method for the method WindowRestorationBug.TestWindowController.RestoreWindow's parameter #3. Please file a bug at http://bugzilla.xamarin.com.
Example solution attached. FIrst make sure "close windows the quiting an app" is turned of in General system preferances.
Then run the. Change some window locations, quit and run again
Rolf - That looks like an exception in the Runtime.cs (in your neighborhood). Bounce back to me if I'm wrong.
I can reproduce.
This happens because at runtime we need access to the BlockProxy attribute for the RestoreWindow's completionHandler, but that information is not present in the assembly because the method is a required static member (the attribute can be found for required instance members because they're on the IProtocol interface, and for optional members because they're in the Protocol_Extensions class, but for *required static* members, we don't generate anything).
Unfortunately I'm not quite sure where to add the attribute so that it's available at runtime.
a) Add required static members to the Protocol_Extensions class.
b) Add an attribute somewhere (assembly-level?) that can map delegate to blockproxy: [assembly: BlockProxy (target: typeof (NSWindowCompletionHandler), typeof (ObjCRuntime.Trampolines.NIDNSWindowCompletionHandler))]
At least b) would require some linker help though, so that those attributes aren't preserved unless needed.
I'll have to think a bit about this.
c) We can put the BlockProxy type in the ProtocolMember attribute.