Skip to content

Commit

Permalink
More help with Steam Deck scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
NiceneNerd committed Mar 29, 2024
1 parent e466b3a commit 6d70446
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion book/src/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ Solutions to some known problems follow:

This happens on some systems, *particularly Steam Deck*, for unknown reasons,
but can be fixed by setting the environment variable
`WINIT_X11_SCALE_FACTOR=1.0`.
`WINIT_X11_SCALE_FACTOR=1.0`. If you launch UKMM from the terminal, running
it as `WINIT_X11_SCALE_FACTOR=1.0 ukmm` from the UKMM folder will work.
Otherwise, you may try setting it in your `~/.profile` or `~/.Xprofile`, e.g.
by adding the line `export WINIT_X11_SCALE_FACTOR=1.0`. Also note that some
desktop environments contain tools for setting environment variables. If you
need help with this, ArchWiki has an [excellent article on the
topic](https://wiki.archlinux.org/title/environment_variables).
3 changes: 2 additions & 1 deletion src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ impl App {
fn new(cc: &eframe::CreationContext) -> Self {
if option_env!("UPDATE_PLATFORM").unwrap_or_default() == "steamdeck" {
cc.egui_ctx.set_pixels_per_point(
option_env!("WINIT_X11_SCALE_FACTOR")
std::env::var("WINIT_X11_SCALE_FACTOR")
.ok()
.and_then(|v| v.parse().ok())
.unwrap_or(1.0),
);
Expand Down

0 comments on commit 6d70446

Please sign in to comment.