DeviceWorkstation.st
changeset 8892 1dcde2625bf9
parent 8889 b7105ad5bb18
child 8893 16d66d9e7e15
--- a/DeviceWorkstation.st	Mon Nov 25 12:27:52 2019 +0100
+++ b/DeviceWorkstation.st	Mon Nov 25 14:08:23 2019 +0100
@@ -990,6 +990,35 @@
 
 !DeviceWorkstation class methodsFor:'queries - monitor'!
 
+monitorRealResolutionByMonitorDeviceName:aMonitorDeviceName
+    "this is the current resolution of the display,
+     without any effect of scaling
+
+     for e.g.
+        real current resolution -> 1080p
+        scaling 150%
+        virtual resolution -> 720p
+
+        real current resolution -> 1080p
+        scaling 100%
+        virtual resolution -> 1080p"         
+
+    "
+        Screen monitorRealResolutionByMonitorDeviceName:nil.       
+        Screen monitorRealResolutionByMonitorDeviceName:'ereswt'.       
+        Screen monitorRealResolutionByMonitorDeviceName:'\\.\DISPLAY1'.       
+        Screen monitorRealResolutionByMonitorDeviceName:'\\.\DISPLAY2'.    
+        self monitorRealResolutionByMonitorDeviceName:nil.       
+        self monitorRealResolutionByMonitorDeviceName:'ereswt'.           
+        self monitorRealResolutionByMonitorDeviceName:'\\.\DISPLAY1'.       
+        self monitorRealResolutionByMonitorDeviceName:'\\.\DISPLAY2'.        
+    "    
+
+    ^ Display extent
+
+    "Created: / 25-11-2019 / 14:01:04 / Stefan Reise"
+!
+
 monitorRealResolutionByPoint:aPoint
     "this is the current resolution of the display,
      without any effect of scaling
@@ -1007,33 +1036,69 @@
         Screen monitorRealResolutionByPoint:nil.     
         Screen monitorRealResolutionByPoint:0@0.     
         Screen monitorRealResolutionByPoint:500@0.       
-        Screen monitorRealResolutionByPoint:2000@0.      
+        Screen monitorRealResolutionByPoint:2000@0. 
+        self monitorRealResolutionByPoint:nil.     
+        self monitorRealResolutionByPoint:0@0.     
+        self monitorRealResolutionByPoint:500@0.       
+        self monitorRealResolutionByPoint:2000@0.   
     "    
 
     ^ Display extent
 
     "Created: / 25-11-2019 / 12:19:03 / Stefan Reise"
-!
-
-scaleFactorForRootViewTranslationOnMonitorNamed:aMonitorDeviceName                 
-    "redefined for windows
-     this is the scale factor, we have to use,
-     when we work directly with the root view (desktop)
-
-     because we may have a virtual display,
-     but the screen (from which we take a screenshot for e.g.)
-     does always have the current resoltion,
-     therefor we have to translate from virtual to current resolution"
-
-    "
-        Screen scaleFactorForRootViewTranslationOnMonitorNamed:'\\.\DISPLAY1'.          
-        Screen scaleFactorForRootViewTranslationOnMonitorNamed:'\\.\DISPLAY2'.            
-    "
-
-    ^ 1@1
-
-    "Created: / 21-11-2019 / 12:34:31 / Stefan Reise"
-    "Modified (comment): / 25-11-2019 / 12:22:46 / Stefan Reise"
+    "Modified (comment): / 25-11-2019 / 13:53:51 / 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,
+     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').       
+    "
+
+    ^ 1
+
+    "Created: / 25-11-2019 / 13:32:51 / Stefan Reise"
+!
+
+monitorVirtualResolutionByMonitorDeviceName:aMonitorDeviceName
+    "this is the virtual resolution of the display,
+     may effected by os scaling
+
+     for e.g.
+        real current resolution -> 1080p
+        scaling 150%
+        virtual resolution -> 720p
+
+        real current resolution -> 1080p
+        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'. 
+    "    
+
+    ^ Display extent
+
+    "Created: / 25-11-2019 / 14:03:10 / Stefan Reise"
 ! !
 
 !DeviceWorkstation class methodsFor:'standalone setup'!
@@ -2309,20 +2374,16 @@
     isSlow := aBoolean
 !
 
-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,
-     for e.g. the user can choose between 100, 125, 150 etc.
-     here we return 1, 1.25 1.5"
-
-    ^ 1@1
-
-    "Created: / 25-11-2019 / 11:56:20 / Stefan Reise"
+monitorHandleForView:aView
+    ^ nil
+
+    "Created: / 25-11-2019 / 13:44:51 / Stefan Reise"
+!
+
+monitorInfoFor:aMonitorId
+    ^ nil
+
+    "Created: / 25-11-2019 / 14:02:19 / Stefan Reise"
 !
 
 monitorType