Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions HMCL/src/main/resources/assets/HMCLauncher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,18 @@ fi

# _HMCL_VM_OPTIONS
if [ -n "${HMCL_JAVA_OPTS+x}" ]; then
# User-specified JVM options take precedence.
_HMCL_VM_OPTIONS=${HMCL_JAVA_OPTS}
else
_HMCL_VM_OPTIONS="-XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=15"

# JavaFX may not respect KDE Plasma Wayland fractional scaling automatically.
# Bridge QT_SCALE_FACTOR to JavaFX's GTK UI scale when available.
if [ "$_HMCL_OS" = "linux" ] && [ "$XDG_SESSION_TYPE" = "wayland" ]; then
if [ -n "$QT_SCALE_FACTOR" ]; then
_HMCL_VM_OPTIONS="$_HMCL_VM_OPTIONS -Dglass.gtk.uiScale=$QT_SCALE_FACTOR"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate QT_SCALE_FACTOR before passing to JavaFX

This forwards QT_SCALE_FACTOR verbatim into -Dglass.gtk.uiScale, but Qt allows non-scalar formats (for example semicolon-separated per-screen values), while JavaFX expects a single scale token; in those environments the launcher will pass an invalid JavaFX scale value and scaling falls back or behaves incorrectly. Adding a format check (or extracting a single numeric factor) before appending the JVM flag would avoid regressions for users with multi-screen Qt scaling configs.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks.

Qt scaling-related environment variables may indeed contain non-scalar values in some multi-monitor configurations.

I'll add a simple numeric format check before forwarding the value to JavaFX to avoid passing invalid scale factors.

fi
fi
fi

function show_warning_console() {
Expand Down