These are chat archives for AvaloniaUI/Avalonia

20th
Mar 2018
William Humphreys
@WHumphreys
Mar 20 2018 13:18
Are there any specific compile instuctions for the framework anywhere.
DmitryZhelnin
@DmitryZhelnin
Mar 20 2018 13:19
to build it from source code?
William Humphreys
@WHumphreys
Mar 20 2018 14:35
Got pulled away to do some actual work lol @DmitryZhelnin yes
Nothing special to be honest
William Humphreys
@WHumphreys
Mar 20 2018 14:36
:-)
danwalmsley
@danwalmsley
Mar 20 2018 20:12
@grokys iv noticed something missing from window implementations
seems when a window looses focus, the controls inside the window should also loose their focus
but right now that doesn't happen
danwalmsley
@danwalmsley
Mar 20 2018 20:18
I think I just need to add this for win32
case WindowsMessage.WM_SETFOCUS:                    
                    return IntPtr.Zero;

                case WindowsMessage.WM_KILLFOCUS:
                    return IntPtr.Zero;
but not sure what to do inside the case statement yet
not looked into gtk yet
hmmm what do you think about adding a Action<bool> FocusChanged { get; set; } to IWindowImplBaseis that the right place for this?
Steven Kirk
@grokys
Mar 20 2018 21:07
just tried this on WPF and the focused control doesn't fire LostFocus when the window is deactivated
or do you mean something else?
danwalmsley
@danwalmsley
Mar 20 2018 21:14
Does the window get a lost focus event in wpf?
danwalmsley
@danwalmsley
Mar 20 2018 21:26
basically the caret in my editor keeps flashing when the window is not selected
meaning the ui is constantly being rendered
most editor apps the caret stops when the window isnt focused
Steven Kirk
@grokys
Mar 20 2018 21:27
no, the window gets a Deactivated event, same as we do
danwalmsley
@danwalmsley
Mar 20 2018 21:27
without the window focus not being updated Im not sure how to implement that
hmm ok
Steven Kirk
@grokys
Mar 20 2018 21:28
i think the the caret somehow needs to hook into the window activation
wonder how WPF handles it?
danwalmsley
@danwalmsley
Mar 20 2018 21:28
just trying an example now to see what happens
danwalmsley
@danwalmsley
Mar 20 2018 21:38
no clue as to how it handles it,
but it does
Steven Kirk
@grokys
Mar 20 2018 21:39
heh
so yeah as far as i can see we're firing the right events
Stano Turza
@Sorien
Mar 20 2018 21:41
In win32 controls gets wm_setfocus and wm_killfocus when active window changes as i remember
Steven Kirk
@grokys
Mar 20 2018 21:43
yeah, WPF doesn't seem to preserve that behavior though. i wonder if UWP does?
danwalmsley
@danwalmsley
Mar 20 2018 21:45
you wouldnt want to actually loose focus of your controls when window is deactivated though
because when the window is selected focus should be maintained
Steven Kirk
@grokys
Mar 20 2018 21:47
i guess we need to look for the root WindowBase and hook into the Deactivated event?
which seems a bit... wrong
danwalmsley
@danwalmsley
Mar 20 2018 21:48
is caret part of textbox control in wpf do you think?
or is it part of or related to input manager?
Steven Kirk
@grokys
Mar 20 2018 21:48
i just tried to find it on referencesource.com and failed
danwalmsley
@danwalmsley
Mar 20 2018 21:49
yeah iv been looking too
Event section
Steven Kirk
@grokys
Mar 20 2018 22:19
@Sorien what are you referring to specifically?
William Humphreys
@WHumphreys
Mar 20 2018 22:20
Is the source to wpf available
Steven Kirk
@grokys
Mar 20 2018 22:20
but we can't copy it
"Reference use" means use of the software within your company as a reference, in read only form, for the sole purposes of debugging your products, maintaining your products, or enhancing the interoperability of your products with the software, and specifically excludes the right to distribute the software outside of your company.
so we can use it to interoperate but we can't use the code itself
thankfully, WPF's code is 1. really dated and 2. pretty bad, so that's not a huge problem ;)
Stano Turza
@Sorien
Mar 20 2018 22:24
Edits reacts to keyboard focus changes and focus lost is logical focus efekt
Efekt
Steven Kirk
@grokys
Mar 20 2018 22:25
but WPF doesn't raise a logical focus lost event when the window is deactivated as far as i can see
Stano Turza
@Sorien
Mar 20 2018 22:27
Its ok but edit reacts to some keyboard focus lost event
William Humphreys
@WHumphreys
Mar 20 2018 22:34
Ive just download the source to Avalonia so I can have a play. WIndows VS 2017. Is there anything I have to build first etc I notice it has this cake thing which Im assuming is some sort of build tool.
Steven Kirk
@grokys
Mar 20 2018 22:35
@Sorien sorry i don't understand
@WHumphreys you just follow the build instructions: http://avaloniaui.net/contributing/build
cake is only used by the CI
basically you just need to do:
git clone https://github.com/AvaloniaUI/Avalonia.git
git submodule update --init
then open the solution in VS
William Humphreys
@WHumphreys
Mar 20 2018 22:42
:-0
cool
Its going to take a while to sift through all that. Theres a lot going there lol
Jeremy Koritzinsky
@jkoritzinsky
Mar 20 2018 22:46
In WPF the caret is part of the TextSelection and is only enabled when the TextBoxBase that contains it is in keyboard focus.
The actual caret element is in the CaretElement class.
Jeremy Koritzinsky
@jkoritzinsky
Mar 20 2018 23:00
I think when you unfocus a window in WPF it resets keyboard focus. That's the only code-path I see that stops the caret from blinking and stops the text from staying selected.
Btw windows has a lot of built in knowledge of carets and a number of related functions and accessibility hook-ins:https://msdn.microsoft.com/en-us/library/windows/desktop/ff468799(v=vs.85).aspx (and comments in WPF reference source about how Win32 carets hook into Magnifier).
Steven Kirk
@grokys
Mar 20 2018 23:32
@jkoritzinsky but when keyboard focus is lost, then LostFocus should be fired, right?
William Humphreys
@WHumphreys
Mar 20 2018 23:56
If I build the whole solution I get various errors in the unit tests. It seems to be a vissual studio issue. Does it do this normally. i.e.Assets file 'C:\BitBucket\Avalonia\tests\Avalonia.UnitTests\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.0'. Ensure that restore has run and that you have included 'netcoreapp2.0' in the TargetFrameworks for your project. Avalonia.UnitTests C:\Program Files\dotnet\sdk\2.1.102\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets 167
Compile errors (not the unit tests themselves)