picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.62k stars 328 forks source link

[develop] .ToEto().ToNative() should return the original control #2601

Open cyanfish opened 9 months ago

cyanfish commented 9 months ago

I'm not sure if this was already going to be addressed before the next version, but I was using develop and had this issue with GTK, presumably related to #2590:

var gtkControl = new Gtk.Overlay();
gtkControl.ToEto().ToNative() != gtkControl // Instead it's a new Gtk.EventBox

I haven't tested if other platforms have similar issues.

Edit: And similarly:

var control1 = gtkControl.ToEto();
var control2 = gtkControl.ToEto();

Ends up with control1 just being an orphaned EventBox with no contents.

cwensley commented 7 months ago

Thanks for the report. Yes, this should always return the same object and that change was an oversight.

cyanfish commented 6 months ago

Testing on WinForms, it doesn't seem to have the same issue but there is a different regression for (at least) key events:

var listview = new swf.ListView().ToEto();
listview.KeyDown += ...; // doesn't fire