These are chat archives for AvaloniaUI/Avalonia

1st
Feb 2017
danwalmsley
@danwalmsley
Feb 01 2017 00:00
but for Beta 1 i will plan to have this integrated
where can I get the gdb adaptor?
danwalmsley
@danwalmsley
Feb 01 2017 00:04
thanks
there are quite a few
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 00:13
Yeah
Vscode is growing
Now that msbuild os supported in it for .net core and We got almost all from Orleans ported to it, it is my main IDE
But yes, would love to work on avalonstudio if I can help with those debugfers
I didnt had a chance to try it out
How heavy it is now?
The major reason I'm leaving full VS is because it is very heavy
danwalmsley
@danwalmsley
Feb 01 2017 00:17
well on windows it runs pretty slick
you wont be happy with the editor yet
its still a little clunky
early days
but with some help it will have bugs fixed and optimized
It loads quickly
although for c# projects its at the mercy of omnisharp
but its not bad
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 00:22
Humm
I would avoid using omnisharp if I could
Idk
Just my opinion
danwalmsley
@danwalmsley
Feb 01 2017 00:23
plan is to goto roslyn workspaces directly
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 00:23
The roslyn project system is oss
Easy to use
But you cases you have to creat a project structure on your own
And feed it with the info from the underlying project type
Damn iphone kbd
danwalmsley
@danwalmsley
Feb 01 2017 00:36
Yeah, have ti go but we should talk later about debuggers 😁
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 00:50
Yup
Ttyl
Nikita Tsukanov
@kekekeks
Feb 01 2017 00:51

The major reason I'm leaving full VS is because it is very heavy

I've just switched between git branches and had to kill devenv.exe

Because it was stuck reloading projects for several minutes
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 00:55
Yes
That is a major issue
Specially if you switch from old and new project systems
I have to always close Vs and do a git clean before open it and try build again
The only reason I use it is because Orleans still not 100% ported to netstandard yet, So I have to deal with old project system
Nikita Tsukanov
@kekekeks
Feb 01 2017 01:17
@grokys For some reason ITopLevelImpl continue to be called even after being disposed
Tooltip is a good example
Is toplevel supposed to raise Closed event in this scenario?
It seems that Renderer is not being disposed
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 10:52
@danwalmsley just tried to open Avalonia binary here and it don’t run on oSX
also, I see you are using System.Composition i.e. MEF… you know that .net core doesn’t support it yet right?
danwalmsley
@danwalmsley
Feb 01 2017 10:57
@galvesribeiro yes I know, we are going to move to MEF2 which I think is supported?
what error do you get on osx?
it has run in the past
glad you had a look
I don't have a mac, so if you can post exceptions or error log we can get it running again
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 11:00
Mihhail Maslakov
@ionoy
Feb 01 2017 11:44
hello, I'm currently working on Avalonia support for Ammy
is there a DependencyObject analogue in avalonia?
Nikita Tsukanov
@kekekeks
Feb 01 2017 11:45
AvaloniaObject
Mihhail Maslakov
@ionoy
Feb 01 2017 11:46
thanks
ResourceDictionary?
Mihhail Maslakov
@ionoy
Feb 01 2017 12:04
oh, thanks. somehow missed that
Nikita Tsukanov
@kekekeks
Feb 01 2017 12:10
@danwalmsley wanna try GTK3 backend?
danwalmsley
@danwalmsley
Feb 01 2017 12:12
most definately
do popups work now?
Nikita Tsukanov
@kekekeks
Feb 01 2017 12:12
yep
@wieslawsoltes https://travis-ci.org/AvaloniaUI/Avalonia/jobs/197048096 any idea what went wrong there?
@danwalmsley
https://dl.dropboxusercontent.com/u/18301199/Avalonia.Gtk3.dll
On windows https://sourceforge.net/projects/gtk3win/ needs to be installed. Restart explorer exe and visual studio after installation, so new PATH variable will be applied. share directory needs to be copied to bin/Debug file dialogs won't work otherwise
On Linux it should work out of the box with system GTK3
Wiesław Šoltés
@wieslawsoltes
Feb 01 2017 12:16
@kekekeks travis had full MacOS queue and some more issues , this happens sometimes
Nikita Tsukanov
@kekekeks
Feb 01 2017 12:17
@wieslawsoltes
I had to generate a separate solution for xbuild due to lack of NETStandard support: https://github.com/AvaloniaUI/Avalonia/pull/875/files#diff-4d3634747586b964df9f7712bc3ec669R620
Wiesław Šoltés
@wieslawsoltes
Feb 01 2017 12:17
yeah I've seen this, same issues as SkiaSharp I suppose
hopefully soon we will get stable msbuild for linux
Nikita Tsukanov
@kekekeks
Feb 01 2017 12:19
It worked pretty well last time I've checked. Didn't recognize mono through
But works fine with compiling and publishing for .NET Core
Wiesław Šoltés
@wieslawsoltes
Feb 01 2017 12:20
yeah but we still want to support mono on linux/osx
Nikita Tsukanov
@kekekeks
Feb 01 2017 12:20
Might be worth to build against NETStandard and run tests with mono
But they aren't dropping mono support anyway, so we should be ok
Wiesław Šoltés
@wieslawsoltes
Feb 01 2017 12:22
we can create test matrix in travis ci for all combinations, but this will increase out built times
Mihhail Maslakov
@ionoy
Feb 01 2017 13:40
are there Triggers in Avalonia?
Nikita Tsukanov
@kekekeks
Feb 01 2017 13:58
I think we have selectors instead
Mihhail Maslakov
@ionoy
Feb 01 2017 13:59
alright, i'll just remove trigger stuff from lib.ammy
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:00
Mihhail Maslakov
@ionoy
Feb 01 2017 14:04
yeah, you have a little different approach
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:24
taget netstandardand you should be safe with Mono
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:40
@galvesribeiro GTK#/Mono.Cairo aren't available for netstandard
And I'm not sure that we should abandon our current GTK# backend
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:40
humm
my dumb question is, why?
you don’t use GTK widgets, right?
you use it basically as drawing library
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:41
Well, it works
While GTK3+Skia still doesn't
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:41
Skia is there
I don’t see why you need anything more than skia
even embedded devices can use Skia
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:42
Currently the main issue with skia is native builds
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:42
my own ones are very crapy and they run it perfectly
yes, but it will be sorted soon
Matthew is working hard to get the linux build finished
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:42
GTK#/Cairo are available for almost any linux distro
since they are there since forever
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:43
Yeah, but nobody is maintaining Cairo as far as I know… it is a deadland
IMHO, you should focus on moving forward
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:43
Using GTK widgets shouldn't be an issue
They are available using C API
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:43
keeping looking at the past is what made Windows for a long time terrible
yes I know
but you dont need it
all your controls are from Avalonia
there is no point on use it I think
again, tha tis MHO
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:44
Well, we'll need GStreamer integration in the future
I also was kinda planning to use CefGlue for WebView implementation on desktop platforms
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:45
if I had to start something like Avalonia today, I would keep the most usable drawing backend for HW accell and for non-accell targets, and develop whole framework on top of it without stuck with limitations like GTK, Cairo, or some of those old stuff
use WebKit or Chrome content_lib directly
CEF is a beast bloated with unecessary things
idk, I just think you guys have an awesome work and should not stuck wasting time with those legacy technologies
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:47
Well, there is one GTK control which seems to be necessary
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:47
otherwise, you will end up being a wrapper of some other backend… just like Etos, Xamarin Forms, and so many others
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:47
GtkFileChooser
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:48
Why?
you don’t need it
do it yourself
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:48
It's already wrapped in GTK3 backend through
Well, it has support for GVFS mounts and other things
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:48
either implement it yourself or wrap down to the OS using PInvoke
the native file dialogs are there for you
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:49
GtkFileChooser is the native dialog on Linux platforms
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:49
I don’t see why you would need gtk just for that
ok, so all linuxes use GTK?
Nikita Tsukanov
@kekekeks
Feb 01 2017 14:49
At least on GTK-based desktop environments like GNOME, Unity, etc
Most of them are using either GTK or Qt
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 14:50
ok, so just PInvoke what is required to open the dialog
forget about all other stuff
what I’m saying is, do what you do best in your own framework
don’t rely on anyone else
you are a framework creator, not a platform one...
Mihhail Maslakov
@ionoy
Feb 01 2017 14:56

alright, I've finished preliminary support for Avalonia
you can install-package Ammy in Avalonia project, but at the moment latest package is still on MyGet
here is MyGet feed: https://www.myget.org/F/ammy/api/v2

Ammy doesn't have Avalonia item templates though, so you would have to modify code behind to match standard Avalonia code behind
Live reload also doesn't work yet

danwalmsley
@danwalmsley
Feb 01 2017 14:56
@ionoy awesome, cant wait to try
have you created like a demo application for it?
or some sample ammy that works?
Mihhail Maslakov
@ionoy
Feb 01 2017 14:56
no, but I can do it
you'll have to wait 10 minutes or so
danwalmsley
@danwalmsley
Feb 01 2017 14:57
doesn't have to be anything major, just a textblock and a button so we can see how to get it to work
I cant wait
this is great news
it didn't take you long
Nikita Tsukanov
@kekekeks
Feb 01 2017 15:05
@ionoy Will it be compatible with .NETStandard?
It seems that we are getting support for .NET core this weekend
Mihhail Maslakov
@ionoy
Feb 01 2017 15:08
hm, that is the question i don't know answer for :)
i think it should work, since ammy is build time only for avalonia at the moment
you will have to remove lib.ammy after restoring packages
i'm differentiating upon target framework when choosing compatible lib.ammy, but in avalonia's case NuGet doesn't know if it's WPF or Avalonia
since they have same target framework (net40)
Nikita Tsukanov
@kekekeks
Feb 01 2017 15:23
Actually the current recommended way is to use PCL
Mihhail Maslakov
@ionoy
Feb 01 2017 15:24
only AmmySidekick.dll needs to be included in a project, and it can be compiled as PCL
i've already created a working PCL version for Xamarin.Forms support
so it's possible, just tell me when you convert to .net standard
i will make sure everything works with ammy
Nikita Tsukanov
@kekekeks
Feb 01 2017 17:03
Now I hate GNOME guys
Instead of providing a package with precompiled binaries
They tell you something like "hey, there is that msys2 project, go and f*** yourself install a whole toolchain with loads of completely unnecessary stuff"
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 17:14
hehehe
yeah
I had a hard time with GTK trying to get it to compile for our ARM device
Unfortunately, they don’t support framebuffer anymore :( not to mention the bunch of dependencies it have
Nikita Tsukanov
@kekekeks
Feb 01 2017 17:18
icudata51.dll
21MB
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 17:18
yeah
ICU is one of the biggest dependencies of everything
WebKit is the same problem here
Nikita Tsukanov
@kekekeks
Feb 01 2017 17:20
I don't need it
We are using Skia for rendering anyway
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 17:21
kkkk
that is what I said… remove GTK, you dont need that, at all :P
Nikita Tsukanov
@kekekeks
Feb 01 2017 17:23
And then deal with X11?
And Wayland
And MIR
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 17:23
Maybe? You are dealing with Win32 APIs
that is part of the game
you are using a library that is suppose to be a competitor of Avalonia :)
a cross-plat UI/Widget library… that is the porpose of GTK
Nikita Tsukanov
@kekekeks
Feb 01 2017 17:24
Win32 API haven't changed for 25 years
And is quite simple
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 17:25
unless I understood wrong, that is the same purpose as Avalonia
yeah
Nikita Tsukanov
@kekekeks
Feb 01 2017 17:25
And actually has proper file dialogs (unlike X11)
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 17:25
because Windows is Stable :)
Nikita Tsukanov
@kekekeks
Feb 01 2017 17:25
MSFT knows how to make things backwards compatible
So I can use the same set of APIs that I've used back in my grade school days
You can't do that with linux
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 17:27
yup
Nikita Tsukanov
@kekekeks
Feb 01 2017 17:34
Mkay, now I'm inclined to ignore windows GTK natives completely
If someone needs them, there is 3.8 build on sourceforge
Should be fine for debugging
OSX GTK binaries, on the other hand, might be neccessary
Steven Kirk
@grokys
Feb 01 2017 17:41
guys, apologies for the slience on here. i'm ill AGAIN, sigh
Nikita Tsukanov
@kekekeks
Feb 01 2017 17:42
ouch
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 17:48
hehehe
what do you think about remove GTK, @grokys ? Just curious :)
Found precompiled binaries on nuget
danwalmsley
@danwalmsley
Feb 01 2017 17:57
why remove gtk?
@kekekeks will try gtk3 soon
Nikita Tsukanov
@kekekeks
Feb 01 2017 17:58
because it's 30MB+ blob that's not really needed anywhere but Linux
Well, we'll need proper native backend for OS X anyway
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 17:59
Quartz
I maybe can help with that
only the binding and platform stuff
as long as I dont have to draw anything I can help :P
I would love to see Avalonia free of those dependencies and use the target platform native subsystems
On OSX it should be possible to just use plain DllImport
https://github.com/AvaloniaUI/Avalonia/blob/gtk-pinvoke/src/Avalonia.Controls/Platform/Surfaces/ILockedFramebuffer.cs is the current way of interop between Avalonia.Skia and windowing subsystem
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 18:04
so that interface for example in windows would be implemented as a Bitmap, right?
danwalmsley
@danwalmsley
Feb 01 2017 18:04
Target platform native subsystems, do you mean just the windowing system
Or rendering too?
Nikita Tsukanov
@kekekeks
Feb 01 2017 18:04
On windows it's implemented with Marshal.AllocHGlobal + SetDIBItsToDevice
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 18:05
Windowing @danwalmsley… Skia work on all OSes today
danwalmsley
@danwalmsley
Feb 01 2017 18:05
Ok, rendering skia works on all
I think and that way you get identical graphics
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 18:06
exactly
for example
in webkit
Nikita Tsukanov
@kekekeks
Feb 01 2017 18:06
pBitmap is just a pointer to some unmanaged memory
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 18:06
ops
in Chrome
it draw using Skia
but there is a layer which provide the windowing
and is implemented on each platform
no 3rd party stuff there
Nikita Tsukanov
@kekekeks
Feb 01 2017 18:09
They are using gtk for linux, I think
kekekeks@KeksMPC:/tmp/wat/wat$ ldd /opt/google/chrome/chrome|grep tk
        libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f58fab20000)
        libgtk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f58fa1df000)
kekekeks@KeksMPC:/tmp/wat/wat$ ldd /opt/google/chrome/chrome|grep dk
        libgdk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 (0x00007f6920b32000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f6920910000)
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 18:10
the current version yes
but they have a new branch that is moving to Wayland as one of the target platform
Nikita Tsukanov
@kekekeks
Feb 01 2017 18:10
$ objdump -T /opt/google/chrome/chrome|egrep '(gtk|gdk)_'|awk '{print $5}'|sort -n|uniq |pastebinit
http://paste.ubuntu.com/23906394/
that platform layer is called ozone
which replace this GTK layer
Nikita Tsukanov
@kekekeks
Feb 01 2017 18:15
X11 isn't going anywhere, you know
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 18:15
yes, I know
you can still do X11 directly
:)
Nikita Tsukanov
@kekekeks
Feb 01 2017 18:16
Aha
surely
X11 directly
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 18:16
someone did :)
but ok, keep it for linux, no problem
it == GTK
abstract it away for other platforms and use what they provide
idk how it is updated but looks like everything is on this file https://github.com/frankhale/xsharp/blob/master/xsharp/xsharp.cs and it is pure PInvoke, nothing fancy
Nikita Tsukanov
@kekekeks
Feb 01 2017 18:22
The problem with X11 isn't the lack of bindings
But tons of protocol extensions
Where you need to use some atoms with magic names, etc
That's how you create your window in maximized state, for example
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 18:27
hummm ic
like I said, keep it :)
for linux
Nikita Tsukanov
@kekekeks
Feb 01 2017 18:28
I also see an issue with Quarts and .NET Core
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 18:28
which issue?
Nikita Tsukanov
@kekekeks
Feb 01 2017 18:29
I'm not sure that it's possible to call ObjC code using purely P/Invoke
Steven Kirk
@grokys
Feb 01 2017 18:31
i think @jkoritzinsky is working on a quartz backend
Nikita Tsukanov
@kekekeks
Feb 01 2017 18:33
@grokys are we OK with merging AvaloniaUI/Avalonia#875 ? It's mostly build-related stuff and GTK3 backend kinda relies on it
Steven Kirk
@grokys
Feb 01 2017 18:34
i've not had chance to lok at it yet, and too much headache to review right now :(
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 18:39
@kekekeks IIRC there is dylibfor quartz
either dylib or ObjC framework can be PInvoked
Nikita Tsukanov
@kekekeks
Feb 01 2017 18:43
Well, you need to know ObjC runtime internals then
Since I have no idea how to implement ObjC protocol from c#
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 18:46
it is an interface IIRC
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:02
The more I'm reading about using GTK on OS X, the more I'm convinced that we need to somehow live without it
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 19:03
hehehe
danwalmsley
@danwalmsley
Feb 01 2017 19:04
@kekekeks ok im on ubuntu and ready to try your gtk3 backend
do I still need same files you sent earlier or is there a newer version now?
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:04
It seems to be necessary to build the whole world and their mother
danwalmsley
@danwalmsley
Feb 01 2017 19:05
ok cheers
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:05
Just reference it and call UseGtk3
danwalmsley
@danwalmsley
Feb 01 2017 19:05
will work with skia too?
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:05
will work with skia only
No built-in renderer provided
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 19:06
quartz is a C library
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:06
@galvesribeiro are you sure that it's not CoreGraphics?
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:06
CG* prefix kinda screams about that
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 19:06
humm
yeah, you are right
danwalmsley
@danwalmsley
Feb 01 2017 19:07
what namespace is UseGtk3 in?
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:07
Avalonia
danwalmsley
@danwalmsley
Feb 01 2017 19:08
need using Avalonia.Gtk3
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:09
Ouch
My bad
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 19:12
@kekekeks the way is not use CoreGraphics directly looks like
Cocoa is the windowing system
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 19:12
we have to look on Xamarin code
they use Cocoa windowing
danwalmsley
@danwalmsley
Feb 01 2017 19:13
@kekekeks great work
a few bugs
popup isnt sizing correctly
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:13
I think they are using that libobjc.A.dylib
danwalmsley
@danwalmsley
Feb 01 2017 19:14
and menu itemns flicker between correct size and bigger size
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 19:14
@kekekeks yeah, people is suggesting me to use obj sendmessage etc
danwalmsley
@danwalmsley
Feb 01 2017 19:14
window state is ignored
like maximize, etc
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:14
window state is not implemented yet
Could you provide me with some simple example to reproduce popup issues?
Oh
danwalmsley
@danwalmsley
Feb 01 2017 19:15
did you run avalon studio other day?
i can demo it very quickly there
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:15
It seems to have broken since the last time I've checked
I can reproduce it in control catalog
I hate this gist preview btw
danwalmsley
@danwalmsley
Feb 01 2017 19:16
Screenshot from 2017-02-01 19-15-56.png
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 19:16
I have a start on a quartz backend and a appkit front end on a private branch. I'll push it out!
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 19:17
@jkoritzinsky without GTK? works on OSX or just iOS?
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:18
For iOS we could just use xamarin, since their AOT compiler will be needed anyway
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 19:19
humm
yeah
well, then Xamarin.Mac can be used for Mac as well
danwalmsley
@danwalmsley
Feb 01 2017 19:21
@kekekeks btw when I used your gtk3
it also when configured for cairo
i had feeling it was using gtk2?
then skia used the new gtk would that be correct?
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 19:27
OSX for now but can easily add an IOS render target. No GTK. Uses AppKit for windowing (ie NSWindow)
danwalmsley
@danwalmsley
Feb 01 2017 19:27
because when I loaded with cairo popups were very slow (as they previously had been)
and now with gtk3 + skia much better
danwalmsley
@danwalmsley
Feb 01 2017 19:32
the other thing is
exceptions
previously exceptions could be caught and ignored
in gtk3 backend any exception will cause the program to terminate
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:36
How exactly you were handling them?
It seems that on Linux windows are resized asynchroniously
And that triggers some kind of a loop
danwalmsley
@danwalmsley
Feb 01 2017 19:40
ok exceptions get caught and handled now I rebuild
must be a monodevelop thing
do you know why popups flicker? and dont size correctly?
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:42
There is also some resize bug
danwalmsley
@danwalmsley
Feb 01 2017 19:42
ok
hey can popup or could it
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:42
not resize, but size calculation bug
danwalmsley
@danwalmsley
Feb 01 2017 19:42
auto size itself to its content?
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:42
That won't inrease popup height
danwalmsley
@danwalmsley
Feb 01 2017 19:44
@ionoy do we have an example ammy?
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:45
Okay
I'll make popups completely ignore the actual ClientSize
And just report whatever they were asked to be
danwalmsley
@danwalmsley
Feb 01 2017 19:46
what is the ClientSize?
Nikita Tsukanov
@kekekeks
Feb 01 2017 19:54
One of TopLevel's properties
danwalmsley
@danwalmsley
Feb 01 2017 20:04
Give me 30 mins il try again
this is the appkit bindings
@jkoritzinsky I wonder if we should not just use Xamarin as the "platform" for iOS and OSX
since they are mostly a bunch of bindings to the underlying platform
not to mention what @kekekeks confirmed, that need their AOT compiler anyway
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 20:17
Yeah currently on my branch its targeting Xamarin.Mac
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 20:17
ahhh ok
so lets use it :P
leave GTK only for Linux :P
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 20:18
The windows are backed by NSWindows and Quartz renders. The AppKit part all works last time I worked with it, but there were some bugs with my Quartz renderer
I'm with you on that!
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 20:18
I think you should use Skia as the renderer
I think everything should draw using Skia
and just render on the underlying plat
ok, now let me work on AvalanoStudio debugger ;)
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 20:20
I feel like that unnecessarily binds us to using Skia and makes some interop scenarios I've been meaning to add support for really difficult.
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 20:25
skia runs everywhere I mean
I mean, you can have a single drawing code
and only hand windowing/input on the specific platform
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 20:41
What about embedding Avalonia into a c# based game engine? You can do that easily with Direct2D if the game uses D3D but its very difficult and not as efficient with Skia. (this has been a feature request for a while and is part of the long term milestone
Also for mobile apps smaller is much better so using native rendering is great if possible
danwalmsley
@danwalmsley
Feb 01 2017 20:45
@kekekeks
better
but i think measure is not correct?
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 20:46
@jkoritzinsky yes, you are right
danwalmsley
@danwalmsley
Feb 01 2017 20:46
screenshot uploading...
Screenshot from 2017-02-01 20-44-57.png
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 20:46
the problem I see is the freaking GTK dependency :)
danwalmsley
@danwalmsley
Feb 01 2017 20:50
@kekekeks also when popup content gets smaller I think you are not resizing either?
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 20:51
We can get rid of the xplat GTK dependency by only using it on Linux and using Skia as a fallback renderer when possible. GTK on Linux is ok especially for when we add gesture support and accessibility support (both on our roadmap once we stabilize more)
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 20:53
ic
Ivan Kochurkin
@KvanTTT
Feb 01 2017 20:53
Does anybody know what this issue related to? AvaloniaUI/Avalonia#869
Not working on my Windows7 machine :(
Nikita Tsukanov
@kekekeks
Feb 01 2017 20:53
@danwalmsley I think it's exactly the size you've told it to be
danwalmsley
@danwalmsley
Feb 01 2017 20:54
well for example I have a listbox inside it
its getting smaller as items are removed from list
but popup doesnt
Nikita Tsukanov
@kekekeks
Feb 01 2017 20:55

Yeah currently on my branch its targeting Xamarin.Mac

We won't have .NET Core support this way

danwalmsley
@danwalmsley
Feb 01 2017 20:55
can you see the screen shot
there is text, but it hasn't measured correctly and popup isn't big enough
Nikita Tsukanov
@kekekeks
Feb 01 2017 20:55
It might be measure issue
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 20:55

We won't have .NET Core support this way

Why?

Nikita Tsukanov
@kekekeks
Feb 01 2017 20:56
@galvesribeiro
Xamarin.Mac doesn't support .NET Core
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 20:56
hummm
wasn't aware of that
make sense... it is mono-based
xamarin.forms support... I was confused
Nikita Tsukanov
@kekekeks
Feb 01 2017 20:58
Xamarin.Forms use bait&switch
Gutemberg Ribeiro
@galvesribeiro
Feb 01 2017 20:59
yes, but it work
anyway
well
back to step 1
bind Quartz/AppKit from scratch
Nikita Tsukanov
@kekekeks
Feb 01 2017 21:09
@grokys There are lots of cases when ITopLevelImpl is called after being disposed
Nikita Tsukanov
@kekekeks
Feb 01 2017 21:29
@danwalmsley You see, in control catalog dropdowns and menus seem to be positioned perfectly
I need some simple code example to reproduce your issue
danwalmsley
@danwalmsley
Feb 01 2017 21:53
blob
Nikita Tsukanov
@kekekeks
Feb 01 2017 21:54
Yep, that's one of those cases when Avalonia tries to access disposed ITopLevel implementation
danwalmsley
@danwalmsley
Feb 01 2017 21:55
the updated dll has what changes in it?
Nikita Tsukanov
@kekekeks
Feb 01 2017 21:55
Additional calls to GDKWindow for resizing
Not sure if those will fix anything
danwalmsley
@danwalmsley
Feb 01 2017 21:56
its different
its not taking on new sizes
do you want to teamviewer to my system I can quickly show you?
Nikita Tsukanov
@kekekeks
Feb 01 2017 21:58
I'm don't think it will help. BTW do popups in ControlCatalog work fine on your machine?
danwalmsley
@danwalmsley
Feb 01 2017 22:00
let me run it an check ;)
(no batterieslibskia included)
danwalmsley
@danwalmsley
Feb 01 2017 22:14
hehehe
where are popups in control catalog?
Nikita Tsukanov
@kekekeks
Feb 01 2017 22:17
DropDowns, Menus, Tooltip
danwalmsley
@danwalmsley
Feb 01 2017 22:17
yes they look perfect to me
ok I will have to look at my popup code maybe its bad!
Nikita Tsukanov
@kekekeks
Feb 01 2017 22:19
I think I know how to reproduce it.
1) show popup
2) hide
3) resize
4) show again
Got it by changing the value of the right dropdown
damn
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 22:24
One way we can do Xamarin.Mac stuff is have our own bindings that we only include in a .net standard/net core build. We have multi targeting with .net standard and net core in the new project system so that shouldn't be too hard.
Nikita Tsukanov
@kekekeks
Feb 01 2017 22:25
hold on, it's not a popup bug, there are no calls to ClientSize in this scenario
@jkoritzinsky it should be possible to steal some code from Xamarin.Mac, since they are MIT-licensed now
I hereby surrender to our window/popup sizing system, it makes no sense to me
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 22:38
Another thing we could do is send a PR to the xamarin repo to add a .net standard reference assembly and a .net core runtime assembly. Though taking their code would work at least for now.
We'd just have to figure out the application entry point code for an AppKit application on .net core.
danwalmsley
@danwalmsley
Feb 01 2017 22:40
@kekekeks ok I think this is the problem
my popup is not recreated each time
it is reused
Nikita Tsukanov
@kekekeks
Feb 01 2017 22:41
@jkoritzinsky
I thought it uses the same system with UIApplicationMain and appdelegate
danwalmsley
@danwalmsley
Feb 01 2017 22:41
and it should resize itself to the new content
perhaps I will make a fresh popup each time
but your gtk popup doesnt resize when its re-opened
so I put content in
open
then close
then I put smaller content in
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 22:41
Its similar to iOS.
danwalmsley
@danwalmsley
Feb 01 2017 22:41
then open
and it doesnt get smaller
(or bigger)
Nikita Tsukanov
@kekekeks
Feb 01 2017 22:42
I have no idea how it works
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 22:42
but that doesn't help for people who want to have no differences in the code base between platforms
Nikita Tsukanov
@kekekeks
Feb 01 2017 22:42
Now I've restored the old behavior completely
And it magically works for menus and popups in control catalog
And I have no idea how and why
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 22:42
One thing i could do is roll the underlying structure into the platform AppBuilder.
danwalmsley
@danwalmsley
Feb 01 2017 22:43
@kekekeks the menus in control catalog are not changing content
I think if I stop reusing popup instance
Nikita Tsukanov
@kekekeks
Feb 01 2017 22:43
@jkoritzinsky We could use UIApplicationMain as our event loop or something
danwalmsley
@danwalmsley
Feb 01 2017 22:43
it will work better
Jeremy Koritzinsky
@jkoritzinsky
Feb 01 2017 22:46
Yeah that's kind of what I was thinking. I've gtg. Talk more about this once I have time to push out my WIP code?
Nikita Tsukanov
@kekekeks
Feb 01 2017 22:52
@danwalmsley
            var xpopup = AvaloniaLocator.Current.GetService<IWindowingPlatform>().CreatePopup();
            xpopup.ClientSize = new Size(200, 100);
            var t = AvaloniaLocator.Current.GetService<IPlatformRenderInterface>().CreateRenderTarget(xpopup.Surfaces);
            xpopup.Paint += delegate
            {
                using (var ctx = t.CreateDrawingContext())
                    ctx.FillRectangle(Brushes.Red, new Rect(0, 0, 9000, 9000));
            };
            xpopup.Show();

            AvaloniaLocator.Current.GetService<IPlatformThreadingInterface>().StartTimer(new TimeSpan(0, 0, 0, 0, 200),
                () =>
                {
                    xpopup.ClientSize += new Size(1, 1);
                });
This code creates a popup and resizes it as expected
            var xpopup = AvaloniaLocator.Current.GetService<IWindowingPlatform>().CreatePopup();
            xpopup.ClientSize = new Size(200, 100);
            var t = AvaloniaLocator.Current.GetService<IPlatformRenderInterface>().CreateRenderTarget(xpopup.Surfaces);
            xpopup.Paint += delegate
            {
                using (var ctx = t.CreateDrawingContext())
                    ctx.FillRectangle(Brushes.Red, new Rect(0, 0, 9000, 9000));
            };
            xpopup.Show();

            int step = 0;
            AvaloniaLocator.Current.GetService<IPlatformThreadingInterface>().StartTimer(new TimeSpan(0, 0, 0, 0, 200),
                () =>
                {

                    if (step % 3 == 0)
                        xpopup.Hide();
                    else if (step % 3 == 1)
                        xpopup.ClientSize += new Size(10, 10);
                    else
                        xpopup.Show();
                    step++;

                });
Resizing while hidden also works
danwalmsley
@danwalmsley
Feb 01 2017 22:56
ok it must be something wierd im doing
Nikita Tsukanov
@kekekeks
Feb 01 2017 22:57
That's without avalonia's code
danwalmsley
@danwalmsley
Feb 01 2017 22:57
I will take your code an re-write mine to be similar and see if I get same effect
ah
Nikita Tsukanov
@kekekeks
Feb 01 2017 22:57
Just calls to GTK itself
So I think that there is a combination of two factors
danwalmsley
@danwalmsley
Feb 01 2017 22:57
Popup class in Avalonia I think is really buggy
im sure it has to be that
I think Popup just need to be :fire:
and re-written
Nikita Tsukanov
@kekekeks
Feb 01 2017 22:58
1) X11 is async by its nature, so changes made by gtk_window_resize might not be visible immediately
2) Avalonia's layout and auto-size logic is a bit weird
3) ClientSize is being updated by Resized event handler
There is another issue that might be playing a role here
When window/popup is shown, it executes "initial layout pass"