These are chat archives for AvaloniaUI/Avalonia

18th
Aug 2018
Nicolas Musset
@Kryptos-FR
Aug 18 2018 02:51
Can someone take a review of #1810 as well? Or tell me what is missing to get it merged.
Jeremy Koritzinsky
@jkoritzinsky
Aug 18 2018 02:52
@Kryptos-FR it needs unit tests. Also it needs to pass the CI builds. I'll try to review it once I get a chance. Once all 3 of those things are done we'll merge it in.
Nicolas Musset
@Kryptos-FR
Aug 18 2018 04:33
The CI builds failed but not because of my commits. How can we trigger them again?
And I'm not sure how you can unit test such a simple method. Just calling is the same has having the compilation pass.
Writing unit tests for the sake of unit test is not helping in my opinion. It just increased the size of code needing to be maintained.
Nicolas Musset
@Kryptos-FR
Aug 18 2018 04:39
And I figured the same conclusion was reached since there a no existing unit tests for the dispatcher class or the jobrunner class.
Jeremy Koritzinsky
@jkoritzinsky
Aug 18 2018 04:42
Really we don't have unit tests for those?
Thought we did. OK you're good. I'll retrigger the builds tomorrow and do a review pass.
Jumar Macato
@jmacato
Aug 18 2018 04:43
@jkoritzinsky @Kryptos-FR i've already restarted CI for that PR just now :)
Jeremy Koritzinsky
@jkoritzinsky
Aug 18 2018 04:44
👍
Nicolas Musset
@Kryptos-FR
Aug 18 2018 04:45
@jkoritzinsky At least I didn't find any.
Jeremy Koritzinsky
@jkoritzinsky
Aug 18 2018 04:46
I just took a look and didn't see any. You're all good
Nicolas Musset
@Kryptos-FR
Aug 18 2018 04:48
:thumbsup:
btw do you usually rebase for a single commit PR?
Jeremy Koritzinsky
@jkoritzinsky
Aug 18 2018 04:51
Sometimes. I don't really care one way or the other. Depends what I'm feeling that day.
Nicolas Musset
@Kryptos-FR
Aug 18 2018 06:03
Hm. It looks like my changes are causing the timeout in the tests. I'll investigate later when I have some time.
Nicolas Musset
@Kryptos-FR
Aug 18 2018 06:17
Ok that was a stupid mistake. Will push a fix.
danwalmsley
@danwalmsley
Aug 18 2018 10:42
Screen Shot 2018-08-18 at 11.38.57.png
@jkoritzinsky what language version is required to support this?
danwalmsley
@danwalmsley
Aug 18 2018 10:51
hmm seems vs for Mac is behind!
danwalmsley
@danwalmsley
Aug 18 2018 14:48
it seems navigation doesnt work when using an IEnumerable for your menu items
danwalmsley
@danwalmsley
Aug 18 2018 14:55
@grokys added a repro here, menu navigation and selection doesnt work if you bind the menu items to an ienumerable type
@jp2masa you around, this line
is not compatible with the new menu navigation fixes in avalonia
if I change it to = children.ToList() it fixes it
but will this break the menu system? Im assuming its needed so that menus are rebuilt or calculated when they are opened?
Jeremy Koritzinsky
@jkoritzinsky
Aug 18 2018 14:59
I think it's a C# 7.2 feature. Might be 7.3.
danwalmsley
@danwalmsley
Aug 18 2018 15:00
seems vs for mac just ignores langversion
Vsevolod Pilipenko
@Karnah
Aug 18 2018 15:31
Good day. Exists way to seal writable bitmap? new Bitmap(writableBitmap.PlatformImpl) not working :)
Vsevolod Pilipenko
@Karnah
Aug 18 2018 17:28

Oh. I finded constructor at Bitmap with pointer! This fix my problem. But should I worry about memory leak, if I'll use next code?

var unmanagedPointer = Marshal.AllocHGlobal(data.Length);
Marshal.Copy(data, 0, unmanagedPointer, data.Length);
var bitmap = new Bitmap(PixelFormat.Rgba8888, unmanagedPointer, width, height, width << 2);

Thanks in advance :)

Jeremy Koritzinsky
@jkoritzinsky
Aug 18 2018 17:41
Yeah that'll leak memory if you never release the unmanaged memory
Vsevolod Pilipenko
@Karnah
Aug 18 2018 17:47
it's a pity. I need fast convert RGBA byte array to bitmap. It seems to me that WriteableBitmap slower than common Bitmap and crush application on Direct2D1. I'll try research this problem :C
Thanks a lot!