15449 debug session must not refer to UI manager#15759
15449 debug session must not refer to UI manager#15759StevenCostiou wants to merge 6 commits intopharo-project:Pharo12from
Conversation
…to that global by calling the new one in Process, refactorings.
|
This is a strange design change. You moved out the variable from the scope of its users:
It is a kind of broken encapsulation. Previosly the global and its users were in one place. Now it is spread over the system |
|
I see the duplication exists in recently copied class MorphicCoreUIManager. But it seems it is not used anywhere. Why it was introduced this way (copy paste) that is the issue. |
It is just a start, the goal is to remove the dependency to the UIManager. This is just a first step, it's not that bad to start with that and see how it goes then continue the effort until we can completely remove the UIManager (which is already planned I think). |
You added the knowledge about UI to the kernel class Process. It does not look like a right change. |
I agree with all that you said, I just do not see simple solutions that we can implement now. I'm open to ideas.. On the problem of exposure to ui knowledge: we could hide it by allowing Process to propose a cache of "special processes" that its clients would use. However, if there is no UI manager, clients would require to specifically ask for "ui stuff" to the Process (or any other place where that knowledge would be). |
|
Actually, I am not found either of the clients asking for ui stuff (i.e., should One other aspect: the PR is also to see if such change can pass the test. |
|
This is a really interesting discussion. |
I dont really see how the moving of Morphic party to Kernel will help with it. UIProcess should not exist outside of Morphic as it is a pure Morphic mechanizm. Nether Bloc or gtk based UIs have it (tell me if I am wrong). So the real task is to refactor the debugger model to avoid this hardcoded errorWasInUIProcess logic. I imagine some kind of debugger pluggins where we can implement specific debugging procedures/hooks for given set of processes. |
|
Well I can investigate a Morphic extension of the debugger infrastructure, that would be removed the day we remove Morphic. I am not convinced it would entirely solve the "UImanager problem" since it is also used to day to tell that there is no ui (which also matters in the case of bloc). |
|
Ok there are no satisfying ways of doing this with what we have, tools, constraints, architecture... Can we not have an announcement launched every time we "change mode"? For example, if we start in headless, the image announces a "HeadlessMode" event and every tool who should take care of that just get the announcement and downgrade their capabilities? And same if we switch to GUI mode (that may be by default actually). |
This comment concerns all the similar issues with the debugger, that needs to know if it can open or not. |
|
So basically:
Considering that requesting a debugger does not depend on the gui system, and can even happen in a headless system, the question is:
It cannot be deffered on a debugger, because debuggers do not care about the underlying gui (in the spec logic). It could be deffered on the debugger application, but then the application should know the backnd (and then we can ask the backend what to do). |
|
OK I see what you are saying is that we need to know information about the UI Process. |
|
I discussed with Esteban and actually applications know the backend already. |
|
OK what do we do with this issue |
|
We close it ;) |
Attempt to fix #15449
It removes the two UIProcess globals that existed in two distinct Morphic classes, and moves it in Process.
A new api is proposed in Process to access that global instead of direct access by Morphic.