Bloc has its own UIManager, UI process, event fetchers and space/worlds. Because Bloc is not yet a default UI framework in pharo we want to switch to it manualy. To do this we have a world menu entry (switch to bloc). During switching process Bloc UIManager should become current default UIManager. Bloc's root model class is Universe. Universe can have multiple spaces where each space can have multiple worlds. For each space we assign its own UIManager with UI process, fetchers and so on to allow running multiple spaces in "<parallel>". To be able to switch between pharo morphic and bloc we have by default two running spaces: Bloc Space and Morphic Space. Each of them has its own UIManager: Bloc UI manager (new one) and Morphic UIManager (one that is in Pharo without Bloc being set during��UIManagerSessionHandler>>#startup:).
In bloc, Space is responsible for starting and stopping itself (stopping listeners, stopping ui thread and so on). It means that Bloc UIManager can not exist without Bloc Space. (egg is Space, chicken is UIManager).��
We want users to be able to switch to bloc manually and allow to save image within the bloc to be able to get directly to it after startup.
(if user saves in morphic, after start up she gets to morphic. If she saves in bloc, after startup she gets to bloc).
My problem is the following method:
UIManagerSessionHandler>>#startup: isImageStarting
�� "Install the right UIManager"
�� UIManager default: UIManager forCurrentSystemConfiguration.
If there is a subclass of��MorphicUIManager in the system, a subclass will be used as default UIManager. (due to��forCurrentSystemConfiguration)
Now imagine I create a Bloc UIManager which is a subclass of��MorphicUIManager. Bloc UI Manager as described above can not live without Bloc Space, because space controls ui manager. Even if I don't want to switch to bloc - Bloc UI Manager will be used by default, which leads to NullPointerException (space is undefined).
Now Imagine that we just load Bloc as part of build process. During first image start��forCurrentSystemConfiguration��selects BlocUIManager and image crashes.
I see that something is broken. Let's find out what and where. And fix asap!