It is currently Sun Jul 21, 2019 11:54 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: [Done] 5.70 Wrong coordinates in DesktopXYZ() DPI aware
PostPosted: Thu May 16, 2019 9:04 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 11, 2006 12:07 am
Posts: 488
Location: Germany / one of the fishheads
It seems as if the DesktopXYZ() commands output wrong coordinates when the compileroption DPI awareness is enabled.

Based on chis code this can be reproduced with the following sniplet.
Code:
; Run this code with PB 5.7x
; Compile it with activated DPI aware in compileroptions

ExamineDesktops()

; Supposing we only have one desktop
Repeat
   Debug DesktopWidth(0)
   Debug DesktopMouseX()
   Delay (250)
Until GetAsyncKeyState_(#VK_ESCAPE) & 1

Regardless of the compiler option "DPI aware" the real physical desktop size, mouse position etc. should be returned. At least that's what I would expect from the help texts for the commands. But this isn't the case.

My Desktopwidth is 1920 pixel, but the DPI aware compiled code shows a width of 1536 pixels (I use a desktopscaling of 125 %).

PB Help wrote:
"DesktopWidth(#Desktop) - Returns the width of the specified desktop. "

Greetings
Kurzer

_________________
PB 5.62, OS: Windows 7 Pro x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age: 51y
"Happiness is a pet." | "Never run a changing system!"


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.70 LTS: Wrong coordinates in DesktopXYZ() with DPI awa
PostPosted: Fri May 17, 2019 7:58 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3598
Location: Berlin, Germany
- deleted -

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Last edited by Little John on Fri May 17, 2019 9:56 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: 5.70 LTS: Wrong coordinates in DesktopXYZ() with DPI awa
PostPosted: Fri May 17, 2019 9:36 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Apr 18, 2019 8:17 am
Posts: 202
I didn't even know DesktopMouseX() was a thing. I was always using "mouse.POINT" and "mouse\x" in my code. When this bug gets fixed I'll switch to DesktopMouseX() in future.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.70 LTS: Wrong coordinates in DesktopXYZ() with DPI awa
PostPosted: Fri May 17, 2019 10:04 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3598
Location: Berlin, Germany
Sorry, my previous post was incomplete and misleading.

I can confirm the problem with DesktopWidth() and DesktopHeight(), using PB 5.71 beta 1 (x64) on Windows 10 version 1809 with DPI 125 %.

DesktopMouseX() and DesktopMouseY() yield the same values though, regardless whether the program is compiled with or without the "DPI aware" flag.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.70 LTS: Wrong coordinates in DesktopXYZ() with DPI awa
PostPosted: Fri May 17, 2019 12:32 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 11, 2006 12:07 am
Posts: 488
Location: Germany / one of the fishheads
Interesting. I use Windows 7 x64 (PB 5.70 LTS) and all 4 values are wrong in DPI aware mode:
Code:
   Debug DesktopWidth(0)
   Debug DesktopMouseX()
   Debug DesktopHeight(0)
   Debug DesktopMouseY()

_________________
PB 5.62, OS: Windows 7 Pro x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age: 51y
"Happiness is a pet." | "Never run a changing system!"


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.70 LTS: Wrong coordinates in DesktopXYZ() with DPI awa
PostPosted: Fri May 17, 2019 12:48 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3598
Location: Berlin, Germany
Little John wrote:
on Windows 10 version 1809

kurzer wrote:
Interesting. I use Windows 7

Interesting indeed.

The problem is, that different Windows versions handle DPI awareness in different ways.
After Windows 7, there were significant changes especially in Windows 8.1.
Windows 10 introduced more changes, and even different versions of Windows 10 behave differently in this regard.
For more details see e.g. https://kynosarges.org/WindowsDpi.html

Fred has to handle all that for PureBasic. :shock: I don't envy him for that.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.70 LTS: Wrong coordinates in DesktopXYZ() with DPI awa
PostPosted: Fri May 24, 2019 2:11 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13595
Location: France
Fixed.


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.70 LTS: Wrong coordinates in DesktopXYZ() with DPI awa
PostPosted: Fri May 31, 2019 9:37 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3598
Location: Berlin, Germany
Fred wrote:
Fixed.

Thank you, Fred!

Are you soon going to release a beta 2 version?
I really would appreciate that!

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: 5.70 LTS: Wrong coordinates in DesktopXYZ() with DPI awa
PostPosted: Thu Jun 27, 2019 9:33 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3598
Location: Berlin, Germany
Little John wrote:
I can confirm the problem with DesktopWidth() and DesktopHeight(), using PB 5.71 beta 1 (x64) on Windows 10 version 1809 with DPI 125 %.

Fred wrote:
Fixed.

Fix confirmed with PB 5.71 beta 2 (x64).

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye