ensure topWindow answers a window (if there is no "active" top window, then the last opened)
MODIFY
src/PharoLauncher-Spec2/PharoLauncherApplication.class.st
src/PharoLauncher-Spec2/PharoLauncherApplication.class.st
@@ -237,7 +237,11 @@ PharoLauncherApplication >> imageRepositoryChanged: newImage [
{ #category : #initialization }
PharoLauncherApplication >> initialize [
+
super initialize.
+ "I want to register windows in order to be able to know which one is the last opened
+ This can be use to push progress bars (they stack)."
+ windows := OrderedCollection new.
openAsWorld := false.
imageRepository := PhLDirectoryBasedImageRepository default.
self templatesClearedOnStartup
@@ -337,3 +341,15 @@ PharoLauncherApplication >> templateRepository: aPhLTemplateGroupRepository [
PharoLauncherApplication >> templatesClearedOnStartup [
^ self class templatesClearedOnStartup
]
+
+{ #category : #ui }
+PharoLauncherApplication >> topWindow [
+ "The window that will accept a modal window related to it.
+ This is usually the top window, but in case of stacking dialogs, some times this is lost.
+ In that case, I want still choose one window"
+
+ super topWindow ifNotNil: [ :topWindow | ^ topWindow ].
+ ^ self windows
+ ifNotEmpty: [ :aCollection | aCollection last ]
+ ifEmpty: [ nil ]
+]

ensure topWindow answers a window (if there is no "active" top window, then the last opened)