B4J Question Strange behaviour in my B4X-Launcher v3

Cableguy

Expert
Licensed User
Longtime User
Hi Guys...

I know questions should and are meant to every user in the forum, but sometimes, we need the Master (read @Erel) opinion.

my B4X-Launcher v3 is having a strange behaviour... I set the first Imageview, the only one visible when the app starts, to be top=0 and i never change this position again in my code.
I change the alpha value when the mouse enters the image view, and change it again after a few seconds...
After a while, I notice that the top value of that imageview has changed for about its height... and after another while, it keeps increasing the top value, apparently in height values...

I just can't figure out where this change is happening!
 

Cableguy

Expert
Licensed User
Longtime User
this is as streamlined as I could get.
Note. I have decided to re-position the B4XLogo in the Tick event so that at least it comes back to the original position..

how to reproduce it:
launch the app in a laptop, check its position, close the lid, wait for the laptop to "sleep", then open the lid and wake it up...
 

Attachments

  • b4xl-test.zip
    7.2 KB · Views: 313
Last edited:
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I would say a jfx bug as my window top value is -15 (I guess this has to do with the undecorated attribute) and it seem to be reverting to windows top = 0

The re-set of the top value when the timer expires works as expected, but doesn't prevent that sometimes the top value is off.
I think I shoul be re-seting the top in another event, like window.hasFocus, but I dont' think it there's such a parameter
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
So, making further tests, I found that Form_FocusChanged exists in B4J, and i have managed to minimize, but not completely mitigate the reported behavior.

my focus changed sub:
B4X:
Private Sub MainForm_FocusChanged (HasFocus As Boolean)
    Log(MainForm.WindowTop)
    MainForm.WindowTop = -15
End Sub

the logs show this:
-15 'this is appstart
-15 'I closed the lid of the laptop
0 'I opened the lid of the laptop
-15 'value re-set, a small time lapse exist that I can't get rid of
 
Upvote 0
Top