monodevelop icon indicating copy to clipboard operation
monodevelop copied to clipboard

Only brings ErrorListPad to front in case of be loaded in Workbench

Open netonjm opened this issue 6 years ago • 7 comments

Only brings ErrorListPad to front in case of be loaded in Workbench

Fixes #941969 - [FATAL] System.NullReferenceException exception in MonoDevelop.MacIntegration.MainToolbar.BuildResultsView.MouseDown()

netonjm avatar Oct 28 '19 17:10 netonjm

Looking at WrapPad: http://source.monodevelop.com/#MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs,28ef42ba3aee7408

It seems that the pad is removed from the list when destroyed.

GetPad<T> goes through Pads which is only constructed once. So it is possible for it to be null because someone destroyed the window (via the x button)

Therzok avatar Oct 29 '19 12:10 Therzok

I'm pretty sure we should be reconstructing the pad if not found.

Therzok avatar Oct 29 '19 12:10 Therzok

~Yeah @Therzok, I think it depends on what behaviour we want in case of the user closes the panel (and it's destroyed).~

~In theory (please correct me if I'm wrong), this brings to the front the pad when build finishes the panel to show the build summary (errors/etc..) then here the question is do want always want to show it even though the user closes it?~

~For me makes sense as @Therzok says to force open since it is quite valuable information. thoughts @sevoku ?~

~I'm curious if being destroyed when opening it again will have the information of the finished build~

netonjm avatar Oct 29 '19 13:10 netonjm

In this case the user has clicked the error or warning icon in the status bar so we should always open the Errors window. If that means we need to re-create the Errors window then we should do that and then display it. Doing nothing would not be a good user experience.

There is a question of where this logic should go. I think the IdeApp.Workbench.GetPad should recreate the pad, if it needs to, since it knows about them instead of having the logic in several places.

mrward avatar Oct 29 '19 13:10 mrward

Makes completely sense @mrward @Therzok ! click the icon is an action entirely linked on this pad and it should recreate the panel absolutely! I was on a wrong premise.

And related to the IdeApp.Workbench.GetPad recreate, not completely sure if include it here, maybe I would include another method IdeApp.Workbench.GetOrCreatePad reusing the other logic

netonjm avatar Oct 29 '19 15:10 netonjm

I was investigating with @mrward , and we don't have any kind of dispose or remove the panel. Hide panel don't destroy the object, it seems we only dispose panels on close the IDE. I added some additional logging in case of NRE to get more information related to that

netonjm avatar Dec 02 '19 18:12 netonjm

@monojenkins rebase

netonjm avatar Jan 07 '20 12:01 netonjm