UltravioletFramework / ultraviolet

The Ultraviolet Framework is a .NET game development framework written in C#.
https://github.com/UltravioletFramework/ultraviolet/wiki
MIT License
542 stars 46 forks source link

Combobox crash on linux. #141

Closed fireball87 closed 3 years ago

fireball87 commented 3 years ago

When initializing a combo box I am getting a null de-reference exception in UpdateActualMaxDropDownHeight()

This happens in the segment Display.PixelsToDips(primary.Compositor.Height) as Display is null for me in this case. I am unsure whether the solution is using this.Ultraviolet.GetPlatform().Windows.GetPrimary().Display which has a value, or if it is more prudent to figure out why Display has no value for the component. This crash occurs for me with both both combo-boxes built in the xml and those with a data template.

I am running dotnet core 3.1, the current release of ultraviolet from nuget (and also the feb release that I had been running), on manjaro linux.

tlgkccampbell commented 3 years ago

Is the UI element in question attached to a valid view, i.e. is the View property non-null?

fireball87 commented 3 years ago

View is null, but I'm unaware why it would be, as I'm just adding the combo box to a UI that works without it.

The view for the combo box is null, the view for its parent a stack panel is null, the view the stack panels parent a tab item is not null though

fireball87 commented 3 years ago

Just from playing with it, If I move the combo box out of the tab-item and the tab-control then it works fine, though I need it inside the tab.

tlgkccampbell commented 3 years ago

Seems like there's an issue with the view not being correctly propagated through the tab control's visual tree. I'll see if I can reproduce it and see if I can sort it out.

tlgkccampbell commented 3 years ago

I've pushed a new build which should fix this, let me know if it works for you.

fireball87 commented 3 years ago

Yep, that fixed the issue and it is now working as expected.