Inconsistant Openwindow()

Just starting out? Need help? Post your questions and find answers here.
ppnl
User
User
Posts: 33
Joined: Thu Oct 13, 2011 8:08 am

Re: Inconsistant Openwindow()

Post by ppnl »

argggggggggggg what happened. My last post didn't make it for some reason. Maybe I just forgot to press post...

Anyway, I changed my monitor with a 24 inch one with a 2560x1440 resolution and the problem vanished. Its the monitor?!?

I switched back to the big screen at 3840x2160 and it reappeared. I switched the desktop to 2560x1440 and the problem was still there on the big screen. As I said before windows recommends a 1920x1080 desktop on my desktop but 3840x2160 has never been a problem. So I changed the desktop to 1920x1080 and the problem is not visible. But because this is the resolution of the bad window anyway the problem would not be visible.

What I think is happening is that PB is under some conditions creating windows at the recommended desktop resolution rather than the actual desktop resolution. We need to know if Paul is running his monitor above the resolution recommended by windows. Or if a different monitor fixes it.
User avatar
darius676
Enthusiast
Enthusiast
Posts: 302
Joined: Thu Jan 31, 2019 12:59 am
Contact:

Re: Inconsistant Openwindow()

Post by darius676 »

Windows recommends 1920x1080,... what is the hardware resolution of the monitor, which produces the problem?
ppnl
User
User
Posts: 33
Joined: Thu Oct 13, 2011 8:08 am

Re: Inconsistant Openwindow()

Post by ppnl »

darius676 wrote: Sat Mar 19, 2022 7:12 am Windows recommends 1920x1080,... what is the hardware resolution of the monitor, which produces the problem?
That's the thing, its a 65 inch HD tv. It allows me to set the resolution as high as 4096X2960. Under active display settings it tells me I have an active signal resolution of 4096x2960. I have never had any problem with it. I have done graphics with python and c++ with SFML with no issue. All the programs and apps that I use open and run with the correct resolution. Only things compiled with PB screw up.

The only thing I can think is that PB is opening the window in the recommended resolution rather than the actual resolution for some reason. Maybe it is a safety feature to prevent people from over driving their display.

Is there a way to change the desktop resolution in PB?
User avatar
darius676
Enthusiast
Enthusiast
Posts: 302
Joined: Thu Jan 31, 2019 12:59 am
Contact:

Re: Inconsistant Openwindow()

Post by darius676 »

The desktop resolution is given from the system (windows).
Your exe get them from the system. If you want to force it you can try a full screen app. Your monitor/tv may scale it to the physic resolution. Maybe there are settings you can change on the monitor how to handle resolutions not recommended.
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1285
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: Inconsistant Openwindow()

Post by Paul »

ppnl wrote: Sat Mar 19, 2022 1:53 am We need to know if Paul is running his monitor above the resolution recommended by windows. Or if a different monitor fixes it.
I am running a 4K monitor using what Windows10 is recommending... 3840x2160 at 150% Scale
Image Image
ppnl
User
User
Posts: 33
Joined: Thu Oct 13, 2011 8:08 am

Re: Inconsistant Openwindow()

Post by ppnl »

Paul wrote: Sat Mar 19, 2022 4:10 pm
ppnl wrote: Sat Mar 19, 2022 1:53 am We need to know if Paul is running his monitor above the resolution recommended by windows. Or if a different monitor fixes it.
I am running a 4K monitor using what Windows10 is recommending... 3840x2160 at 150% Scale

Ah!! It's the scaling. My scale was at 225%. I changed it to 100% and it fixed the problem. Kinda. All the icons and other windows on my desktop were smaller but the size of the PB windows did not change size. But at least they were all the same size.

I also switched back to my other monitor. It was working correctly there and was on 100% scaling. I changed the scale to 125% and got incorrect window on the fourth tab again. So it is not a problem specific to the monitor.

So is PB handling scale incorrectly and inconsistently? Try changing your scale to 100%. Others might try changing their scale to above 100%.

I am using PB 5.72. I see there is a 5.73 available and expected "check for updates" to upgrade me but i did not. If I upgrade manually I will probably go with 6.0.
User avatar
darius676
Enthusiast
Enthusiast
Posts: 302
Joined: Thu Jan 31, 2019 12:59 am
Contact:

Re: Inconsistant Openwindow()

Post by darius676 »

If you use DPI settings in compiler and DesktopResolutionX(Y) in your code you can use any scaling without changing the Apps size on screen.
ppnl
User
User
Posts: 33
Joined: Thu Oct 13, 2011 8:08 am

Re: Inconsistant Openwindow()

Post by ppnl »

darius676 wrote: Sat Mar 19, 2022 9:49 pm If you use DPI settings in compiler and DesktopResolutionX(Y) in your code you can use any scaling without changing the Apps size on screen.
Yes, that is probably best coding practice anyway. But the book I was using does not mention it. It is hard to find even in the purebasic documentation. And I am mostly just a recreational programmer so I usually don't worry about things like best practices. I just wanted a window.

PureBasic needs to be at least consistent in the way it scales. Code that runs differently depending on what order it runs in makes me want to rip my face off and wear it as a hat.

I think I have all I need to work past this problem now. I'm going to install PB 6.0, learn to use DPI and start over understanding windows and screens. Assuming DPI works as advertised I'm good.

A big thanks to all who helped guide me to some understanding of the problem and how to work past it.
BarryG
Addict
Addict
Posts: 4196
Joined: Thu Apr 18, 2019 8:17 am

Re: Inconsistant Openwindow()

Post by BarryG »

ppnl wrote: Sun Mar 20, 2022 12:12 amI'm going to install PB 6.0, learn to use DPI and start over understanding windows and screens.
That's all well and good, but that's not the cause of the problem here. The problem is an IDE tab issue, not a coding issue, because the source code in IDE tab 4 compiles and runs differently to the exact same code in tabs 1 to 3. Learning DPI and windows and screens is likely a wild goose chase for you.

Fred has not replied to this topic at all, so he needs to be made aware of it. This is also not a Coding Question, but a Bug report.
ppnl
User
User
Posts: 33
Joined: Thu Oct 13, 2011 8:08 am

Re: Inconsistant Openwindow()

Post by ppnl »

BarryG wrote: Sun Mar 20, 2022 2:59 am
ppnl wrote: Sun Mar 20, 2022 12:12 amI'm going to install PB 6.0, learn to use DPI and start over understanding windows and screens.
That's all well and good, but that's not the cause of the problem here. The problem is an IDE tab issue, not a coding issue, because the source code in IDE tab 4 compiles and runs differently to the exact same code in tabs 1 to 3. Learning DPI and windows and screens is likely a wild goose chase for you.

Fred has not replied to this topic at all, so he needs to be made aware of it. This is also not a Coding Question, but a Bug report.
I agree, PB shouldn't be doing this crap. I have wasted two weeks pulling my hair out trying to understand what was happening thinking it was my fault. I hope they fix it.

But my concern is simply to understand it well enough to work around it and debug with confidence. Seeing code execute differently depending what order it was run really destroyed that confidence. I think and hope I understand the bug well enough to have some confidence in purebasic again.

But yeah. The problem needs to be acknowledged and fixed.
Post Reply