These are chat archives for AvaloniaUI/Avalonia

3rd
Jul 2016
This message was deleted
This message was deleted
Nikita Tsukanov
@kekekeks
Jul 03 2016 08:02
@grokys #553 seems good to me, we can merge it
regarding mipmapped icons, wouldn't supporting "frames" in our bitmap decoders work, as in WPF?
i think i'd prefer that rather than having two separate bitmap classes
Johan Larsson
@JohanLarsson
Jul 03 2016 12:50
@grokys I have a thing for you :)
Gonnan rename and clean it up some
Finally got around to write the auto grid thing
Darnell Williams
@Seeker1437
Jul 03 2016 13:02
Hey guys I am having issues with autofixture
it fails to install when restoring for me
Johan Larsson
@JohanLarsson
Jul 03 2016 13:04
Here is a pretty cool prototype.
Darnell Williams
@Seeker1437
Jul 03 2016 13:08
Install-Package : '.', hexadecimal value 0x00, is an invalid character. Line 1, position 1.
At line:1 char:1
+ Install-Package AutoFixture
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerS 
   hellCmdlets.InstallPackageCommand
Jeremy Koritzinsky
@jkoritzinsky
Jul 03 2016 15:37
@grokys For opacity masks, I fixed that so it works. For icons, we really should have a separate class because otherwise we have to mess with getting a CPU backed bitmap from a GPU backed bitmap and basically shoehorning the system together. The code is much simpler and more efficient with separate classes.
Jeremy Koritzinsky
@jkoritzinsky
Jul 03 2016 16:02
@kekekeks the different render test images is because of skias default background color when rendering on a transparent surface. If you try it out in-app it works perfectly.
Steven Kirk
@grokys
Jul 03 2016 18:04
the only thing i'm worried about is that it's maybe not obvious to a consumer of the api where you should use what. "i need an icon on my toolbar - oh yeah here's the Icon class, I should use that"
i don't know if that such a valid worry, but it feels like we're exposing one platform's implementation details - is it the same on all platforms?
Darnell Williams
@Seeker1437
Jul 03 2016 18:54
Sorry can anyone help me with trying to get the AvaloniaTests working on my PC?
I can't seem to figure out why restoring fails for me. I am trying to create tests for my Calendar control :(
Jeremy Koritzinsky
@jkoritzinsky
Jul 03 2016 19:08
Any gpu accelerated rendering backend will give us the same issue. Window icons are usually in the CPU. And the code is much cleaner and faster.
And for some reason Skia text rendering gets really buggy when I do it the other way even though my code doesn't touch that at all.
I can send it in as a PR so you can take a look.
Jeremy Koritzinsky
@jkoritzinsky
Jul 03 2016 19:19
It's actually platform specific for when we don't have this issue (only gtk + Cairo makes it really easy)
Nikita Tsukanov
@kekekeks
Jul 03 2016 19:21
@grokys window icons are actually like cursors, they can't always be properly represented by a bitmap
For example in Linux cursor theming is done by computing the hashsum of original cursor and providing a themed one
Andrey Kunchev
@donandren
Jul 03 2016 19:49
@kekekeks #559 is ready, removed the usage of the anonymous delegates
Nikita Tsukanov
@kekekeks
Jul 03 2016 19:52
Everything else looks good to me and it's way better than what we had before anyway
Let's merge and see if there are any issues
There could be issues with changing the foreground in the middle of the line because of font smoothing
and hinting
Andrey Kunchev
@donandren
Jul 03 2016 19:57
not sure what you're talking about, but text selection - changing the foreground of the selected text color looks like working fine to me on windows with control catalog application
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:02
I've encountered such issues previously with different text rendering engine, that's why I'm conserned
But let's merge that
Andrey Kunchev
@donandren
Jul 03 2016 20:05
@kekekeks about the avalonia designer, new version also is locking the project assembly, and to overcome that i need to close the .paml (.xaml) file i.e. kill the designer in order to build
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:07
The problem is that I can't reproduce this
Andrey Kunchev
@donandren
Jul 03 2016 20:07
i was thinking about that and the easiest solution sounds like when only xaml is show in the designer window (preview is hidden) the designer to stop the avalonia.designer.exe
this is happening after let's say 10-20 minutes of work, after open close many times .paml files
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:08
hm
Andrey Kunchev
@donandren
Jul 03 2016 20:08
this behavious is not consistent from the start
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:08
May be that's somehow related to build event handler being collected by GC
Currently there is some code that should react to build and kill all known designer processes
Andrey Kunchev
@donandren
Jul 03 2016 20:09
probaly not because the designer is killing the avalonia.designer.exe but it's started again
immediatelly
there is such code
to kill all designers
but probably not able to kill some of the processes
haven't investigated deeply
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:10
Does preview window enter "Designer process has crashed" state?
Andrey Kunchev
@donandren
Jul 03 2016 20:11
yes
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:11
And dll is still locked
Andrey Kunchev
@donandren
Jul 03 2016 20:11
yes
even if a kill manually outside visual studio
with task manager or with taskkill /im
the dlls are released for some minimal time but when the buld starts it's not able to succeed
inbetween the build designer.exe is started and locking again
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:13
Create HKEY_CURRENT_USER\Software\AvaloniaUI\Designer registry key and set AllocConsole (DWORD) to 1
Andrey Kunchev
@donandren
Jul 03 2016 20:13
i've made that
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:13
It should allocate a text console and write build events there
Andrey Kunchev
@donandren
Jul 03 2016 20:13
log looks ok
nothing suspisios
to me
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:14
Does "Restarting designer" shows up after "KillAllDesigners"?
Andrey Kunchev
@donandren
Jul 03 2016 20:14
yes
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:14
and before actual build error
Hm
Andrey Kunchev
@donandren
Jul 03 2016 20:14
it's very strange
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:15
Then VS is lying about current dte mode
            var dte = (DTE)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(DTE));
            if (dte.Mode != vsIDEMode.vsIDEModeDesign)
                return;
            try
            {
                Console.WriteLine("Restarting designer");
                _designer?.RestartProcess();
            }
Well, I guess we need to not rely on dte mode at all
And only track build state using build events
Andrey Kunchev
@donandren
Jul 03 2016 20:18
are ok with change like that: when the designer is showing only xaml (no preview) the designer.exe to be killed and not started untill designer window must be shown?
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:20
I need to investigate how our new splitter actually works
Andrey Kunchev
@donandren
Jul 03 2016 20:21
and the other problem with displaying a color chooser over xaml will be fixed
this way
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:21
yeah
Andrey Kunchev
@donandren
Jul 03 2016 20:21
if you don't have time
i can spend some to see can i implement this and provide you PR
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:23
The problem is that intellisense is currently tied to the same initialization path as designer process
And it also can lock assemblies
Even if operation freezes VS's UI thread
MSBuild can still run at the same time
Andrey Kunchev
@donandren
Jul 03 2016 20:24
hm but i'm pretty convinced that avalonia.designer.exe is locking the output assemblies, but still not 100% sure
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:25
I should probably do some refactoring for designer process lifetime management
It's a mess right now
Andrey Kunchev
@donandren
Jul 03 2016 20:26
yes probaly when the paml is on background and not visible it should be stopped also
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:26
And that "KillAllDesigners" method is a nasty hack that prevents me from debugging our designer process from the main repo
Another issue with current lifetime management implementation is that some events (e. g. changed target exe) force designer process to restart
And that's done inside AvaloniaDesigner.dll
Which restarts the process without asking if said process is allowed to run right now
But that's not the issue you are currently experiencing
since "Restarting designer" line is written by vs extension code
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:32
But for now, please, check if that build fixes your issue
Andrey Kunchev
@donandren
Jul 03 2016 20:42
ok I'll use it and notify you in few days if i notice or not the lockup, btw what has been changed in that build?
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:44
AvaloniaUI/PerspexVS@adb80a7
Whoops, the build doesn't contain changes from your PR
Andrey Kunchev
@donandren
Jul 03 2016 20:46
nice
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:47
BTW, I'd rather not overhaul that stuff before release, since we are having one pretty soon
Andrey Kunchev
@donandren
Jul 03 2016 20:47
what if that fixes the problems?
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:48
I'm afraid it will introduce new ones
Well, I'll do that in a separate branch
So we could test if it properly works
Andrey Kunchev
@donandren
Jul 03 2016 20:51
hm if this turn out to be a problem this means we can't rely on the build events of the vs and if the events are not reliable a lot of other things will have problems, so this doesn't look like a big risk to me
anyway i'll see if that fixes the locking issues
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:51
The lifetime management overhaul is about fixing my code
Which is a bloody mess right now
And relying on DTE state wasn't a good decision either
Since it only switches between "design/debug"
Andrey Kunchev
@donandren
Jul 03 2016 20:52
it still has not be proven 100% that that's the problem
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:53
Well the proper lifetime management should be built around some "DesignerShouldBeRunning" property
Andrey Kunchev
@donandren
Jul 03 2016 20:53
sure
Nikita Tsukanov
@kekekeks
Jul 03 2016 20:53
For now I'm just restarting the designer when something happens
It was ok at the time when I needed to "get something on the screen", but now that causes issues
Darnell Williams
@Seeker1437
Jul 03 2016 21:07
Alsp keep in mind closing the document windows doesnt actually "close" the window, it hides them and preserves the window's state in the RDT (Running Ducoments Table)
Nikita Tsukanov
@kekekeks
Jul 03 2016 21:08
Is there any way to know if window is shown?
Other than walking WPF's visual tree
which may be unreliable
Darnell Williams
@Seeker1437
Jul 03 2016 21:09
I'd have to look again, I can't remember atm.
Darnell Williams
@Seeker1437
Jul 03 2016 21:21
Okay so we would need to implement the IVsRunningDocumentTableEvents interface
We would listen to OnBeforeDocumentWindowShow and OnAfterDocumentWindowClose
Now the RTD interface gives notification for many types of editors besides just what we need
We would need to test that the window was a valid IVsTextView by using VsShellUtilites.GetTextView and pass the pFrame parameter passed to use by either event, we know it's a valid textview if it doesnt return null
Darnell Williams
@Seeker1437
Jul 03 2016 21:27
Sorry OnAfterDocumentWindowHide not close hehe
When the window is being shown for the first time fFirstShow will = 1
Which we can take advantage of
But I was thinking the designer should be a hypervisor the extension isnt managing it will
Andrey Kunchev
@donandren
Jul 03 2016 21:31
@kekekeks i've managed to get log when the designer is locking the output with the standart version of the designer
from the console
Darnell Williams
@Seeker1437
Jul 03 2016 21:32
@kekekeks does it seem plausible to you?
We could even take advantage of detecting loses or gains of focus
Nikita Tsukanov
@kekekeks
Jul 03 2016 21:34
You can have two documents visible at the same time
Or three
or four
Just drag documentt title and dock it somewhere
Focus isn't reliable
Andrey Kunchev
@donandren
Jul 03 2016 21:43
@kekekeks i've submitted issue of the designer lock in AvaloniaUI/PerspexVS#34
so you can check the log
next days will check the modified version of the designer
Nikita Tsukanov
@kekekeks
Jul 03 2016 21:44
Was that "Restarting designer" before the error or after it?
Was that the build from dropbox or from vs gallery?
Andrey Kunchev
@donandren
Jul 03 2016 21:45
that's from the master in vs gallery extension is nto working at all
Andrey Kunchev
@donandren
Jul 03 2016 21:46
yes last time i've checked it doesn't work at all
Nikita Tsukanov
@kekekeks
Jul 03 2016 21:46
This one was working last time I've uploaded it
Andrey Kunchev
@donandren
Jul 03 2016 21:46
it was week ago
when the vs gallery was not working
so i've build it manually on my comp
Nikita Tsukanov
@kekekeks
Jul 03 2016 21:47
AvaloniaUI/PerspexVS@5622706 - it was built from this commit
Andrey Kunchev
@donandren
Jul 03 2016 21:47
i can check it now, but definatelly was not working