These are chat archives for AvaloniaUI/Avalonia

23rd
Apr 2017
danwalmsley
@danwalmsley
Apr 23 2017 01:01
@aelij iv implemented your scrolling too! pretty late now! hope you like the PR! :) looking forward to your comments ;)
Eli Arbel
@aelij
Apr 23 2017 05:48
@danwalmsley Way cool :)
And AvaloniaEdit uses ValueTuple
danwalmsley
@danwalmsley
Apr 23 2017 09:47
@grokys would you mind if we setup https://github.com/aelij/AvaloniaEdit under Avalonia now?
I want to setup appveyor, etc would be nice to have it run on the official repo, rather than have to move it later
its pretty much there now in terms of a usable control.
danwalmsley
@danwalmsley
Apr 23 2017 09:54
I think I should be able to do it, to save you the time :)
Steven Kirk
@grokys
Apr 23 2017 11:16
sure, go for it!
Does this version fix nuget/build issues?
I'm not sure that I should update, kinda afraid of breaking support for other projects I'm working on
Eli Arbel
@aelij
Apr 23 2017 12:51
I think the preview can be installed side-by-side with VS 2017 RTM
Got avalonia working on top of Direct3D 11 output
Even without changes to the source code
soerendd
@soerendd
Apr 23 2017 14:09
I'm still looking for a nice ui for my raspberry pi projects. Can skia use hw acceleration on the raspberry? Maybe https://www.sfml-dev.org can be a new render backend for avalonia. It has bindings also for dotnet. Currently there is a pr for dotnet core support. What do you think? I would like to stay away from qt/c++
Nikita Tsukanov
@kekekeks
Apr 23 2017 14:10
If it has EGL support, you'd better just use skia
soerendd
@soerendd
Apr 23 2017 14:14
OK as far as I have some spare time I will try to get dotnet core running on the pi. I really do not know if skia has egl support. I know that qt supports it. But as I said I would like to stay away from that😊
Nikita Tsukanov
@kekekeks
Apr 23 2017 14:14
Skia can run on top of EGL
the question is about RPI
For now I'd recommend to stick with SW-rendering and running on top of X11+GTK
Eli Arbel
@aelij
Apr 23 2017 14:19
@kekekeks Very cool :)
Nikita Tsukanov
@kekekeks
Apr 23 2017 14:26
AvaloniaUI/Avalonia#966
Steven Kirk
@grokys
Apr 23 2017 14:36
@kekekeks nice! i think a few people have been waiting for that sample, it's great you managed to do it without touching avalonia itself!
Nikita Tsukanov
@kekekeks
Apr 23 2017 14:43
Well, I had to make TopLevel::CreateRenderTarget to be virtual
But that's not a change in the logic
It will, however, break when you'll activate retained renderer for windows
The idea is to get back buffer from direct3d's swap chain (https://github.com/AvaloniaUI/Avalonia/pull/966/files#diff-5382599dc3752fc14a1d5a0287e6c1f4R228) and just feed it to existing rendering infrastructure after rendering 3D scene https://github.com/AvaloniaUI/Avalonia/pull/966/files#diff-5382599dc3752fc14a1d5a0287e6c1f4R100
Steven Kirk
@grokys
Apr 23 2017 14:49
yeah, i assume that if someone wants D3D interop they'll use ImmediateRenderer
they can do that by using AppBuilder.UseWin32(deferredRendering : false)
Nikita Tsukanov
@kekekeks
Apr 23 2017 15:25
@grokys for some reason after upgrading VS extension to VS2017
vsix is no longer being built
Any idea what might be wrong?
Well, it works again
At least for "classic" projects
Nikita Tsukanov
@kekekeks
Apr 23 2017 16:06
I might be able to get it working for multitargeted ones
Steven Kirk
@grokys
Apr 23 2017 16:28
yeah, i tried to build it to investigate the problems with the extension but I couldn't get it to work
Nikita Tsukanov
@kekekeks
Apr 23 2017 16:29
The issue with .NET Core projects is that it uses new project model
That CPS thingy
I have no idea how to extract info from there
IVsProject only gives me info for the first of the target frameworks
Steven Kirk
@grokys
Apr 23 2017 16:30
hmm, i've not tried to do anything with SDK projects from VS
however this is the source for the new project system: https://github.com/dotnet/roslyn-project-system
you might be able to find what you're looking for there
Nikita Tsukanov
@kekekeks
Apr 23 2017 16:56
It seems that they don't expose any info
Well, I guess, I have to look for "TargetFrameworks" property and try to guess where the hell are output binaries for net4**
danwalmsley
@danwalmsley
Apr 23 2017 17:02
@aelij
@grokys can you add @aelij as a core collaborator so he can push directly to avaloniaedit repo which is now moved there
I don't seem to have enough privelleges to add people to a specific repo
Jeremy Koritzinsky
@jkoritzinsky
Apr 23 2017 17:08
@kekekeks here's some docs on CPS https://github.com/Microsoft/VSProjectSystem
Nikita Tsukanov
@kekekeks
Apr 23 2017 17:16
Yeah, I'm currently digging through source code and debugger
@jkoritzinsky could you take a look at Direct3D integration sample? I honestly have no idea what I was doing there
Ouch, missed your comment
@danwalmsley @wieslawsoltes @Seeker1437 Could you please check if it works for you with .NET Core projects with multitargeting
i. e. When you have something like <TargetFrameworks>netcoreapp1.1;net461</TargetFrameworks> in your project file
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>netcoreapp1.1;net461</TargetFrameworks>
  </PropertyGroup>
  <ItemGroup>
      <PackageReference Include="SkiaSharp" Version="1.56.2" />
      <PackageReference Include="Avalonia" Version="0.4.1-build2959-alpha" />
      <PackageReference Include="Avalonia.Gtk3" Version="0.4.1-build2959-alpha" />
      <PackageReference Include="Avalonia.Skia.Desktop" Version="0.4.1-build2959-alpha" />
      <PackageReference Include="Avalonia.Skia.Linux.Natives" Version="1.56.1.3" />
      <PackageReference Include="Avalonia.Win32" Version="0.4.1-build2959-alpha" />
      <PackageReference Include="Avalonia.Direct2D1" Version="0.4.1-build2959-alpha" Condition="'$(TargetFramework)' == 'net461'" />
  </ItemGroup>
danwalmsley
@danwalmsley
Apr 23 2017 18:29
@kekekeks can you enable Travis for AvaloniaUI/AvaloniaEdit
I don't have admin rights on travis
Il test out your plug in shortly
danwalmsley
@danwalmsley
Apr 23 2017 18:49
also can you add @aelij as a developer for that repo so he can manage prs, etc
Steven Kirk
@grokys
Apr 23 2017 18:50
@danwalmsley just added @aelij to a new avaloniaedit team in the org
and given that team admin access to AvaloniaUI/AvaloniaEdit
Nikita Tsukanov
@kekekeks
Apr 23 2017 19:38
@grokys are we releasing after merging scenegraph?
Tooling seems to be somewhat stabilized
Steven Kirk
@grokys
Apr 23 2017 20:02
tbh i'd like to release before merging scenegraph
did you manage to fix the extension on VS2017?
danwalmsley
@danwalmsley
Apr 23 2017 20:02
@grokys thanks a lot :)
Eli Arbel
@aelij
Apr 23 2017 20:02
@grokys Thanks :)
danwalmsley
@danwalmsley
Apr 23 2017 20:03
@aelij did you file an issue about black popups
I have seen this also, but been unable to pin down the cause
simple attempts to repro didn't show it for me
Eli Arbel
@aelij
Apr 23 2017 20:05
I didn't file an issue because I wasn't sure the problem wasn't in my code. I wanted a chromeless window, but also to control when it shows and hides, so I inherited from PopupRoot.
danwalmsley
@danwalmsley
Apr 23 2017 20:05
@grokys if you also have a minute can you add www.codefactor.io to the organisation, should be fairly quick to do, and enable for AvaloniaEdit too,
it basically gives automatic code reviews for PRs
picks up a lot of the mundane stuff like spacing, code style, duplicate code and complex methods
Steven Kirk
@grokys
Apr 23 2017 20:06
yeah i was meaning to investigate that - what does it give over standard github PRs?
ah ok, that might be useful
danwalmsley
@danwalmsley
Apr 23 2017 20:06
for example see here
VitalElement/AvalonStudio#369
this is a pr where is found 50 issues to be corrected in code
before considered mergable
its really awesome, it uses stylecop settings if you want custom rules
but default seems pretty good
Steven Kirk
@grokys
Apr 23 2017 20:08
yeah was going to say looks suspiciously like stylecop, which @kekekeks hated so much he refused to contribute while it was in the project ;)
Eli Arbel
@aelij
Apr 23 2017 20:11
I'm using ReSharper (got a free OSS license BTW) for code analysis, but I it won't hurt to have another tool
danwalmsley
@danwalmsley
Apr 23 2017 20:11
its pretty easy to disable some of the rules, but certainly complexity and duplicate code indicators are very useful
Steven Kirk
@grokys
Apr 23 2017 20:11
hmm
^ is nice
danwalmsley
@danwalmsley
Apr 23 2017 20:11
style rules can be relaxed
Steven Kirk
@grokys
Apr 23 2017 20:12
yes @JohanLarsson as i say we used to use stylecop
@kekekeks refused to contribute while it was active ;)
Johan Larsson
@JohanLarsson
Apr 23 2017 20:12
ouch
I don't love the verbosity of the stylecop style
Steven Kirk
@grokys
Apr 23 2017 20:13
and we use code analysis at work - i hate that
Johan Larsson
@JohanLarsson
Apr 23 2017 20:13
But I still obey it, I love to have a style enforced by the compiler
What kind of analysis?
Steven Kirk
@grokys
Apr 23 2017 20:13
so i'm kinda meh on adding more analysis
VS code analysis
Johan Larsson
@JohanLarsson
Apr 23 2017 20:14
I like analyzers, slows down build a bit but still nice
Steven Kirk
@grokys
Apr 23 2017 20:14
it makes hacking such a PITA - "yes i KNOW that variable isn't used - i just commented out a load of code to try and debug stuff"
and yes, it slows compiles down 2x
and 50% of the time it's suggestions are useless
Johan Larsson
@JohanLarsson
Apr 23 2017 20:14
that can be solved by ruleset per build def
Steven Kirk
@grokys
Apr 23 2017 20:15
yes but that's one more thing to fiddle about with and then the changes get committed and then you have to undo the changes
it just slows things down
Eli Arbel
@aelij
Apr 23 2017 20:15
Well written Roslyn Analyzers run very fast
Steven Kirk
@grokys
Apr 23 2017 20:15
yes, stylecop i never had any problems with as it's a roslyn analyser
the VS code analysis isn't and it's pig slow
Johan Larsson
@JohanLarsson
Apr 23 2017 20:16
Hera are two more analyzers since you hate them so much: WpfAnalyzers & Gu.Analyzers
Eli Arbel
@aelij
Apr 23 2017 20:16
They are rewriting it as Roslyn analyzers. Next release, I suspect
Johan Larsson
@JohanLarsson
Apr 23 2017 20:16
@aelij depends on what they do
If it is just syntax analysis it is pretty fast
Steven Kirk
@grokys
Apr 23 2017 20:17
some of those look useful @JohanLarsson
Johan Larsson
@JohanLarsson
Apr 23 2017 20:17
But nothing stopping you from climbing the entire ast
If you decide to try don't trust the disposable analyzers blindly. They catch bugs but also have bugs.
The WpfAnalyzer is simpler and somewhat stable, it does not speak C# 7 yet though.
Steven Kirk
@grokys
Apr 23 2017 20:19
tbh i'm really down on all types of code analysis right now ;)
it's the worst thing ever
Johan Larsson
@JohanLarsson
Apr 23 2017 20:20
Hope they can solve the explicit null for reference types soon
Steven Kirk
@grokys
Apr 23 2017 20:20
and we have codecov.io on avalonia currently - all it seems to do is put a red "x" on every PR
doesn't appear that anyone takes note of its output
so kinda :-1: on adding more code analysis
(though i would definitely re-add stylecop in a heartbeat)
Johan Larsson
@JohanLarsson
Apr 23 2017 20:21
@kekekeks learn to love the cop
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:27
@grokys extension seems to work, but project templates need to be upgraded
Steven Kirk
@grokys
Apr 23 2017 20:27
ok great!
lets do a release when the template are upgraded then
i should have some time to do that in the week if you don't get chance
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:29
stylecop kills any kind of productivity by enforcing meaningless formal rules
so you have to spend time to make him happy
Johan Larsson
@JohanLarsson
Apr 23 2017 20:29
what rules do you hate the most?
Time spent goes to zero ime
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:29
instead of spending it to getting things operational
Well, to be honest perspex had some weird set of rules
like using this. before field names
Johan Larsson
@JohanLarsson
Apr 23 2017 20:31
you can configure it to use underscore iirc
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:31
But why bother with it if we have Resharper
Johan Larsson
@JohanLarsson
Apr 23 2017 20:31
also this takes not time, r# adds it as you type
Upside is that it is in the compiler and comes with the code, not everyone has resharper
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:33
Tons of "issues" that don't have anything to do with the code quality
Just some meaningless arbitrary rules
We'd better integrate something actually useful
like coverity
Johan Larsson
@JohanLarsson
Apr 23 2017 20:33
yeah, warnings must be zero always
if not the useful stuff drowns in the noise
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:34
That analyzes what code does
Johan Larsson
@JohanLarsson
Apr 23 2017 20:34
mandatory 'why can't we have both' pic here I think
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:34
Instead of checking for spaces in "wrong" places
Johan Larsson
@JohanLarsson
Apr 23 2017 20:35
Formatting helps reading code, faster if the code has familiar shape.
Eli Arbel
@aelij
Apr 23 2017 20:35
I think code style is also important. Keeps everyone from each having their own style. It's also very easy to fix these things by running a formatter from time to time. That's what they do in the Roslyn repo.
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:35

An accessor can only be placed on a single line if all of the accessors in the property are placed on a single line.

This one, for example, is complete bullshit

Code is completely fine
But someone decided that "it's not good to place lines like that"
Johan Larsson
@JohanLarsson
Apr 23 2017 20:36
alt + enter fix all in sln
or mute it, set it to info, hidden or none
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:36
Aha, surely
Do you know that reordering thing in the file might break the code?
Because of the order of things actually matters
Johan Larsson
@JohanLarsson
Apr 23 2017 20:37
you mean static fields?
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:37
Static fields, reflection, etc
Johan Larsson
@JohanLarsson
Apr 23 2017 20:38
DotNetAnalyzers/StyleCopAnalyzers#1767
yes
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:41
The variable name 'lsCompletions' begins with a prefix that looks like Hungarian notation
Issue
aha
Because analyzer "thinks" that it "looks like" something that it isn't
Johan Larsson
@JohanLarsson
Apr 23 2017 20:41
It is open source, fix it?
Also pretty sure that is fixed, never seen it
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:42
I don't have time to fix things that I don't want to use in the first place
Johan Larsson
@JohanLarsson
Apr 23 2017 20:42
ok, fair enough
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:42
Because they don't add any actual value
And only bring me headache
Johan Larsson
@JohanLarsson
Apr 23 2017 20:43
Value is consistency, smaller diffs and easier on the eyes.
But meh, only formatting.
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:44
Sometimes you want to have field declaration near property bodies
Because things that change together should stay together
In other cases you probably want to have fields at the top of your class
Johan Larsson
@JohanLarsson
Apr 23 2017 20:44
As long as it is consistent imo.
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:45
Analyzer will try to enforce it's policy
because it would be "consistent"
Johan Larsson
@JohanLarsson
Apr 23 2017 20:45
good thing imo
Steven Kirk
@grokys
Apr 23 2017 20:46
yeah, imo too, but i've already had this argument, so staying out of it ;)
Johan Larsson
@JohanLarsson
Apr 23 2017 20:47
I should not either, not nice from the sidelines, sry.
I should write code.
danwalmsley
@danwalmsley
Apr 23 2017 20:48
oops I didn't mean to start this off!
@kekekeks you know about testing with a project that targets multiple frameworks
iv edited my csproj like this
Johan Larsson
@JohanLarsson
Apr 23 2017 20:48
nerd wars don't start, they never end :)
danwalmsley
@danwalmsley
Apr 23 2017 20:49
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>exe</OutputType>
    <TargetFramework>netcoreapp1.1;net461</TargetFramework>    
    <OutputTypeEx>exe</OutputTypeEx>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <PackageTargetFallback>$(PackageTargetFallback);netstandard1.3;net45</PackageTargetFallback>
    <RuntimeIdentifier>win7-x64</RuntimeIdentifier>
    <RuntimeIdentifiers>win7-x64;ubuntu.14.04-x64;osx.10.12-x64</RuntimeIdentifiers>        
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Avalonia.Desktop" Version="0.4.1-build2959-alpha" />
    <PackageReference Include="SkiaSharp" Version="1.57.0" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\AvaloniaEdit.Demo\AvaloniaEdit.Demo.csproj" />
  </ItemGroup>      
</Project>
@JohanLarsson true :)
@kekekeks but it wont build in vs2017. gives me this...
image.png
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:50
@danwalmsley it's TargetFrameworks
danwalmsley
@danwalmsley
Apr 23 2017 20:52
haha that simple!
so will it build both every time now?
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:52
At least when you hit Build
Not sure about F5
Steven Kirk
@grokys
Apr 23 2017 20:56
btw has anyone found where the new project system elements are documented?
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:57
They aren't
Only some high-level concepts
And most of it isn't open-sourced for some reason
Steven Kirk
@grokys
Apr 23 2017 20:58
i.e. TargetFramework vs TargetFrameworks
yeah the common project system isn't OSS
Nikita Tsukanov
@kekekeks
Apr 23 2017 20:59
I haven't found source code for Microsoft.VisualStudio.ProjectSystem.Implementation.dll anywhere
I've retrieved UnconfiguredProject instance using code from that example and then made my way through using debugger
There is also a better way for obtaining TargetPath, but it can't be done without async code
danwalmsley
@danwalmsley
Apr 23 2017 21:06

I didn't file an issue because I wasn't sure the problem wasn't in my code. I wanted a chromeless window, but also to control when it shows and hides, so I inherited from PopupRoot.

This is what I did in AvalonStudio very similar anyway, and have same issue, which was recently introduced in update to avalonia

but I really struggle with the popup class!
its never been kind to me!
Nikita Tsukanov
@kekekeks
Apr 23 2017 21:07
I never understood how auto-sizing works
And it goes nuts if Resize doesn't apply ClientSize immediately
(which is how X11 works)
Steven Kirk
@grokys
Apr 23 2017 21:12
hmm yeah maybe we need to redesign the popup class
probably need some unit tests for auto-sizing too, that could help make the behavior clearer
Nikita Tsukanov
@kekekeks
Apr 23 2017 21:17
I guess we need some simulation layer
Steven Kirk
@grokys
Apr 23 2017 21:17
simulation layer?
Nikita Tsukanov
@kekekeks
Apr 23 2017 21:17
To mimic weird behavior from linux on win32
So it would be easier to debug issues
It also would be nice to have some kind of disposable guard for ITopLevelImpl
Because it's being used after disposal from various places
Steven Kirk
@grokys
Apr 23 2017 21:18
yeah, all the code was written in the early days for win32 - if other platforms don't act the same we should probably handle that instead of forcing the non-win backends to behave like win
could you add an issue describing when the disposed impl is being used?
sounds like something we really need to fix
Basically every method that has a check for GtkWidget.IsClosed
Was called after disposal
On windows it was fine, because winapi just sets last error when you use invalid handle
But with GTK it means a segfault
Or, in case of safe handles, ObjectDisposedException
Steven Kirk
@grokys
Apr 23 2017 21:30
ok yeah we need to fix that