Page 1 of 1

Chrome on Tablet Fullscreen

Posted: Sun Jul 09, 2023 10:38 am
by Stefan
In the following example I noticed a very strange behavior of Chrome based browsers on an Android 10 tablet:
If I click on the button, a full screen is generated.
Chrome incorrectly authorizes the height of the screen.
Only when I tap the touch screen again (NOT the button) does Chrome calculate the height correctly.
That doesn't happen with Oprea.
Do you have an idea how to deal with the bug?

Code: Select all



Enumeration
  #window
  #button
EndEnumeration


Declare WindowSizeChange()
Declare MouseClick()
Global fullscreenFlg

BindEvent(#PB_Event_SizeDesktop, @WindowSizeChange())
BindEvent(#PB_Event_Gadget, @MouseClick())

OpenWindow(#window,10,10,200,200,"Test")

ButtonGadget(#button,10,50,100,60,"Button")

Procedure MouseClick()
  
  If EventGadget()=#button
    If fullscreenFlg=0
      FullScreen(#True)
      fullscreenFlg=1
    Else
      fullscreenFlg=0
      FullScreen(#False)
    EndIf
  EndIf
  
EndProcedure


Procedure WindowSizeChange()
  
   
  Protected  width,height
  
  !v_width=document.body.clientWidth;
  !v_height=document.body.clientHeight;
  
  
  Debug "WindowWidth: "+Str(width)
  Debug "WindowHeigt: "+Str(height)
EndProcedure