It is currently Sun May 31, 2020 1:34 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Scaling Bug - DPI aware activates itself and break layouts
PostPosted: Thu May 21, 2020 9:23 am 
Offline
User
User
User avatar

Joined: Sun Apr 05, 2020 11:28 am
Posts: 41
Hello, everyone,
it may not be that easy to and it took me a long time to crystallize it exactly.
So I've decided to post it here again because it's a very bad mistake.
Unfortunately I can't tell if it is a bug of the OS or PB.
But it is already more than helpful to know that he exists and what he does,
because it is almost impossible to find and locate him.

In Windows there are the extended scaling,
that is, where you can enlarge the desktop.
These are not those that are fixed, but those that have to be typed in by hand.
If a user uses this possibility, because the default of 125% is too crisp for him, he will get 120%, for example, if there are problems.
These problems only occur when the magnification is entered manually and they seem to occur at magnifications >100% to 125%.
Whether it also occurs at further magnifications must be tested, especially 120% is very bad, because this is often used.
It was very difficult to see what happens and why, because you don't know the context and only see the effect.

If such a scaling is chosen, the process is always DPI aware, even if it is disabled in the PB Compiler options.
This leads to layout corruption of different outputs, which a user or developer can almost not localize.
The functions for determining the scaling always return 100%, although it is e.g. 125%.

viewtopic.php?f=27&t=75348

Please check this once

Best regards Saki

_________________
地球上の平和


Top
 Profile  
Reply with quote  
 Post subject: Re: Scaling Bug - DPI aware activates itself and break layou
PostPosted: Fri May 22, 2020 3:27 pm 
Offline
User
User
User avatar

Joined: Sun Apr 05, 2020 11:28 am
Posts: 41
Here a other test code

Code:
Define wID=OpenWindow(#PB_Any, 0, 0, 610, 400, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

Define font=LoadFont(#PB_Any , "Arial" , 26 , #PB_Font_Bold)

StartDrawing(WindowOutput(wID))
DrawText(0 , 10 , "Try scaling 125% with and without DPI aware Compiler option")
DrawText(0 , 30 , "First try the 125% that Windows offers directly in the scaling menu")
DrawText(0 , 50 , "Then switch to the extended scales and enter the 125% by hand again !")
DrawText(0 , 80 , "Compare the results and you will see the bug")

DrawingFont(FontID(font))
DrawText(0 , 120 , "You ever must see this line complete")
StopDrawing()

Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow

_________________
地球上の平和


Top
 Profile  
Reply with quote  
 Post subject: Re: Scaling Bug - DPI aware activates itself and break layou
PostPosted: Wed May 27, 2020 10:04 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 3688
Location: Utah, USA
Do you get the same problem with this small change?
Code:
Define wID=OpenWindow(#PB_Any, 0, 0, 610, 400, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

Define font=LoadFont(#PB_Any , "Arial" , DesktopUnscaledY(26) , #PB_Font_Bold)

StartDrawing(WindowOutput(wID))
DrawText(0 , 10 , "Try scaling 125% with and without DPI aware Compiler option")
DrawText(0 , 30 , "First try the 125% that Windows offers directly in the scaling menu")
DrawText(0 , 50 , "Then switch to the extended scales and enter the 125% by hand again !")
DrawText(0 , 80 , "Compare the results and you will see the bug")

DrawingFont(FontID(font))
DrawText(0 , 120 , "You ever must see this line complete")
StopDrawing()

Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Scaling Bug - DPI aware activates itself and break layou
PostPosted: Wed May 27, 2020 10:09 am 
Offline
User
User
User avatar

Joined: Sun Apr 05, 2020 11:28 am
Posts: 41
Hi Demivec,
many thanks for testing, yes, the same.

Best regards Saki

_________________
地球上の平和


Top
 Profile  
Reply with quote  
 Post subject: Re: Scaling Bug - DPI aware activates itself and break layou
PostPosted: Wed May 27, 2020 11:38 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 22, 2009 3:48 am
Posts: 631
Location: china
96 pixels / inch = 100% zoom.
120 pixels / inch =120/96= 125% zoom.

_________________
my pb for chinese:
http://ataorj.ys168.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Scaling Bug - DPI aware activates itself and break layou
PostPosted: Wed May 27, 2020 12:05 pm 
Offline
User
User
User avatar

Joined: Sun Apr 05, 2020 11:28 am
Posts: 41
Hi Gurj
This is not the Problem, try the test codes

这不是问题,请尝试测试代码

Best regards Saki

_________________
地球上の平和


Top
 Profile  
Reply with quote  
 Post subject: Re: Scaling Bug - DPI aware activates itself and break layou
PostPosted: Wed May 27, 2020 12:24 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Dec 21, 2015 8:12 pm
Posts: 166
That's a Windows behavior for unaware applications.
If you want correctly scaling enable DPI option.

Anyway, this is not a PB bug.


Top
 Profile  
Reply with quote  
 Post subject: Re: Scaling Bug - DPI aware activates itself and break layou
PostPosted: Wed May 27, 2020 1:06 pm 
Offline
User
User
User avatar

Joined: Sun Apr 05, 2020 11:28 am
Posts: 41
Hi fryquez
It's not right what you write.
Please read firstly the thread and try the demo codes.

It is not about whether it is a PB or a Windows bug.
It's about the fact that it's a buggy behavior that causes massive problems and is very hard to localize.

And you as a PB and Windows user are directly affected.
It destroys the layouts of the users of your programs !

The name of this sub-forum ist Bugs - Windows, not PB-Bugs - Windows,
so it is the right place for this posts :wink:

Best regards Saki

_________________
地球上の平和


Top
 Profile  
Reply with quote  
 Post subject: Re: Scaling Bug - DPI aware activates itself and break layou
PostPosted: Wed May 27, 2020 3:54 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jan 22, 2016 5:33 pm
Posts: 100
Location: Planet Earth
The problem with the different DPIs on Windows is ever a headache The true is we don't have on PB a simple method to get the same interface on different DPIs :cry:

I test my code every time on different monitors on different DPIs an almost ever I need to adjust manually something.


Top
 Profile  
Reply with quote  
 Post subject: Re: Scaling Bug - DPI aware activates itself and break layou
PostPosted: Fri May 29, 2020 8:05 pm 
Offline
User
User
User avatar

Joined: Sun Apr 05, 2020 11:28 am
Posts: 41
Hi Caronte3D

I hate that DPI aware stuff,
he makes simple things complicated.
Switching older complex graphics software to DPI aware is more than an adventure,
it's annoying and you're tempted to throw everything out the window.

It should be up to the OS to provide high quality output, not up to the programmer.

Best regards Saki

_________________
地球上の平和


Top
 Profile  
Reply with quote  
 Post subject: Re: Scaling Bug - DPI aware activates itself and break layou
PostPosted: Sat May 30, 2020 8:34 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1831
Location: Germany (Saxony, Deutscheinsiedel)
While I'm trying to adapt my project to be DPI-aware I have tested the example codes above and can confirm that there is something buggy with a 'manually set DPI scaling factor of 125%'.

While with 125% choosen in the related combobox in Windows settings (DPI-aware on + off) the text always is shown completely, with manually entered 125% and 'DPI-aware off' in the PB compiler settings the text doesn't fit into the window (see screenshot below).

Would be good, if Fred can take a look into the library code of the Desktop library, if there is something wrong or if we encountered a bug in the used WinAPI commands (workaround possible?)... Thank you :D

Image

_________________
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 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