-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if current application is not null in FocusElementManager Curre… #33
Check if current application is not null in FocusElementManager Curre… #33
Conversation
8899907
to
5ecc217
Compare
Hi, thanks a lot for the pull request - I'd realy like to merge it into the code and release a new version but I need to better understand what the problem is that we are fixing. I could off course be going off and be doing guess work but I prefer communication :-) Would you be able to give me a short description for this fix? It would, for example, be enough if you give me a short list of test steps and an expectation to verify how the software behaves with and without your fix. Thanks Dirk |
I gather from the links below that you want to improve non-WPF support, like WinForms, correct? ...but if we use |
Sorry, I should have added a description here as well. |
OK, if you see Application.Current == null on shutdown we should definitely fix this. I just never saw this problem and did not know its possible until I searched the net today. I am just not sure about the AppDomain bit
So, we could either do the change below (and leave AppDomain to some other point in time) or also attach an AppDomain Exit event in private static void Current_Exit( object sender, EventArgs e )
{
if (Application.Current != null)
Application.Current.Exit -= Current_Exit;
if( _windowHandler != null )
{
_windowHandler.FocusChanged -= new EventHandler<FocusChangeEventArgs>( WindowFocusChanging );
//_windowHandler.Activate -= new EventHandler<WindowActivateEventArgs>(WindowActivating);
_windowHandler.Detach();
_windowHandler = null;
}
} |
5ecc217
to
e3fd8b0
Compare
e3fd8b0
to
cb1c51a
Compare
I took another look at this and I only used a null check for now which seems enough. |
This will be in the next release version 3.5.6 (most likely this weekend just because I don't want to build another release every day) but you could get the binaries from CI should you need it more urgent. OK, thanks for your time and explaining it - I should have seen the point in the other PR (dah...) but I just hate to guess around critical fixes :-) |
…nt_Exit method