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

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

Unusual Refresh Problems with Mac standalone

Post 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.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Unusual Refresh Problems with Mac standalone

Post by dunbarx »

Hi.

Is this for mobile?

Craig
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Unusual Refresh Problems with Mac standalone

Post by Klaus »

Craig,
dunbarx wrote: Wed Jan 24, 2024 4:10 pmIs 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: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Unusual Refresh Problems with Mac standalone

Post 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
AlbertAA
Posts: 41
Joined: Thu May 28, 2020 1:42 pm

Re: Unusual Refresh Problems with Mac standalone

Post 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?
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Unusual Refresh Problems with Mac standalone

Post by dunbarx »

Klaus.

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

Craig
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Unusual Refresh Problems with Mac standalone

Post 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
AlbertAA
Posts: 41
Joined: Thu May 28, 2020 1:42 pm

Re: Unusual Refresh Problems with Mac standalone

Post 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
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Unusual Refresh Problems with Mac standalone

Post 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
jmk_phd
Posts: 217
Joined: Sat Apr 15, 2017 8:29 pm

Re: Unusual Refresh Problems with Mac standalone

Post 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
AlbertAA
Posts: 41
Joined: Thu May 28, 2020 1:42 pm

Re: Unusual Refresh Problems with Mac standalone

Post 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
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Unusual Refresh Problems with Mac standalone

Post by Klaus »

AlbertAA wrote: Thu Jan 25, 2024 10:54 pmMy 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
neville
Posts: 49
Joined: Tue Apr 15, 2008 8:37 am

Re: Unusual Refresh Problems with Mac standalone

Post 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.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Unusual Refresh Problems with Mac standalone

Post 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 10807 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!
Randy Hengst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 157
Joined: Thu Jun 29, 2006 4:16 pm

Re: Unusual Refresh Problems with Mac standalone

Post 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
Post Reply