Page 1 of 1

Potential livecode issues/bugs with screens?

Posted: Tue Oct 18, 2016 11:20 pm
by Ed_Ray
I am building windows 7 desktop apps and ran into livecode error "Property cannot be set on this platform" even thought the 8.1 dictionary clearly states that these could be set for desktop apps and for windows OS.

on preOpenStack
set the usePixelScaling to false
end preOpenStack

Same error for attempting to set: "set the pixelScale to the systemPixelScale"

This is occurring on a two monitor windows 7 desktop system where both monitors have the same screen resolution of "1280X960".

I also got some strange results from using the screenRec function which yielded: 0,0,918,688 instead of the expected: 0,0,1280,960.

Also these values are also suspect.
Screenpixelscale and systempixelscale both yielded the same number namely: 1.395833 and pixelscale
yielded number 1.

Is the Screenpixelscale and systempixelscale related to the ratio of the screen resolution width/height?
asking since my resolution numbers would yield 1.333 rather than 1.3958 etc.

Can any one give me some guidance on why these values and error messages are what they are?

Thanks in advance to all.

Re: Potential livecode issues/bugs with screens?

Posted: Wed Oct 19, 2016 7:43 pm
by mwieder
The dictionary states that the pixelScale property is only usable on iOS and android.

Also, see the note in the dictionary about the usePixelScaling property:
Due to limitations of the platform, applications on Windows will not be able to enable or disable pixel scaling.

Re: Potential livecode issues/bugs with screens?

Posted: Wed Oct 19, 2016 8:23 pm
by jacque
Try the scaleFactor instead.

Re: Potential livecode issues/bugs with screens?

Posted: Wed Oct 19, 2016 10:51 pm
by Ed_Ray
Yes, you are right with respect to the OS for the pixelscale although the error message states it has the issue
with the platform rather than the OS.

All the other issues STILL remain especially the wrong screen resolution specified by screenrec since I re-checked the dictionary to ensure it supports the platform and the OS of "desktop" and "windows".

Hopefully somebody can respond to all the other potential livecode issues specified in the original (first post).

Thanks

Re: Potential livecode issues/bugs with screens?

Posted: Thu Oct 20, 2016 7:10 pm
by mwieder
Yeah, sorry. I don't have a clue as to what's going on there.
Does "the working screenrects" give you the same results?

Re: Potential livecode issues/bugs with screens?

Posted: Sat Oct 22, 2016 11:26 am
by Ed_Ray
I resolved the main problem which was the wrong screen resolution given by livecode and hopefully my explanation here will help other folks when they run into these screen issues because most will eventually run into these same problems.
The screenrect() was giving the "wrong screen resolution" of 0,0,1024,768 (1024X768) instead of 1280X960 because the pixel per inch (PPI) specified as DPI setting within the windows OS screen resolution dialog had been increased from 100% to 125%.

You get to this screen in windows 7 SP1 by clicking right on the desktop, then selecting the "make text and other items appear larger or smaller" option. You can also select a more custom PPI setting by selecting the "set custom text size" option.

To get livecode to yield the right screen resolution use the "screenpixelscale" property (put screenpixelscale) to display it.
It stated the 1.25 that corresponds to the 125% PPI previously stated. If you multiply the "bad" resolution components by the 1.25 you get the right screen resolution of 1280X960 (1024X1.25=1280, 768X1.25=960).

Please disregard the original post which stated the screenpixelscale as a 1.395833 value since by the time I finished playing with the screen resolution issue I probably had changed the PPI setting various time and the 1.39 value was related to an older previous change. The last valid change made left the value at the specified 1.25 value.

With this explanation you should "always" be able to get the correct screen resolution.

The "set the usePixelScaling to false" issue remains UNRESOLVED.
Error message stating "Property cannot be set on this platform" even thought the 8.1 dictionary clearly states that this can be set for the desktop platform and windows OS for the script below. Its even a direct example in the dictionary!
on preOpenStack
set the usePixelScaling to false
end preOpenStack

Re: Potential livecode issues/bugs with screens?

Posted: Sat Oct 22, 2016 4:34 pm
by mwieder
Whew! Thanks for the explanation. That makes the interactions pretty clear.

The dictionary description for the usePixelScaling property is correct, even though it's not quite intuitive.

You can *get* the usePixelScaling value on the Windows platform, you just can't modify it.
The example script for preOpenStack will work for other platforms, it's just that the Windows platform doesn't support doing that. And that's the meaning behind that paragraph warning that you "will not be able to enable or disable pixel scaling".

Re: Potential livecode issues/bugs with screens?

Posted: Mon Oct 24, 2016 10:45 pm
by Ed_Ray
Thanks for the explanation on the "usePixelScaling" property although even reading the dict after your explanation I would say it is still definitely not abundantly clear at all.

I showed the description in the dict to over ten co-workers NONE understood the way you explained it. THEY said the same as me that it sounded like you could actually set it.

Somewhere along the line someone needs to re-write that part of the dict.

Thanks again.

Re: Potential livecode issues/bugs with screens?

Posted: Tue Oct 25, 2016 2:41 am
by mwieder
You *can* set it, just not on the Windows platform.

And yes, I agree that the dictionary text could use a good rewrite.