Unusual Refresh Problems with Mac standalone

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
AlbertAA
Posts: 41
Joined: Thu May 28, 2020 1:42 pm

Unusual Refresh Problems with Mac standalone

Post by AlbertAA » Wed Jan 24, 2024 2:46 pm

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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Unusual Refresh Problems with Mac standalone

Post by dunbarx » Wed Jan 24, 2024 4:10 pm

Hi.

Is this for mobile?

Craig

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Unusual Refresh Problems with Mac standalone

Post by Klaus » Wed Jan 24, 2024 4:14 pm

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)

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Unusual Refresh Problems with Mac standalone

Post by Klaus » Wed Jan 24, 2024 4:18 pm

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

AlbertAA
Posts: 41
Joined: Thu May 28, 2020 1:42 pm

Re: Unusual Refresh Problems with Mac standalone

Post by AlbertAA » Wed Jan 24, 2024 6:44 pm

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?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Unusual Refresh Problems with Mac standalone

Post by dunbarx » Wed Jan 24, 2024 6:49 pm

Klaus.

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

Craig

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Unusual Refresh Problems with Mac standalone

Post by Klaus » Wed Jan 24, 2024 7:04 pm

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

AlbertAA
Posts: 41
Joined: Thu May 28, 2020 1:42 pm

Re: Unusual Refresh Problems with Mac standalone

Post by AlbertAA » 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

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Unusual Refresh Problems with Mac standalone

Post by Klaus » Wed Jan 24, 2024 7:36 pm

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

jmk_phd
Posts: 213
Joined: Sat Apr 15, 2017 8:29 pm

Re: Unusual Refresh Problems with Mac standalone

Post by jmk_phd » Thu Jan 25, 2024 2:49 am

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

AlbertAA
Posts: 41
Joined: Thu May 28, 2020 1:42 pm

Re: Unusual Refresh Problems with Mac standalone

Post by AlbertAA » Thu Jan 25, 2024 10:54 pm

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

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Unusual Refresh Problems with Mac standalone

Post by Klaus » Thu Feb 22, 2024 4:19 pm

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”