I am working with a Winforms application that uses an MDi layout.
Target Framework .Net 4.5.2
Tested with both:
CefSharp 71.0.2 and 79.1.360.
I am having a problem with MDIihild activation order after I close the active MDiChild.
Here is roughly what I do (this shows window activation). A: Indicates what form is currently activated.
I open a searchform,
A: Searchform 1, I perform a search which opens
A: Searchresultform 1, where I select one of the searchresults which opens
A: Resultform 1
So far so good, I open a new searchform
A: Searchform 2, I perform a search which opens
A: Searchresultform 2, where I select one of the searchresults which opens
A: Resultform 2
So far still so good, I now have 6 childforms open, stacked nicely on top of each other. Now I close the top one (Resultform 2), and the expected childform (the one beneath it in the stack) is opened.
A: Searchresultform 2, I close this one (still no problems)
A: Searchform 2, I close this one and now something weird happens
A: Resultform 1, which is on top of the stack is activated, but immediately
A: Searchform 1, is activated putting itself on top of the stack (oh oh)
Further, I close Searchform 1 and
A: Resultform 1, is activated but immediately
A: Searchresultform 1, is activated and when I close this
A: Resultform 1, is activated (which is the sole remaining window)
There is no code in the application that activates windows.
Of note is that this only fails (works this way) if we use the "new" Resultform containing an embedded browser using CefSharp. If we use the "old" Resultform this behaviour does not occur.
What I am wondering is:
a) Has anyone experienced similar behaviour and can point me in a general direction? b) Anyone have any suggestions on how to debug this?
I have tried to look at the callstack if I debug the OnActivated event, but it only shows external code (not helping me).
I cannot produce an example of this behaviour, as that would most likely allow me to figure it out on my own (the application is > 100.000 loc).