These are chat archives for AvaloniaUI/Avalonia

10th
Nov 2016
Jeremy Koritzinsky
@jkoritzinsky
Nov 10 2016 00:21
@danwalmsley @donandren Can you take a look at #800? I fixed our build script to include the Skia render tests and to fail on test failure. As a result, some of the Skia FormattedText tests are failing in relation to the recent change you made. I give you permission to commit onto my branch.
danwalmsley
@danwalmsley
Nov 10 2016 09:37
@jkoritzinsky ok I will check this out
danwalmsley
@danwalmsley
Nov 10 2016 10:06
@grokys @jkoritzinsky any idea how I can run the skia render tests in test explorer, It only seems to enumerate the Direct2d ones
Steven Kirk
@grokys
Nov 10 2016 10:23
hmm no idea. @kekekeks set up the render tests so that they all use a shared .projitems - i wonder if that's what's causing it not to get recognised? but then how come it recognises the d2d ones?
i don't use test explorer so i've never noticed
Jeremy Koritzinsky
@jkoritzinsky
Nov 10 2016 17:55
@danwalmsley It should just work. Btw the measurement test for an empty string "" is still failing.
danwalmsley
@danwalmsley
Nov 10 2016 19:37
@jkoritzinsky hey
there was a hack to adjust the expected results just for skia...
i'll take a look at measurement for empty string ;)
might have to be in the morning though
Jeremy Koritzinsky
@jkoritzinsky
Nov 10 2016 20:45
Ok. Just want to make sure we get that in quickly to help with making sure PRs work
It looks like the empty string test passed with the hack in place. Maybe the measurement change you made didn't effect the measuring of an empty string?
danwalmsley
@danwalmsley
Nov 10 2016 20:47
my previous PR elimintated need for hack
but I didn't take into account empty string...
i'll try to get onto it soon
got something to sort out first i'll try my best
Jeremy Koritzinsky
@jkoritzinsky
Nov 10 2016 20:50
Ok. Thanks for your help!
danwalmsley
@danwalmsley
Nov 10 2016 21:01
@jkoritzinsky so all the other tests are definitely passing?
I must have gotten lucky on that one!
Jeremy Koritzinsky
@jkoritzinsky
Nov 10 2016 21:05
It looks like they are!
danwalmsley
@danwalmsley
Nov 10 2016 21:13
lets see if all the skia test pass now @jkoritzinsky
;)
danwalmsley
@danwalmsley
Nov 10 2016 21:21
@jkoritzinsky looks like that's fixed it
probably will have to wait quite a while for the mac tests to run :(
Jeremy Koritzinsky
@jkoritzinsky
Nov 10 2016 21:25
The render tests don't get run on Linux or mac as of now. Same as it always was.
danwalmsley
@danwalmsley
Nov 10 2016 21:26
yeah, its just the travis queue for our ci to run on osx that's taking ages
danwalmsley
@danwalmsley
Nov 10 2016 21:32
how does that always happen
I get low battery dialog
go for my charger!!
the exact instance I plug it in
what happens!
this happens to everyone else right?
Jeremy Koritzinsky
@jkoritzinsky
Nov 10 2016 21:35
Idk
danwalmsley
@danwalmsley
Nov 10 2016 21:36
shutsdown the exact moment you plug it in!
everytime!
Jeremy Koritzinsky
@jkoritzinsky
Nov 10 2016 22:13
That's really weird
Jeremy Koritzinsky
@jkoritzinsky
Nov 10 2016 22:27
@grokys Can you take a look at #800 and review it when you get a chance?
Steven Kirk
@grokys
Nov 10 2016 22:30
sure, taking a look now
why did you have to change the output path to /artifacts?
Jeremy Koritzinsky
@jkoritzinsky
Nov 10 2016 22:32
So the relative paths used to find the test files can be the same between running tests via test explorer and running via cake
Steven Kirk
@grokys
Nov 10 2016 22:33
oh so cake runs the tests differently? excuse my ignorance, i'm not completely familar with the way the cake stuff works!
Jeremy Koritzinsky
@jkoritzinsky
Nov 10 2016 22:36
To make the codecov file a reasonable size I had to copy all the test files to the same directory
I picked artifacts/tests because it seemed like a good choice
Steven Kirk
@grokys
Nov 10 2016 22:37
ah ok, i'm still not entirely sure what you mean but i trust you ;)
yeah LGTM
is it ready to merge?
danwalmsley
@danwalmsley
Nov 10 2016 22:43
@grokys are you referring to #800?
Steven Kirk
@grokys
Nov 10 2016 22:43
yeah
danwalmsley
@danwalmsley
Nov 10 2016 22:43
ok
not that I know the answer!
just otherwise I was going to pester Jeremy about it too!
danwalmsley
@danwalmsley
Nov 10 2016 22:48
@grokys ok I finially have a little time to work on items control again
if this test here is passing
then doesn't that suggest all items are logical children?
so if in Avalon studio that is not happening, there might be another reason for that?
or that Carousel breaks this behaviour?
Steven Kirk
@grokys
Nov 10 2016 22:49
that test means that all items that implement Ilogical are immediately logical children
so if you say listBox.Items = new[] { new ListBoxItem() } then immediately the listbox will have 1 logical child
however the alternative is: listBox.Items = new[] { "foo" }
danwalmsley
@danwalmsley
Nov 10 2016 22:51
ok
ah ok then that will have to wait until templates have been applied
Steven Kirk
@grokys
Nov 10 2016 22:51
if an item isn't a control then we need to wait for the presenter to materialize it before it can be a logical child
yep
danwalmsley
@danwalmsley
Nov 10 2016 22:52
just going to look at my Avalon studio problem again
Steven Kirk
@grokys
Nov 10 2016 22:52
i was having trouble remembering the reason for this, but i remembered in the end
it's because styling and therefore templates are applied when a control is attached to the logical tree
so if a control is added to a carousel you can style it immediately
if it's only styled when the carousel displays it, then its styling will be added and removed
causing the template to be added and removed
which isn't ideal, as it can be slow
or was slow
shouldn't be so slow now
does that make sense?
danwalmsley
@danwalmsley
Nov 10 2016 22:55
more or less
I just need to look at the problem I'm having in Avalon studio, to see if its caused by this..
danwalmsley
@danwalmsley
Nov 10 2016 23:01
hmm perhaps it could be a problem with DockNC
if you see the print outs iv done of visual ancestors when my control is attached and detached from visual tree
here
AvaloniaUI/Avalonia#798
the first set of data shows without DockNC in the way
and you can see that the logical ancestors include carousel...
but the second set of data carousel is there too
but not in the logical ancestors the only difference is docknc
Steven Kirk
@grokys
Nov 10 2016 23:05
i can't really tell what i'm looking at there...
danwalmsley
@danwalmsley
Nov 10 2016 23:06
ah I remember... this test.. (sorry if we end up going over stuff again)
its currently failing because child is of type ContentPresenter
and we need to fix that in items control
Steven Kirk
@grokys
Nov 10 2016 23:07
yep, that was the point we were at
danwalmsley
@danwalmsley
Nov 10 2016 23:07
ok
took a while for me to remember... was only 2 days ago
Steven Kirk
@grokys
Nov 10 2016 23:07
haha i know the feeling well!
danwalmsley
@danwalmsley
Nov 10 2016 23:07
ok so I will try to fix that, I couldn't find exactly where the logical child gets set to contentpresenter
but will try and step through again
Steven Kirk
@grokys
Nov 10 2016 23:08
but tbh i don't know if that's your problem, even if the logical children aren't set, the logical parent can be
danwalmsley
@danwalmsley
Nov 10 2016 23:08
ok
so you can traverse upwards and not downwards in some cases...
would you have time to run a really simple repro of the bug on Avalon Studio?
Steven Kirk
@grokys
Nov 10 2016 23:09
i'm right in the middle of trying to get deferred rendering working...
danwalmsley
@danwalmsley
Nov 10 2016 23:10
no worries then
I will try to fix this bug
and hope its the one that's causing me the headache
Steven Kirk
@grokys
Nov 10 2016 23:11
i think there's a test you can try
check what the contentPresenter.Childs logical parent is
danwalmsley
@danwalmsley
Nov 10 2016 23:13
parent is carousel
Steven Kirk
@grokys
Nov 10 2016 23:13
ok,so that's not your problem
danwalmsley
@danwalmsley
Nov 10 2016 23:13
oh wait
child is null!
contentPresenter.Child is null
Steven Kirk
@grokys
Nov 10 2016 23:14
UpdateChild
always UpdateChild
danwalmsley
@danwalmsley
Nov 10 2016 23:14
ok ;)
Steven Kirk
@grokys
Nov 10 2016 23:15
even if i fix AvaloniaUI/Avalonia#787 you'll still need to UpdateChild in tests if there's no logical root, actually
danwalmsley
@danwalmsley
Nov 10 2016 23:16
ok contentPresenter.Child.Parent is ContentPresenter!
that sound correct, or should it have been Carousel?
Steven Kirk
@grokys
Nov 10 2016 23:16
that's correct for the current state of things
and what's contentPresenter.Parent?
danwalmsley
@danwalmsley
Nov 10 2016 23:16
that's Carousel
Steven Kirk
@grokys
Nov 10 2016 23:17
ok, so there's a route to the carousel from the item
so i don't think that's your problem, do you agree?
danwalmsley
@danwalmsley
Nov 10 2016 23:17
yes
I agree!
hmm ok I'm going to run Avalon studio on the dlls iv compiled here, and try find a way to step through and see exactly what is happening ;)
might it be worth looking at tracing? or will that only show problems with bindings?
Steven Kirk
@grokys
Nov 10 2016 23:23
it shows all sorts of things ;) what are you looking for?
danwalmsley
@danwalmsley
Nov 10 2016 23:23
visual tree getting broken before ondetachedfromvisual tree getting called
basically my document tabs
Steven Kirk
@grokys
Nov 10 2016 23:24
no, the only checks for that sort of thing result in an exception
danwalmsley
@danwalmsley
Nov 10 2016 23:24
when I close them now
Steven Kirk
@grokys
Nov 10 2016 23:24
but it's the visual tree?
danwalmsley
@danwalmsley
Nov 10 2016 23:24
it gives exception cannot find root when it detaches the control
yeh visual tree.
oh in the test we only looked at logical tree!
Steven Kirk
@grokys
Nov 10 2016 23:25
ah, i thought the problem was with the logical tree
yeah, we've been talking about the logical tree
the visual tree is way simpler
danwalmsley
@danwalmsley
Nov 10 2016 23:25
sorry man iv been confusing myself with all this
ok so that same test I could run it and check the visual parent and visual child of those controls
and see if they are as expected
Steven Kirk
@grokys
Nov 10 2016 23:26
yeah
the correct page will need to be selected for the control to be in the visual tree though
where is the exception being thrown?
danwalmsley
@danwalmsley
Nov 10 2016 23:30
just checking
this is mad its been causing me problems all day long now I cant repro it!!!
danwalmsley
@danwalmsley
Nov 10 2016 23:41
@grokys when OnDetachedFromVisualTree gets called... should I expect to still have visual children?
or would all the visual children have been removed before?
Steven Kirk
@grokys
Nov 10 2016 23:43
the control that it's being called on will have already been detached from the visual tree
so its visual parent should be null and it shouldn't be present in its former visual parent's visual children
danwalmsley
@danwalmsley
Nov 10 2016 23:44
ok but its own children
my thinking is that they would have also been detached first?
Steven Kirk
@grokys
Nov 10 2016 23:46
no, their visual parents and visual children won't change
that would be a nightmare if you wanted to reattach a control somewhere else!
danwalmsley
@danwalmsley
Nov 10 2016 23:47
ah completely makes sense now
Steven Kirk
@grokys
Nov 10 2016 23:48
the detachment event travels down the detached tree, as each control needs to know it's been detached
but the tree below the detach point doesn't change
danwalmsley
@danwalmsley
Nov 10 2016 23:48
ok
image.png
ok I blame docknc (sorry @Seeker1437 )
its the only thing that is keeping a reference to my editor!
the root exception was me doing something weird to try and fix this memory leak, but looks like docknc is actually holding reference.
Steven Kirk
@grokys
Nov 10 2016 23:49
ah cool
we still need to fix the contentpresenter thing, but that can come later
danwalmsley
@danwalmsley
Nov 10 2016 23:50
I will still have a go at it
I'm sure its causing me other problems somewhere along the line...
Steven Kirk
@grokys
Nov 10 2016 23:51
thing is, i'm still not sure what the correct behavior is
either the children are the ContentPresenters but the presenters children are set up correctly
or the children are the presenter's children
probably the latter, but that's harder to do
actually no, it needs to be the latter
ok, decided ;)
so if you do:
<ItemsControl>
  <TextBlock/>
</ItemsControl>
that should be the logical tree
danwalmsley
@danwalmsley
Nov 10 2016 23:54
ok right, well I can probably push a simple unit test for that to start with
Steven Kirk
@grokys
Nov 10 2016 23:54
yep, then there's the case of:
<ItemsControl>
  <x:String>foo</x:String>
</ItemsControl>
which should have the same logical tree as the previous example (assuming a TextBlock data template for a string)
btw the deferred rendering is going pretty well
we now have hit testing to shapes
danwalmsley
@danwalmsley
Nov 10 2016 23:56
sweet
so this will just render stuff that's on the screen and when things change?
giving a performance boost
Steven Kirk
@grokys
Nov 10 2016 23:56
yeah
i still need to get it to only draw dirty regions though
danwalmsley
@danwalmsley
Nov 10 2016 23:57
cant wait to try it!
I bet tracking that is not going to be easy
Steven Kirk
@grokys
Nov 10 2016 23:58
i don't think it'll be too difficult now we have a low-level scene graph