The Trunk: ST80-mt.308.mcz

[email protected] Wed, 10 Jun 2026 15:26:03 0000
Newsgroups gmane.comp.lang.smalltalk.squeak.general
Message-ID <[email protected]>
Marcel Taeumel uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-mt.308.mcz

==================== Summary ====================

Name: ST80-mt.308
Author: mt
Time: 10 June 2026, 5:26:03.157835 pm
UUID: a4702a2e-5359-8b4e-afb6-97b1e3bce1eb
Ancestors: ST80-ct.307

Fixes regression in MVC, where "Debug-it" did spawn two competing UI (controller) processes. Improves also commentary in the area of debugger invocation.

Thanks to Christoph (ct) for the pointer!

=============== Diff against ST80-ct.307 ===============

Item was changed:
  ----- Method: MVCProject>>openDebuggerWindow: (in category 'scheduling & debugging') -----
  openDebuggerWindow: windowOrModel
- 
  	"Open the window in a way that allows for the current controller to remain active."
+ 
  	| window |
  	window := (windowOrModel isKindOf: View)
  		ifTrue: [windowOrModel]
  		ifFalse: [self uiManager toolBuilder build: windowOrModel].
+ 	
+ 	"We might have two UI processes after #openNoTerminate if we are currently in the UI process."
  	window controller openNoTerminate.
  
+ 	"Try redrawing the UI at least once to avoid freeze ."
- 	"Try redrawing the UI at least once to avoid freeze."
  	self restoreDisplay. "Not safely!!"!

Item was changed:
  ----- Method: MVCProject>>prepareProcessForDebugger: (in category 'scheduling & debugging') -----
  prepareProcessForDebugger: processToDebug
+ 	"Keep track of the controller if it matches. Also note the current cursor to restore it later when resuming the process."
- 	"Keep track of the controller if it matches. Also note the current cursor."
  
+ 	| controlManager |
+ 	controlManager := self world.
+ 	
+ 	controlManager activeControllerProcess == processToDebug ifTrue: [
+ 		"1) We are about to debug a UI process. Store the corresponding controller."
+ 		processToDebug st80InterruptedController: controlManager activeController.
+ 		"2) Flag if the UI process was interrupted from the outside."
+ 		processToDebug st80WasActive: controlManager inActiveControllerProcess].
- 	self world activeControllerProcess == processToDebug ifTrue: [		
- 		processToDebug st80InterruptedController: self world activeController].
  
  	processToDebug st80SavedCursor: Cursor currentCursor.
  	
  	super prepareProcessForDebugger: processToDebug.!

Item was changed:
  ----- Method: MVCProject>>resumeProcessSafely: (in category 'scheduling & debugging') -----
  resumeProcessSafely: aProcess
  	"We only want a single controller process running in MVC. Hopefully, #activeControler:andProcess: takes care of terminating the currently active one."
  
  	aProcess st80SavedCursor show.
  	aProcess st80SavedCursor: nil.
  
  	ScheduledControllers
  		activeController: aProcess st80InterruptedController
  		andProcess: aProcess.
  
+ 	aProcess st80InterruptedController: nil.
+ 	aProcess st80WasActive: nil.!
- 	aProcess st80InterruptedController: nil.!

Item was changed:
  ----- Method: MVCProject>>suspendProcessSafely: (in category 'scheduling & debugging') -----
  suspendProcessSafely: processToDebug
+ 	"Overwritten to activate the controller process for the debugger window if necessary.
- 	"Overwritten to activate the controller process for the debugger window.
  	See #openDebuggerWindow:."
+ 			
+ 	"1) If we are in a helper process, #openNoTerminate WILL NOT activate
+ 	the	debugger's controller. Example: user-interrupt request (cmd+dot)."
+ 	(processToDebug st80InterruptedController notNil "i.e., was a UI process"
+ 		and: [processToDebug st80WasActive not "i.e., was interrupted from helper"])
+ 			ifTrue: [ [self world searchForActiveController] fork ].
- 	
- 	| controlManager uiProcess wasActive |
- 	controlManager := self world.	
- 	uiProcess := controlManager activeControllerProcess.
- 	wasActive := controlManager inActiveControllerProcess.
- 	
- 	"If we are in a helper process, #openNoTerminate WILL NOT activate
- 	the	debugger's controller. Example: user-interrupt request (cmd+dot).
- 	See #openDebuggerWindow:."
- 	(uiProcess == processToDebug and: [wasActive not])
- 		ifTrue: [[controlManager searchForActiveController] fork].
  
+ 	"2) Be sure to suspend the process we want to debug now. We must do
- 	"Be sure to suspend the process we want to debug now. We must do
  	this as late as possible in case it is the active process."
  	processToDebug suspend.
  		
+ 	"3) Chances are, that we have two competing UI processes at this point, e.g.,
+ 	when doing Debug-it from a Workspace view. So, unless we are debugging
+ 	the currently active process, terminate that extra UI process. Note that if
+ 	we are debugging the active UI process, it will not be active anymore when
+ 	reaching this line, e.g., when proceed'ing from the debugger."
+ 	Processor activeProcess ~~ processToDebug
- 	"If we are NOT in a helper process, #openNoTerminate WILL NOT
- 	terminate the active controller's process. See #openDebuggerWindow:."
- 	(uiProcess ~~ processToDebug and: [wasActive])
  		ifTrue: [Processor terminateActive].!

Item was added:
+ ----- Method: Process>>st80WasActive (in category '*ST80-debugging support') -----
+ st80WasActive
+ 
+ 	^ self environmentAt: #st80WasActive ifAbsent: false!

Item was added:
+ ----- Method: Process>>st80WasActive: (in category '*ST80-debugging support') -----
+ st80WasActive: aBoolean
+ 
+ 	^ self environmentAt: #st80WasActive put: aBoolean!

Squeak-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]