Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Detecting viewport size on moode host
#1
Hi folks!

Does anyone have a trick for determining the viewport size on the kiosk/native display? I need to find out what my touchscreen is actually reporting as the viewport, but I can't navigate to whatismyviewport.com without a navigation bar.

Alternatively, perhaps I can start the browser on whatsmyviewport.com. Where is the kiosk mode started from?

I'm looking for the information needed to select the correct @media config call.

TIA
Michael
Michael

RPi4 —> HiFiBerry DAC+ —> Rotel RA01 —> Celestion DL8
Reply
#2
Try this

Code:
# Show viewport size in popup message
moodeutl -q "update cfg_system set value='viewport' where param='pkgid_suffix'"

# Revert
moodeutl -q "update cfg_system set value='' where param='pkgid_suffix'"
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(01-09-2021, 12:41 AM)MJR42 Wrote: Hi folks!

Does anyone have a trick for determining the viewport size on the kiosk/native display? I need to find out what my touchscreen is actually reporting as the viewport, but I can't navigate to whatismyviewport.com without a navigation bar.

Alternatively, perhaps I can start the browser on whatsmyviewport.com. Where is the kiosk mode started from?

I'm looking for the information needed to select the correct @media config call.

TIA
Michael

You'll probably want to know the answer anyway.

Have a look at /home/pi/.xinitrc, the last line of which is


Code:
chromium-browser --app=http://localhost/ --window-size=$SCREENSIZE --window-position=0,0 --no-first-run -enable-features=OverlayScrollbar --disable-infobars --
disable-session-crashed-bubble

Regards,
Kent
Reply
#4
Thumbs Up 
(01-09-2021, 01:00 AM)Tim Curtis Wrote: Try this

Code:
# Show viewport size in popup message
moodeutl -q "update cfg_system set value='viewport' where param='pkgid_suffix'"

# Revert
moodeutl -q "update cfg_system set value='' where param='pkgid_suffix'"

Thanks Tim, that did the trick nicely.

Turns out the system sets the viewport 1px smaller than the system screensize.
System screensize 800x480
Viewport 799x479

And I now have success in creating my own layout. I'm going to do a little fine tuning and cleanup, and then I'll post a few screenshots to see whether there's interest in me sharing it.
Michael

RPi4 —> HiFiBerry DAC+ —> Rotel RA01 —> Celestion DL8
Reply
#5
Glad to see you've had success in getting your edits done Michael and you're willing to share them. Smile 


Paul
Reply


Forum Jump: