AW: Re: macOS window maximization weirdness

Curry Kenworthy curry at pair.com
Sun Feb 11 13:52:41 EST 2024


Paul:

 > So, I finally tracked this maximization weirdness down.

Good job cracking the case, for this particular maximization example!

 > The issue also only occurs if the resizeStack handler
 > for the window uses the passed parameters

BEST PRACTICE for LC:

1. Instead of param, use property such as width of stack when possible -
more robust/durable across LC/OS versions with use cases and other code.
Specific bugs get reported and fixed over time, but properties help.

2. Put actual resize code in a separate command -
reinforces habit #1, facilitates testing, can call from other handlers.

 > However, on macOS ONLY (not Windows) when a window is maximized,
 > after the resizeStack ... a desktopChanged message is also sent

Safe to assume that Windows will have similar issues now or later -
the trend is OS's making a big deal of windowing/arrangement tricks.

 > My problem was that I also have a on desktopChanged handler ...
 > set the effective width of window tWindow to tMonitorWidth ...
 > which sends a resizeStack message to the stack/window.
 > However, when it is sent this 2nd time ...
 > pNewWidth and pNewHeight are EMPTY

Definitely this part is a bug to report!
Those params should be reliable every time.

 > Does anyone have a valid reason why macOS should receive a
 > desktopChanged message on window maximization when Windows does not?

Good question! Also keep an eye out for future similar Windows issues.

Best wishes,

Curry Kenworthy

Radically Innovative Christian LiveCode Development
"PASSION for Elegant, Efficient Code!"
http://livecodeconsulting.com/



More information about the use-livecode mailing list