Going fullscreen doesn't trigger resizeStack
Moderator: Klaus
Going fullscreen doesn't trigger resizeStack
Hi all,
I'm sure this is a bug - but seems weird as there is no mention of this anywhere, so just double checking.
Maximising the window by making it full screen on mac does not appear to trigger the on resizeStack handler
i.e. clicking on the green window decoration resizes the stack to make it full screen but doesn't trigger the on resizeStack, even though GM rules work appropriately. While the GM is working fine and resizes/moves controls, i also call a handler from on resizeStack to resize the text of a field depending on it's size.
Resizing the stack any other way works beautifully but going full screen does nothing... easy to check by adding a line to put a message in the message box inside the resizeStack handler - definitely doesn't fire going full screen...
Is this expected behaviour? is behaviour similar on Windows?
Many thanks
Stam
I'm sure this is a bug - but seems weird as there is no mention of this anywhere, so just double checking.
Maximising the window by making it full screen on mac does not appear to trigger the on resizeStack handler
i.e. clicking on the green window decoration resizes the stack to make it full screen but doesn't trigger the on resizeStack, even though GM rules work appropriately. While the GM is working fine and resizes/moves controls, i also call a handler from on resizeStack to resize the text of a field depending on it's size.
Resizing the stack any other way works beautifully but going full screen does nothing... easy to check by adding a line to put a message in the message box inside the resizeStack handler - definitely doesn't fire going full screen...
Is this expected behaviour? is behaviour similar on Windows?
Many thanks
Stam
-
- Livecode Opensource Backer
- Posts: 10094
- Joined: Fri Feb 19, 2010 10:17 am
Re: Going fullscreen doesn't trigger resizeStack
Well I just discovered something (and I really don't know what made me think of it):
- -
And I can imagine some pseudocode a bit like this:
.....
if the fullscreen of stack "XYZ" is true then
-- do something exciting
end if
.....
- -
I really need to get out more often.
- -
And I can imagine some pseudocode a bit like this:
.....
if the fullscreen of stack "XYZ" is true then
-- do something exciting
end if
.....
- -
I really need to get out more often.

- Attachments
-
- Expander.livecode.zip
- Here's the stack.
- (204.31 KiB) Downloaded 53 times
-
- Livecode Opensource Backer
- Posts: 10094
- Joined: Fri Feb 19, 2010 10:17 am
Re: Going fullscreen doesn't trigger resizeStack
Unfortunately this sort of thing:
does not work.
Code: Select all
on resizeStack
if the fullScreen of stack "XYZ" is true then
set the backGroundColor of stack "XYZ" to red
else
set the backGroundColor of stack "XYZ" to white
end if
end resizeStack
Re: Going fullscreen doesn't trigger resizeStack
Yep that’s my problem - I’d need to be able to trap the message; the only way to use a property would be to continuously poll the property which I really don’t want to do.
Given that the stack is being resized (and actually this is recognised by the Geometry Manager, which resizes and moves fields appropriately, but unfortunately won’t let me execute code like changing font size), I’d consider this incorrect functionality/bug — unless of course there is a different message sent by going to/leaving fullScreen….
Given that the stack is being resized (and actually this is recognised by the Geometry Manager, which resizes and moves fields appropriately, but unfortunately won’t let me execute code like changing font size), I’d consider this incorrect functionality/bug — unless of course there is a different message sent by going to/leaving fullScreen….
Re: Going fullscreen doesn't trigger resizeStack
Bug report posted here: https://quality.livecode.com/show_bug.cgi?id=23547
Re: Going fullscreen doesn't trigger resizeStack
Hi Stam,
I did a little test with a stack and 1 field. The field should resize when the stack is resized or going to fullscreen.
The card script is
This works also for fullscreen.
Trapping "resizeStack" this way has to pass "resizeStack" for the GeometryManager to kick in.
This is on MacOS 10.14.6 "Mojave"
Kind regards
Bernd
I did a little test with a stack and 1 field. The field should resize when the stack is resized or going to fullscreen.
The card script is
Code: Select all
on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
beep
set the textSize of field 1 to random(25) + 10
pass resizeStack
end resizeStack
Trapping "resizeStack" this way has to pass "resizeStack" for the GeometryManager to kick in.
This is on MacOS 10.14.6 "Mojave"
Kind regards
Bernd
- Attachments
-
- geometryAndResizeStack.livecode.zip
- (1.34 KiB) Downloaded 71 times
Re: Going fullscreen doesn't trigger resizeStack
Hi Bernd - you are quite correct.
I just started with a new stack and the resizeStack handler does indeed trigger on going fullscreen.
Not sure why it's not working in my app :-/
It works fine on resizing the stack but nothing happens on going fullscreen...
Back to more head scratching...
I just started with a new stack and the resizeStack handler does indeed trigger on going fullscreen.
Not sure why it's not working in my app :-/
It works fine on resizing the stack but nothing happens on going fullscreen...
Back to more head scratching...
Re: Going fullscreen doesn't trigger resizeStack
I found that even after setting the stack to FULLSCREEN this way (green button)
-> the fullscreen of this stack
still returns FALSE!?
-> the fullscreen of this stack
still returns FALSE!?
Re: Going fullscreen doesn't trigger resizeStack
I suspect that property may be for mobile only?
Re: Going fullscreen doesn't trigger resizeStack
No, for all platforms!
This returns TRUE:
This returns TRUE:
Code: Select all
...
set the fullscreen of this stack to TRUE
answer the fullscreen of this stack
...
-
- Livecode Opensource Backer
- Posts: 10094
- Joined: Fri Feb 19, 2010 10:17 am
Re: Going fullscreen doesn't trigger resizeStack
I assume that setting the fullScreen via the green window button
fails to set the fullScreen property in the stack, just sends a system message.
fails to set the fullScreen property in the stack, just sends a system message.
Last edited by richmond62 on Wed Feb 09, 2022 2:26 pm, edited 1 time in total.
-
- Livecode Opensource Backer
- Posts: 10094
- Joined: Fri Feb 19, 2010 10:17 am
Re: Going fullscreen doesn't trigger resizeStack
Hi Bernd - my problem remains. I've attached a stripped down version of my implementation.
The handler that resizes text (dynamicTextResize) is in the field script (normally a behaviour and more complex, but simplifying here...). This is also triggered by textChanged.
The min/max font sizes are set as custom props of the field
The GM is set to scale the field with the stack size.
The resizeStack handler calls the dynamicTextResize
When resizing he stack manually all is peachy. If i maximise the field by double-clicking on the titlebar, it fills the screen (but is not fullscreen) and everything scales nicely with a nice increase in textSize.
If I instead click the green decoration button (on mac) to go into fullScreen the field scales in size appropriately (so the GM call is fine) but the text does not scale in size. In this state however if i exit full screen, the text appears too large (as in, it appears scaled up for fullScreen) and if i resize it jumps down to normal size.
Very grateful if someone cleverer can figure out what's going on :-/
the field script is:
Code: Select all
on dynamicTextResize
lock screen
local tSize, tMin, tMax
put the uMinTextSize of me into tMin
put the uMaxTextSize of me into tMax
set the textSIze of me to tMin
if the formattedHeight of me + 12 > the height of me then exit dynamicTextResize
repeat until the formattedHeight of me >= the height of me -12
put the textSize of me + 1 into tSize
if tSize <= tMax then
set the textSize of me to tSize
else
exit dynamicTextResize
end if
end repeat
end dynamicTextResize
on rawKeyDown
dynamicTextResize
pass rawKeyDown
end rawKeyDown
Code: Select all
on resizeStack
send "dynamicTextResize" to field 1
pass resizeStack
end resizeStack
- Attachments
-
- dynamicTextResize.livecode.zip
- (2.92 KiB) Downloaded 56 times
Re: Going fullscreen doesn't trigger resizeStack
Hi Stam,
if you change the script of the stack to
does it do what you want?
Kind regards
Bernd
if you change the script of the stack to
Code: Select all
on resizeStack
if the mouse is not down then
send "dynamicTextResize" to field 1 in 10 milliseconds
else
send "dynamicTextResize" to field 1
end if
pass resizeStack
end resizeStack
Kind regards
Bernd