Thank you for your donation!


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


Problem: Local GUI on 4K screens
#3
(06-05-2024, 12:06 PM)Tim Curtis Wrote: Try adding the bolded line below to the file /home/pi/.xinitrc
- Replace 0.80 with the percent zoom you are using
- You may have to put quotes around the value "0.80"

#!/bin/bash
#
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014 The moOde audio player project / Tim Curtis
#

# Turn off display power management
xset -dpms

# Screensaver timeout in secs or 'off' for no timeout
xset s 600

# Capture screen size
SCREENSIZE="$(fbset -s | awk '$1 == "geometry" { print $2","$3 }')"

# Clear browser cache
$(/var/www/util/sysutil.sh clearbrcache)

# Launch chromium browser
chromium-browser --app="http://localhost/" \
--window-size="$SCREENSIZE" \
--window-position="0,0" \
--enable-features="OverlayScrollbar" \
--no-first-run \
--disable-infobars \
--disable-session-crashed-bubble \
--force-device-scale-factor=0.80 \
--kiosk

The zoom change triggered from the Chromium Browser menu works differently from the proposed change to the force-device-scale-factor parameter. Setting this parameter to, for example, 1.25, scaled the entire displayed area to be larger than the physical size of the screen. On the other hand, the Zoom command seemed to perform two operations. The solution turned out to be changing two parameters simultaneously: setting force-device-scale-factor to 2.00 and changing the window-size parameter to "1920,1080". I realize this is not an elegant or proper solution, but at least it works. Below is the content of the ~/.xinitrc file with the changes highlighted in bold.

#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014 The moOde audio player project / Tim Curtis
#

# Turn off display power management
xset -dpms                                                                                                    

# Screensaver timeout in secs or 'off' for no timeout
xset s off                                                                                                    

# Capture screen size
SCREENSIZE="$(fbset -s | awk '$1 == "geometry" { print $2","$3 }')"                                         

# Clear browser cache                                                                                         
$(/var/www/util/sysutil.sh clearbrcache)

# Launch chromium browser
chromium-browser --app="http://localhost/" \
--window-size="1920,1080" \
--window-position="0,0" \
--enable-features="OverlayScrollbar" \
--no-first-run \
--disable-infobars \
--disable-session-crashed-bubble \
--force-device-scale-factor=2.00 \
--kiosk


I can propose a solution where a switch named 4K for the LocalGUI settings would change the contents of the ~/.xinitrc file. Of course, this issue would also occur when displaying the Moodeaudio GUI on a PC with a 4K screen resolution, but setting the zoom level, which would be remembered in the web browser preferences, essentially solves this problem automatically. I currently don't have a PC (and simultaneously Moodeaudio) with a resolution higher than FullHD at hand, so I can't confirm if this problem also occurs at such resolutions for the web browser window on a PC or tablet with a 4K resolution (I think, for now, there are no smartphones with such a resolution, at most slightly higher than 1920x1080, such as 1920x1200 can be found).
Reply


Messages In This Thread
Local GUI on 4K screens - by STUDI - 06-05-2024, 06:55 AM
RE: Local GUI on 4K screens - by Tim Curtis - 06-05-2024, 12:06 PM
RE: Local GUI on 4K screens - by STUDI - 06-06-2024, 06:52 AM
RE: Local GUI on 4K screens - by Tim Curtis - 06-06-2024, 10:02 AM
RE: Local GUI on 4K screens - by Venerdi - 06-06-2024, 11:36 AM
RE: Local GUI on 4K screens - by STUDI - 06-06-2024, 12:00 PM

Forum Jump: