Mispositioned STS tool prompters

23 views
Skip to first unread message

Marcus Wagner

unread,
Jul 4, 2025, 9:52:04 AMJul 4
to VAST Community Forum
Another tiny positonining glitch mispositions STS tool prompters under Windows, multiple screens with inhomogenous scaling (>Windows 8.1). 
The expected behaviour is that prompters are placed centered on the active sceen (of potentially many different ones), according to its individual scale.
This fails, in particular if larger scales like 200% are in use. The prompter appears anywhere else but not centered as expected.
Reason is that 
StsConfirmationDialog>>#desiredWindowRect:
and
StsTextPrompter>>#desiredWindowRect:
miscalculate the point of the desired window position, which is based on the argument, the (desired) extent of the prompter to be centered.
All positions / points / extents and rectangles refer to different (operating system dependent) coordinate systems which got mixed here, the API, the high DPI down and upscaled coordinates. 
The extent passed to both methods is already upscaled hoght DPI. It is passed first to the method desiredWindowPos: which expects (under WIndows) unscaled coordinates.
What happens: an already upscaled coordinate is upscaled a second time (e.g. enlargement 200% -> 400%) and used to calculate the offset of the corner of the prompter to become centered. Correct would be to downscale the extent into the center calculation which expects unscaled coordinates and returning scaled coordinates.
So the initial call
"point := self desiredWindowPos: extent."
should be replaced by
self stsIsUnix
ifTrue: [point := self desiredWindowPos: extent]
ifFalse: [
point :=
self desiredWindowPos:
(DPIScaler autoScaleDownPoint: extent for: (shell osWidget autoScaleContext))].
to yield a correct (scaled point) for the upper left corner.
Later in the methods, this calculation is correctly applied, but initially not.
So version prompters, text prompter in the STS tool set are misplaced if you are working under Windows 8.1 or later, with scales ~= 100% and more than one monitor.
Sometime it is very nasty to search for the prompter as it does not show where it is expected, in the center of the active monitor.
Hope that fix helps.
Kind regards
M

Reply all
Reply to author
Forward
0 new messages