Page 1 of 2

Unusual Refresh Problems with Mac standalone

Posted: Wed Jan 24, 2024 2:46 pm
by AlbertAA
Hello.
I have developed an educational simulation that I distribute creating standalones for Windows and Mac.

Since some time, the Mac standalones have a serious problem related to page displays (pages are not correctly/fully refreshed, sometimes only partially, and the correctly refreshed page appears only if I move the window or generate UI events like clicking). The stack works perfectly in LiveCode before I create the mac standalone, and the Windows standalone does not have the same problem. Is it a Mac-related issue?

I am either looking for a simple statement to add in different places of my code in order to "force" the refresh, or other ways of resolving this issue.

In the meantime I am realizing that I am using the 9.6.1 version of LiveCode. I can try downloading and using the most recent LC version, but will it change something?

Thank you for your advice.

Re: Unusual Refresh Problems with Mac standalone

Posted: Wed Jan 24, 2024 4:10 pm
by dunbarx
Hi.

Is this for mobile?

Craig

Re: Unusual Refresh Problems with Mac standalone

Posted: Wed Jan 24, 2024 4:14 pm
by Klaus
Craig,
dunbarx wrote:
Wed Jan 24, 2024 4:10 pm
Is this for mobile?
Unusual Refresh Problems with Mac standalone
I have developed an educational simulation that I distribute creating standalones for Windows and Mac.
I think this does not leave any doubt, right? 8)

Re: Unusual Refresh Problems with Mac standalone

Posted: Wed Jan 24, 2024 4:18 pm
by Klaus
Hi Albert,

sometimes

Code: Select all

...
lock screen
## do your thing...
unlock screen
...
or

Code: Select all

...
set the backcolor of this stack to the backcolor of this stack
...
helps, is at least worth a try.

What script is executing when this happens?


Best

Klaus

Re: Unusual Refresh Problems with Mac standalone

Posted: Wed Jan 24, 2024 6:44 pm
by AlbertAA
Thank you, Klaus
I tried playing with lock/unlock screen and the stack backcolor, but without success.

The problem occurs when I move to a different card. In the LiveCode environment (and the Windows standalone) it works well, but in the mac standalone it moves correctly to the different card but only redisplays a part of the screen (a relatively small rectangle). The card is there (I can even click on the buttons I do not see although they are there) but the re-display was not done fully.

The correct full display of the card appears only if I for instance slightly move the window in which the stack is, or minimize and then open it again.
Perhaps there is some code I could use to trigger a slight movement of the window (and back) - or a similar high-level event that would make the display appear correctly?

Re: Unusual Refresh Problems with Mac standalone

Posted: Wed Jan 24, 2024 6:49 pm
by dunbarx
Klaus.

I make standalones all the time, Windows and Mac. Never for mobile. 8)

Craig

Re: Unusual Refresh Problems with Mac standalone

Posted: Wed Jan 24, 2024 7:04 pm
by Klaus
Hi Albert,
AlbertAA wrote:
Wed Jan 24, 2024 6:44 pm
The correct full display of the card appears only if I for instance slightly move the window in which the stack is, or minimize and then open it again.
Perhaps there is some code I could use to trigger a slight movement of the window (and back) - or a similar high-level event that would make the display appear correctly?
you could try to move the stack a pixel or two:

Code: Select all

...
## Move stack 1 px down and right:
move this stack rel 1,1
## And back to original position:
move stack rel -1,-1
...
Best

Klaus

Re: Unusual Refresh Problems with Mac standalone

Posted: Wed Jan 24, 2024 7:25 pm
by AlbertAA
Crazy.
I have started inserting your 2 code lines (I call them "Schütteln vor dem Gebrauch") at the end of my openCard scripts and it looks like it solves/fixes the problem.
Still unclear to me what causes such a big difference between Win and Mac standalone behavior, but given that it makes my display problems disappear: THANK YOU A LOT - also for taking the time to react so rapidly!
-albert

Re: Unusual Refresh Problems with Mac standalone

Posted: Wed Jan 24, 2024 7:36 pm
by Klaus
Hi Albert,
AlbertAA wrote:
Wed Jan 24, 2024 7:25 pm
Crazy.
I have started inserting your 2 code lines (I call them "Schütteln vor dem Gebrauch") at the end of my openCard scripts and it looks like it solves/fixes the problem.
Still unclear to me what causes such a big difference between Win and Mac standalone behavior, but given that it makes my display problems disappear: THANK YOU A LOT - also for taking the time to react so rapidly!
-albert
my pleasure, glad it fixed your problem.
"Schütteln vor dem Gebrauch": großes Kino! :-D

Gruß

Klaus

Re: Unusual Refresh Problems with Mac standalone

Posted: Thu Jan 25, 2024 2:49 am
by jmk_phd
Klaus & Albert --

Got a chuckle out of Albert's clever nickname for your suggested addition to his code, which I believe translates as "Shake before using."

But apart from the fact that it apparently works for him, Albert does still raise the legitimate question as to why this fix was even necessary and specific to Mac. It's not a problem that I've ever encountered with any of my Mac standalones that employ multiple cards.

Perhaps Albert can let us know on what version of macOS the standalone was misbehaving -- in case, for example, it is another new problem associated with Sonoma. Any other ideas?

jeff k

Re: Unusual Refresh Problems with Mac standalone

Posted: Thu Jan 25, 2024 10:54 pm
by AlbertAA
Thank you for sharing your view, Jeff.

The only additional potentially valuable observations I can share are:
1. I had the problem before Sonoma, and upgrading did not change it.
2. The Mac standalone looks slower when it processes long texts within fields. The same for screen redraw operations.
3. It is important to use lock and unlock wisely.
4. I should take the time to clean the code and find out what caused the strange behaviour of the Mac standalone. Even at a time of big data and enormous computing power, coding quality is what makes the difference – I just realized it trying to run a couple of my stacks after upgrading from 9.6.1 to 9.6.11. Sloppy coding makes me faster, but I am likely to pay it later – poetic justice ☹ … or need to revert to creative “fixes” like this one.

My stacks happily “shake” now regularly. I start liking it, and might adopt it as a distinguishing, value-adding feature or the code I produce 😊
-albert

Re: Unusual Refresh Problems with Mac standalone

Posted: Thu Feb 22, 2024 4:19 pm
by Klaus
AlbertAA wrote:
Thu Jan 25, 2024 10:54 pm
My stacks happily “shake” now regularly. I start liking it, and might adopt it as a distinguishing, value-adding feature or the code I produce 😊-albert
In that case I'll have to bill you five deutsche Deutschmark copyleft fee! :-D :-D :-D

Re: Unusual Refresh Problems with Mac standalone

Posted: Sun May 05, 2024 11:35 am
by neville
The part of the screen which does not draw ... is this just the bottom 25 pixels (menubar height) at the bottom of the window?

If so that is a bug which has been around for a long time and is very annoying. It is on the QC list. As noted the fix is to apply any sort of lock unlock screen combination for example with a visual effect or setting the background to itself, to make LC redraw the whole screen.

Re: Unusual Refresh Problems with Mac standalone

Posted: Sun May 05, 2024 7:40 pm
by richmond62
It's not a problem that I've ever encountered with any of my Mac standalones that employ multiple cards.
My Devawriter, which has 51 cards at the moment, has never, over 14 years of development and deployment, had this problem.

Oh, and Klaus: sorry, I don't pay for anything with Deutsch Marks, only with Shillings:
-
Half-a-crown.jpg
Half-a-crown.jpg (32.38 KiB) Viewed 448 times
-
And anyone who uses the word 'Dinosaur' . . . 8)

Good Lord, and to think that when my Grandfather gave me one of these in 1969 (when I was 7) I felt like a millionaire!

Re: Unusual Refresh Problems with Mac standalone

Posted: Mon May 06, 2024 5:50 pm
by Randy Hengst
It’s been a while… and, I think my redraw issue was with iOS… but, I added a “go to this card” in several of the handlers to force a redraw.

take care,
Randy