Bug? Form is blank when updated when minimized

Martin Larsen

Active Member
Licensed User
Longtime User
Don't know if this is a bug, but I think so:

If a form is updated in the background while minimized and you then restore the form, it gets blank until the next update.

I have attached a minimal project to illustrate the problem.

Every 10 seconds a label is incremented on the mainform. If you minimize the form just before the next increment and restore it again, it goes completely blank until the next update a few seconds after.

If you minimize the form and restore it again before it gets updated, there is no problem.

I ran into the problem with my greenhouse thermometer project where the form in the B4J app is not updated if the UDP datagram arrives when the app is minimized.
 

Attachments

A UI in the background is not supposed (even NOT expected!) to update anything!

Remember the value and react on events. I gues there is a sizechanged event or similar when going to background or coming back to front. Set the remembered value when the form becomes visible again.
 
I works indeed, also in my greenhouse project which is a B4XPages project. Here I have put the three lines just after B4XPages.Delegate.MainForm_IconifiedChanged(Iconified):

B4X: Copy
Public Sub MainForm_IconifiedChanged (Iconified As Boolean)
    B4XPages.Delegate.MainForm_IconifiedChanged(Iconified)
    MainForm.WindowWidth = MainForm.WindowWidth + 0.1
    Sleep(100)
    MainForm.WindowWidth = MainForm.WindowWidth - 0.1
End Sub
 
Back
Top