#REFACTORING by Stefan Reise
class: DeviceWorkstation class
added: #thisAppVirtualResolutionByMonitorDeviceName:
removed: #monitorVirtualResolutionByMonitorDeviceName:
comment/format in:
#convertVirtualResolutionPointToCurrentResolutionPoint:
#monitorRealResolutionByMonitorDeviceName:
#monitorRealResolutionByPoint:
#monitorScaleFactorFor:
--- a/DeviceWorkstation.st Mon Nov 25 14:08:23 2019 +0100
+++ b/DeviceWorkstation.st Mon Nov 25 14:28:48 2019 +0100
@@ -613,8 +613,8 @@
convertVirtualResolutionPointToCurrentResolutionPoint:aPoint
"this is required when you want to access the root display coordinates correctly,
- because may windows did scale the application (when the app is not high DPI aware),
- and if windows did scale the application, the application gets a virtual display
+ because may the os did scale the application (when the app is not high DPI aware),
+ and if the os do scale the application, the application gets a virtual display
with a diffrent resolution"
"redefined for windows"
@@ -622,6 +622,7 @@
^ aPoint
"Created: / 22-11-2019 / 10:09:36 / Stefan Reise"
+ "Modified (comment): / 25-11-2019 / 14:23:43 / Stefan Reise"
!
convertVirtualResolutionRectangleToCurrentResolutionRectangle:aRectangle
@@ -991,20 +992,20 @@
!DeviceWorkstation class methodsFor:'queries - monitor'!
monitorRealResolutionByMonitorDeviceName:aMonitorDeviceName
- "this is the current resolution of the display,
- without any effect of scaling
+ "this is the real resolution of the display,
+ without any effect of os scaling
for e.g.
- real current resolution -> 1080p
- scaling 150%
+ real resolution -> 1080p
+ os scaling 150%
virtual resolution -> 720p
- real current resolution -> 1080p
- scaling 100%
+ real resolution -> 1080p
+ os scaling 100%
virtual resolution -> 1080p"
"
- Screen monitorRealResolutionByMonitorDeviceName:nil.
+ Screen monitorRealResolutionByMonitorDeviceName:nil.
Screen monitorRealResolutionByMonitorDeviceName:'ereswt'.
Screen monitorRealResolutionByMonitorDeviceName:'\\.\DISPLAY1'.
Screen monitorRealResolutionByMonitorDeviceName:'\\.\DISPLAY2'.
@@ -1020,16 +1021,16 @@
!
monitorRealResolutionByPoint:aPoint
- "this is the current resolution of the display,
- without any effect of scaling
+ "this is the real resolution of the display,
+ without any effect of os scaling
for e.g.
real resolution -> 1080p
- scaling 150%
+ os scaling 150%
virtual resolution -> 720p
real resolution -> 1080p
- scaling 100%
+ os scaling 100%
virtual resolution -> 1080p"
"
@@ -1046,25 +1047,22 @@
^ Display extent
"Created: / 25-11-2019 / 12:19:03 / Stefan Reise"
- "Modified (comment): / 25-11-2019 / 13:53:51 / Stefan Reise"
+ "Modified (comment): / 25-11-2019 / 14:20:01 / Stefan Reise"
!
monitorScaleFactorFor:aMonitorHandle
- "ATTENTION: this method always returns the scale factor set by os,
- REGARDLESS if the application (stx, expecco) has a virtual resolution or not
- use #scaleFactorForRootViewTranslationOnMonitorNamed: which is dependent on the
- application's (stx, expecco) high dpi awareness (if the application has a virtual
- resolution or not).
-
- this is the scale factor the user did enter within the windows settings,
+ "this method always returns the os scale factor,
+ regardless if the app is high dpi aware or not.
+
+ this is the scale factor the user did enter in the os settings,
for e.g. the user can choose between 100, 125, 150 etc.
here we return 1, 1.25 1.5"
"
- Screen monitorScaleFactorFor:(Display monitorHandleForName:'\\.\DISPLAY1').
- Screen monitorScaleFactorFor:(Display monitorHandleForName:'\\.\DISPLAY2').
- self monitorScaleFactorFor:(Display monitorHandleForName:'\\.\DISPLAY1').
- self monitorScaleFactorFor:(Display monitorHandleForName:'\\.\DISPLAY2').
+ Screen monitorScaleFactorFor:(Display monitorHandleForName:'\\.\DISPLAY1').
+ Screen monitorScaleFactorFor:(Display monitorHandleForName:'\\.\DISPLAY2').
+ self monitorScaleFactorFor:(Display monitorHandleForName:'\\.\DISPLAY1').
+ self monitorScaleFactorFor:(Display monitorHandleForName:'\\.\DISPLAY2').
"
^ 1
@@ -1072,33 +1070,33 @@
"Created: / 25-11-2019 / 13:32:51 / Stefan Reise"
!
-monitorVirtualResolutionByMonitorDeviceName:aMonitorDeviceName
- "this is the virtual resolution of the display,
- may effected by os scaling
+thisAppVirtualResolutionByMonitorDeviceName:aMonitorDeviceName
+ "this is the virtual resolution of the display for this app,
+ may (when a os scaling is defined and this app is not high dpi aware) effected by os scaling
for e.g.
- real current resolution -> 1080p
- scaling 150%
+ real resolution -> 1080p
+ os scaling 150%
virtual resolution -> 720p
- real current resolution -> 1080p
- scaling 100%
+ real resolution -> 1080p
+ os scaling 100%
virtual resolution -> 1080p"
"
- Screen monitorVirtualResolutionByMonitorDeviceName:nil.
- Screen monitorVirtualResolutionByMonitorDeviceName:'ereswt'.
- Screen monitorVirtualResolutionByMonitorDeviceName:'\\.\DISPLAY1'.
- Screen monitorVirtualResolutionByMonitorDeviceName:'\\.\DISPLAY2'.
- self monitorVirtualResolutionByMonitorDeviceName:nil.
- self monitorVirtualResolutionByMonitorDeviceName:'ereswt'.
- self monitorVirtualResolutionByMonitorDeviceName:'\\.\DISPLAY1'.
- self monitorVirtualResolutionByMonitorDeviceName:'\\.\DISPLAY2'.
+ Screen thisAppVirtualResolutionByMonitorDeviceName:nil.
+ Screen thisAppVirtualResolutionByMonitorDeviceName:'ereswt'.
+ Screen thisAppVirtualResolutionByMonitorDeviceName:'\\.\DISPLAY1'.
+ Screen thisAppVirtualResolutionByMonitorDeviceName:'\\.\DISPLAY2'.
+ self thisAppVirtualResolutionByMonitorDeviceName:nil.
+ self thisAppVirtualResolutionByMonitorDeviceName:'ereswt'.
+ self thisAppVirtualResolutionByMonitorDeviceName:'\\.\DISPLAY1'.
+ self thisAppVirtualResolutionByMonitorDeviceName:'\\.\DISPLAY2'.
"
^ Display extent
- "Created: / 25-11-2019 / 14:03:10 / Stefan Reise"
+ "Created: / 25-11-2019 / 14:17:37 / Stefan Reise"
! !
!DeviceWorkstation class methodsFor:'standalone setup'!