Compare commits

...
Author SHA1 Message Date
XxJSONDeruloxX e9a199285e perf: share Quest frames through GPU buffers 2026-10-15 20:25:21 -04:00
XxJSONDeruloxX d8de6895c1 fix: validate SteamVR preference backups 2026-10-15 20:14:22 -04:00
XxJSONDeruloxX fd7cb249b1 perf: request sustained OpenXR performance 2026-10-15 19:27:30 -04:00
XxJSONDeruloxX 21742403a4 fix: preserve OpenVR shared image layouts 2026-10-15 19:16:11 -04:00
XxJSONDeruloxX 46335b7871 fix: route VR scene focus through Gamescope 2026-10-15 19:03:59 -04:00
XxJSONDeruloxX 5e9ebbc7df fix: harden Quest VR compatibility 2026-10-15 18:55:23 -04:00
XxJSONDeruloxX 92f2696a0c fix: use SteamVR compositor on Quest 2026-10-15 18:21:39 -04:00
XxJSONDeruloxX 59f752c70d fix: provide Quest seated tracking origin 2026-10-15 17:36:02 -04:00
XxJSONDeruloxX 828374f236 feat: accept sRGB compositor frames 2026-10-15 16:55:42 -04:00
XxJSONDeruloxX 0a6e08d923 docs: record Quest VR color validation 2026-10-15 16:29:51 -04:00
XxJSONDeruloxX 2f5537acef perf: compress Quest XR captures over adb 2026-10-15 16:27:39 -04:00
XxJSONDeruloxX 15ef4b064b fix: preserve linear color in Quest VR frames 2026-10-15 16:25:53 -04:00
XxJSONDeruloxX 52d351908f feat: capture submitted Quest XR eye frames 2026-10-15 16:08:10 -04:00
XxJSONDeruloxX 19a8beea52 fix: close stale Quest XR sessions before reentry 2026-10-15 15:31:59 -04:00
XxJSONDeruloxX 65c6ca3552 fix: map Quest menu button to SteamVR dashboard 2026-10-15 15:05:48 -04:00
XxJSONDeruloxX 220442d634 feat: launch flat games through native SteamVR overlays 2026-10-15 14:05:16 -04:00
XxJSONDeruloxX d344b7dcba fix: harden Quest SteamVR frame transport 2026-10-15 13:53:00 -04:00
XxJSONDeruloxX fd6111fc69 feat: separate SteamVR and Cardboard tabs 2026-10-15 12:16:39 -04:00
XxJSONDeruloxX 389bef5ad3 feat: add Quest SteamVR to the standard app 2026-10-15 12:09:25 -04:00
Kurt Himebauch d301148881 fix: keep SteamVR syscall hooks and report Steam crashes (#905)
* fix: preserve SteamVR syscall hooks

* fix: report Steam crashes through gamescope
2026-10-15 15:50:26 +00:00
Jagger15andxXJsonDeruloXx 787cec2548 fix(quest): correct desktop and Steam display corruption across sessions (#733)
fix(quest): stabilize desktop and Steam layer presentation

Keep Quest SDR scenes and the black backdrop off the Android Vulkan swapchain regardless of session order or HDR preferences. Only report the first frame after client content is submitted.

Add backdrop lifecycle and first-frame regression coverage. Record the user's successful Quest 3 Test 2 result.

Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>
2026-10-15 09:51:02 -04:00
Jamie Schenker 0a72690631 fix: keep proot sessions alive when the kernel loses fork events (#457) 2026-10-15 09:50:29 -04:00
Muaz Kadan b539cc1111 Fix deploy_local.sh and droiddeckctl not finding a phone connected over wireless debugging (#864) 2026-10-15 09:47:01 -04:00
Kurt Himebauch acf66b2b0e fix: keep Quest-patched Turnip as the auto default (#853) 2026-10-15 09:46:26 -04:00
Kurt Himebauch 892f400145 feat: three-finger tap toggles Steam's on-screen keyboard in game mode (#782) 2026-10-15 09:36:28 -04:00
kingokksa 47e4f25346 feat: sort the store library and installed tabs, and switch between card and list views (#798) 2026-10-15 09:20:49 -04:00
Muaz Kadan e1ca869d8e Fix local builds on Linux failing after the first Comet build (#866) 2026-10-15 09:20:03 -04:00
Resul Övür 9eb509b9e1 test: cover GPU family and support classification (#880) 2026-10-15 09:19:40 -04:00
Kurt Himebauch c39a521a28 feat: Steam home wall fills from the signed-in library instead of store picks (#878) 2026-10-15 09:18:07 -04:00
FX1922 58ab106da8 fix: SteamGridDB lookups no longer stick as "no match" after a failure; add a search to the art chooser (#876) 2026-10-15 08:36:48 -04:00
Kurt Himebauch 6e49c0c287 feat: low-latency controller and touch toggles in the session drawer (#808) 2026-10-15 07:53:25 -04:00
The412Banner 322040123d DroidDeck-Proton: get releases from the Droid-Deck org repo (#875) 2026-10-15 07:29:42 -04:00
The412Banner 36a9cbfc13 DroidDeck-Proton: get releases from the Droid-Deck org repo
DroidDeck-Proton is now built and released on Droid-Deck/DroidDeck-Proton
(11-9.1 is Latest there), so the Components page, the update check and the
guest installer read releases from the org repo instead of The412Banner's.
2026-10-15 07:20:09 -04:00
Kurt Himebauch a2486b2afc fix: dependency scan ignores folders above the game folder (#859) 2026-10-15 07:03:17 -04:00
asdf17128 1bd3c64d01 Add top, bottom, and centered picture positions for Steam sessions (#871) 2026-10-15 07:01:01 -04:00
7fc61b4c3d l10n: translate the strings added since #284 into zh-CN, zh-HK, zh-TW and ja (#539)
* l10n: translate the 184 strings added since #284 (zh-CN/HK/TW, ja)

The stores, cloud saves, Windows components, Steam touch, desktop
removal and background-downloads strings landed after #284's
translation snapshot, so every one of them fell back to English.
Translate all 184 into Simplified Chinese, Traditional Chinese
(Taiwan and Hong Kong) and Japanese, keeping each locale file's own
vocabulary (工作階段/會話, 解除安裝/卸載, 元件/組件, 設定).

Also fix four Hong Kong strings that kept the simplified 着色器.

* l10n(zh): fix stale and ambiguous strings found in review

Severe: summary_remove_game was untranslated English in all three
files; mode_added_art_hint, wincomp_installers_note and
wincomp_needs_installer still described the pre-#480/#492 English.

Also: distinguish the Setup wizard from Android system settings in
zh-HK/zh-TW (初始設定 / 系統設定 / Android 設定), unify library as
收藏庫, component as 組件 in zh-HK, session as 會話 in zh-HK, account
as 帳戶 in zh-HK, Trending as 趋势/趨勢, Forget as 清除, reword the
re-applied-at-launch, action-failed and already-in-Games strings, and
play as 執行/開啟遊戲 in zh-TW/zh-HK.

* l10n(ja): fix stale and ambiguous strings found in review

---------

Co-authored-by: Dantalian <Dantalian-dev@users.noreply.github.com>
Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>
2026-10-15 03:41:17 +00:00
asdf17128andsiyuan.qsy 21e5fdfc63 Release pointer buttons without replaying stale motion (#803)
* Fix cursor warping on native touch down

* Preserve input cleanup without replaying stale pointer motion

---------

Co-authored-by: siyuan.qsy <siyuan.qsy@alibaba-inc.com>
2026-10-14 23:37:35 -04:00
Resul Övürandovurrsl f819988b0d fix: the front end keeps its page when the Fold is folded or unfolded (#832)
* fix: the front end keeps its page when the Fold is folded or unfolded

MainActivity, FileManagerActivity, FilePickerActivity and StoreLoginActivity did not declare the screen-size configuration changes, so folding or unfolding a foldable recreated them and dropped their in-memory state. They now handle orientation, screenSize, screenLayout, smallestScreenSize and density themselves, like SessionActivity already does. uiMode is left out on purpose.

* fix: store login keeps rebuilding its toolbar when the display density changes

StoreLoginActivity builds its toolbar in code with dp-to-pixel values taken at creation time and has no onConfigurationChanged. It no longer declares density in configChanges, so a density change recreates it as before this PR. Size and layout changes are still handled in place.

---------

Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>
2026-10-14 23:30:19 -04:00
39c8a0fe8c fix: Steam can restart more than twice in a session (#754)
* fix: Steam can restart more than twice in a session

Every exit 42 counted toward the cap that stops an update which will
not install, and the count was never cleared, so the third restart of
a session ended it however far apart they were. A client that ran for
a minute before asking is not that loop: the count starts again.

* fix: measure the client's run time as it exits

The time spent collecting logs and checking FEX after the client exits
counted toward its run, so a slow cleanup could make a quick exit 42
look like a long one and clear the count.

---------

Co-authored-by: Kirk <12691869+KirkPatrickJunsay@users.noreply.github.com>
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
2026-10-15 02:18:26 +00:00
Kurt Himebauchandangelrenefm 44331558cc feat: droiddeckctl reports on-screen pacing (recover #843) (#855)
feat: droiddeckctl pacing reports the frames that reached the screen

Reads SurfaceFlinger's timestats for the game's layer (or the session's
SurfaceView) over a capture: frames on screen, fps on screen, the
present-to-present histogram and how many intervals were off the usual
cadence. Records split by a refresh-rate change are summed. A game's own fps
counter counts frames handed over, so it can't show dropped or doubled frames.

Co-authored-by: angelrenefm <17342133+angelrenefm@users.noreply.github.com>
2026-10-15 02:17:06 +00:00
Kurt Himebauchandangelrenefm d2bab8970d fix: droiddeckctl reaches variant-package builds (recover #842) (#854)
fix: droiddeckctl reaches builds shipped under a variant package

The provider authority and the start Activity's component were fixed to
com.droiddeck.launcher, so droiddeckctl could not talk to the antutu,
ludashi or pubg builds from tools/release/variants.txt. DROIDDECK_PACKAGE
now picks the package; the Activity's class name stays the same in every
variant.

Co-authored-by: angelrenefm <17342133+angelrenefm@users.noreply.github.com>
2026-10-14 22:15:29 -04:00
eb22557702 l10n: German, French, Spanish, Italian, Portuguese and Russian for the zRAM, reset-settings and store free-space strings (#849)
* l10n: German, French, Spanish, Italian, Portuguese and Russian for the zRAM, reset-settings and store free-space strings

Adds the strings values-de, values-it and values-pt were missing (14 each) and the six that values-fr, values-es and values-ru were missing. Machine-assisted drafts that follow each file's existing register and terms; native review is welcome.

* l10n: correct missing active swap translations

---------

Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>
Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>
2026-10-14 22:09:50 -04:00
Resul Övürandovurrsl 38d560cef1 fix: an interrupted Linux runtime download resumes instead of starting again (#847)
* fix: an interrupted Linux runtime download resumes instead of starting again

installOnce() asked the downloader to resume but always deleted the archive in its finally block, so the next attempt began at zero. The archive is now named after the release version and checksum, a failed download keeps what it fetched, and archives of other releases (and the old fixed name) are removed. A checksum or extraction failure still deletes the file.

* test: Downloader resumes a cut-off download from the bytes it kept

Starts a socket server that promises the whole file, hangs up part way and then answers a Range request, and checks that the second downloadFile call resumes with the right offset and ends with identical bytes.

* fix: a resumed download discards a 206 that does not start where the kept bytes end

Downloader appended every 206 response to the partial file without
looking at Content-Range. A server or proxy that answers a Range request
with a different offset would leave a corrupt file. Check that the range
starts at the kept length; otherwise delete the partial file and start
again without a Range header.

Adds a test with a server that answers the Range request from offset 0.

---------

Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>
2026-10-14 22:01:29 -04:00
KirkandKirk 45a808c80d fix: a failed cloud save recovery no longer ends the app (#846)
The cloud-recovery thread started at every app start had nothing to
catch an error, so one went to CrashHandler, which halts the process
with status 2. In unit tests the thread can outlive the test that
started it, fail on the torn-down preferences, and take the whole test
run down. The error is now logged and the thread ends.

Co-authored-by: Kirk <12691869+KirkPatrickJunsay@users.noreply.github.com>
2026-10-14 22:01:17 -04:00
Resul Övürandovurrsl 929e049761 l10n: refresh stale and untranslated strings in es, fr, ko, ru (#850)
* l10n: refresh stale and untranslated strings in es, fr, ko, ru

- mode_added_art_hint: now mentions Steam then SteamGridDB (all four locales).
- wincomp_needs_installer / wincomp_installers_note: es and ko still described
  the old "coming soon" behaviour; align with the current English text.
- summary_remove_game: was still English in all four locales.

Machine-assisted translation; native-speaker review is welcome.

* l10n(es): say registro, not grabación, for the missing installer record

---------

Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>
2026-10-14 22:00:54 -04:00
Resul Övür 684f7407de fix: wireless ADB page names the child-process switch the way Android shows it (#848) 2026-10-14 21:45:18 -04:00
Yassine GherbiandKurt Himebauch 00a106e2fa chore: add agent comment rules (#748)
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
2026-10-14 21:39:47 -04:00
Kurt Himebauch 91dabdc1e7 chore: keep only the 3 newest session log folders (#852) 2026-10-14 21:32:05 -04:00
Kurt Himebauch f635e92498 fix: Steam touch controls load the layout Steam picked for DroidDeck's touch controller, including workshop layouts (#840) 2026-10-14 16:09:40 -04:00
RaidennrlandxXJsonDeruloXx eda1e9b9c6 Fix wired PowerA and PDP right-stick and trigger mapping (#692)
Fix wired PowerA and PDP stick and trigger axes

Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>
2026-10-14 13:56:17 -04:00
kmnkv1andxXJsonDeruloXx fa9a9446bb Build and test on Windows: LF session scripts, '/' in relative paths (#552)
fix: build and test on Windows

- .gitattributes keeps the session's scripts LF under core.autocrlf=true;
  CRLF scripts made every session exit with status 2.
- runtime_inputs.py and the scrub record / log zip use '/' in relative
  paths, which Windows reported with '\' (runtime inputs never matched).
- The read-only-folder scrub test is skipped on Windows, which still
  creates files in a read-only directory.

Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>
2026-10-14 13:56:12 -04:00
Gustash 3e3c4d69e4 feat: hide unfolded controls when a controller is connected (#829)
* feat: hide unfolded controls when a controller is connected

* fix: also hide controls when a BLE controller is connected

* fix: use refreshControls on session resume as well
2026-10-14 13:52:13 -04:00
Tjebbe Kerstens 913806f169 fix: seed redist markers again when the registry lost them (#793)
* fix: redist markers a replaced registry lost are seeded again

droiddeck-seed-redists recorded what it seeded in .droiddeck-redists and
trusted that record from then on. A Proton update replaces its
default_pfx system.reg but leaves our record beside it, and every new
prefix copies both, so new games got a record of markers their registry
never had: Steam then ran their install scripts for real. Batman: Arkham
City's AMD Dual-Core Optimizer installer hangs there, leaving the game
on "Running install script" on every launch.

Each recorded marker is now looked up in the registry, in both views
where both were written, and seeded again when it is gone; a record of
markers nobody wants any more is rewritten without them.

* Check every VC runtime architecture before keeping the vcrt marker

vcrt writes Installed for x86, x64 and arm64 in both registry views, but
present() only looked at x86. If only an x64 or arm64 value was gone the
runtime would not be seeded again. Require all six values and test the
loss of the arm64 Wow6432Node one.
2026-10-14 13:52:07 -04:00
Tjebbe Kerstens 7b018e6c42 fix: Batman: Arkham City starts with full x87 precision under FEX (#792)
Arkham City (BatmanAC.exe) stopped with Unreal's "Fatal error!" about
1.5 s after start: an access violation in BatmanAC.exe right after
steam.dll loads. The game leans on x87 and needs full precision under
FEX (FEX wiki), while the default FEX preset sets
FEX_X87REDUCEDPRECISION=1. Engine fixes sit above the shared preset and
below the player's own game profile, so a fix keyed on BatmanAC.exe
beside the started exe (BatmanAC.exe or BmLauncher.exe) restores
x87 precision for this game only. Arkham Asylum, which shares
BmLauncher.exe but not BatmanAC.exe, keeps the preset.
2026-10-14 13:52:01 -04:00
KirkandKirk e45d6f7192 fix: game shortcuts use the cover art when Steam's icon is too small (#825)
Steam keeps a 32x32 icon for each game, and the home screen stretched
it to launcher size. A square from the middle of the cover art is used
instead unless the icon is at least 128 px; the small icon is still
the fallback when there is no art.

Co-authored-by: Kirk <12691869+KirkPatrickJunsay@users.noreply.github.com>
2026-10-14 13:51:56 -04:00
Muaz Kadan b3ff93e80f Fix battery time estimates showing thousands of hours on phones that report current in mA (#820)
fix: read battery current reported in mA so time estimates aren't 1000x too long
2026-10-14 13:51:51 -04:00
William AllenandClaude Opus 5.5 c035351b4f fix: read the replaced listing's watch descriptor before detach can free it (#685)
install() replaces an existing cache entry by calling detach(old), which
destroys the listing when no reader holds it, and then reads old->wd to
decide whether to release the watch. When the old listing has no readers,
that read happens after the free.

Two threads that enumerate the same uncached directory at the same time
reach this path: both build a listing, the first installs an entry with
no readers, and the second replaces it.

Save the watch descriptor before detaching, as drop() already does.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 13:51:44 -04:00
Resul Övürandovurrsl 10cdf97480 fix: Turkish translation for zRAM, reset-settings and store storage messages (#826)
Adds the 14 translatable strings that values-tr was missing: the zRAM toggle and its hints, the Reset all settings row, dialog and toasts, and the store install free-space messages. Keys marked translatable=false stay untranslated on purpose.

Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>
2026-10-14 13:51:38 -04:00
Resul Övürandovurrsl f614483d01 docs: README names the child-process setting the way Android shows it (#831)
* docs: README names the child-process setting the way Android shows it

Developer options label this switch "Disable child process restrictions", and it has to be turned on. The README said to turn off "Restrict child processes".

* docs: README limits the child-process toggle to Android 14 and newer

The Developer options switch only exists from Android 14 (PhantomProcessLimit.hasDeveloperToggle); Android 12 and 13 keep the Fix it for me flow.

---------

Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>
2026-10-14 13:51:34 -04:00
Imgau f5eb5e7b81 fix: declare all-files access for raw USB storage (#760) 2026-10-14 13:48:14 -04:00
Kurt Himebauch bf99dbbe73 feat: store sign-in walls and the Steam home wall fill with curated featured art (#835) 2026-10-14 13:42:27 -04:00
Kushagra 46fac69438 feat: map a controller's two back paddles to the Deck's L4 and R4 (#797) 2026-10-14 15:31:59 +00:00
Gustash 82f04fb22e fix: the touchpad moves a game's own cursor when it locks the pointer (#772) 2026-10-14 11:30:54 -04:00
Kurt Himebauch 9796525449 perf: local builds reuse unchanged native steps across runs and worktrees (#819) 2026-10-14 15:30:24 +00:00
197 changed files with 10333 additions and 649 deletions

No files matched your search

+2
View File
@@ -1,2 +1,4 @@
tools/linuxfs/** text=auto eol=lf
tools/mangoapp/** text=auto eol=lf
tools/comet/LICENSE whitespace=-blank-at-eof
tools/comet/droiddeck.patch whitespace=-blank-at-eol,-blank-at-eof
+20 -2
View File
@@ -193,7 +193,7 @@ jobs:
run: |
set -euo pipefail
sudo apt-get update -qq
sudo apt-get install -y -qq gcc-aarch64-linux-gnu g++-aarch64-linux-gnu >/dev/null
sudo apt-get install -y -qq gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libvulkan1 mesa-vulkan-drivers >/dev/null
D=app/src/main/assets/linuxfs
mkdir -p "$D"
aarch64-linux-gnu-g++ -shared -fPIC -O2 -Wall -Wno-attributes -Wno-nonnull-compare \
@@ -396,6 +396,24 @@ jobs:
set -euo pipefail
bash tools/linuxfs/check-preloads.sh app/src/main/assets/linuxfs
- name: Check Quest tracking IPC
run: |
g++ -std=c++17 -Wall -Wextra -Werror -pthread tools/vr/tests/test_xr_tracking.cpp -o /tmp/test-xr-tracking
/tmp/test-xr-tracking
g++ -std=c++17 -Wall -Wextra -Werror tools/vr/tests/test_xr_touch.cpp -o /tmp/test-xr-touch
/tmp/test-xr-touch
g++ -std=c++17 -Wall -Wextra -Werror -pthread tools/vr/tests/test_xr_vsync.cpp -o /tmp/test-xr-vsync
/tmp/test-xr-vsync
g++ -std=c++17 -Wall -Wextra -Werror -pthread tools/vr/tests/test_xr_frames.cpp -o /tmp/test-xr-frames
/tmp/test-xr-frames
cc -Itools/vr/third_party/wayland -c tools/vr/src/wayland_client_stub.c -o /tmp/test-wayland-stub.o
cc -Itools/vr/third_party/wayland -c app/src/main/cpp/waylandcomp/generated/xdg-shell-protocol.c -o /tmp/test-xdg-shell.o
g++ -std=c++17 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-missing-field-initializers -pthread -Ibuild/vr/include \
-Itools/vr/third_party/wayland -Iapp/src/main/cpp/waylandcomp/generated \
tools/vr/tests/test_presenter_shutdown.cpp tools/vr/src/presenter.cpp /tmp/test-wayland-stub.o /tmp/test-xdg-shell.o \
-ldl -o /tmp/test-presenter-shutdown
timeout 10 /tmp/test-presenter-shutdown
- name: Rust toolchain for the store engines (aarch64-linux-android)
id: rust
run: |
@@ -429,7 +447,7 @@ jobs:
path: |
app/.cxx
app/build/intermediates/cxx
key: cxx-${{ env.NDK_VERSION }}-${{ hashFiles('app/src/main/cpp/**') }}
key: cxx-${{ env.NDK_VERSION }}-${{ hashFiles('app/src/main/cpp/**', 'tools/vr/src/xr_*.h') }}
restore-keys: |
cxx-${{ env.NDK_VERSION }}-
+3
View File
@@ -0,0 +1,3 @@
# Rules
- Comments should be rare, factual, and explain only non-obvious external constraints or business invariants.
+1 -1
View File
@@ -17,7 +17,7 @@ DroidDeck brings the SteamOS experience to Android: Valve's Steam client in Big
Use Android 9 or newer on a supported Adreno device (730 or newer, or 8xx). Adreno 6xx is experimental: DirectX 11 uses DXVK 2 and may run, and DirectX 12 games can still crash. Mali, Xclipse, PowerVR, and Adreno 710 are unsupported. No root is required. Allow about 3 GB for the runtime and 1.1 GB more for the desktop and emulators. Install the APK from [Releases](https://github.com/Droid-Deck/DroidDeck/releases), install the Linux runtime, then press **Play** and sign in. Steam downloads on first launch. Install **Desktop & apps** to use the desktop and emulators. The **Store** installs Linux apps and games from Flathub (ARM64 builds) with Flatpak; with additional options to install Appimages and set up scripts. **Stores** (Setup › Stores › "Show Stores in the rail") signs in to GOG, Epic Games and Amazon Games, browses their catalogs and libraries, downloads games into the Games storage and adds each one to the Steam client as a non-Steam game, so it launches through Proton like everything else; the cog on its chip row sets which tab a store opens on and the download speed tier.
Before Steam launches, you must turn off **Restrict child processes** in Developer options. If this option is not available in developer settings (Android 12 and 13 devices), first launch of Steam will present a "Fix it for me" button, which will help automate the setup process.
On Android 14 and newer, before Steam launches, you must turn on **Disable child process restrictions** in Developer options. If this option is not available in developer settings (Android 12 and 13 devices), first launch of Steam will present a "Fix it for me" button, which will help automate the setup process.
## Community
+2
View File
@@ -150,6 +150,7 @@ android {
}
buildFeatures {
prefab true
compose true
buildConfig true
}
@@ -225,6 +226,7 @@ if (!skipRust) android.sourceSets.main.jniLibs.srcDir(rustJniLibsDir)
tasks.named('preBuild').configure { dependsOn(buildRustStores) }
dependencies {
implementation 'org.khronos.openxr:openxr_loader_for_android:1.1.49'
implementation 'com.github.luben:zstd-jni:1.5.2-3@aar'
implementation 'org.apache.commons:commons-compress:1.27.1'
implementation 'org.tukaani:xz:1.10'
+18 -1
View File
@@ -6,6 +6,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
@@ -21,6 +22,7 @@
<uses-feature android:name="android.hardware.vulkan.version" android:version="0x401000" android:required="true" />
<uses-feature android:name="android.hardware.gamepad" android:required="false" />
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="false" />
<application
android:name=".App"
@@ -36,12 +38,24 @@
android:isGame="true">
<meta-data android:name="android.game_mode_config" android:resource="@xml/game_mode_config" />
<activity android:name=".QuestXrActivity" android:exported="true" android:launchMode="singleTask"
android:permission="android.permission.DUMP"
android:resizeableActivity="false" android:screenOrientation="landscape"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|keyboard|navigation|uiMode"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
<meta-data android:name="android.app.lib_name" android:value="droiddeckxr" />
<intent-filter>
<action android:name="com.droiddeck.launcher.XR" />
<category android:name="com.oculus.intent.category.VR" />
<category android:name="org.khronos.openxr.intent.category.IMMERSIVE_HMD" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true"
android:screenOrientation="sensorLandscape"
android:configChanges="keyboard|keyboardHidden|navigation">
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|density|keyboard|keyboardHidden|navigation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@@ -91,18 +105,21 @@
android:name=".files.FileManagerActivity"
android:exported="false"
android:screenOrientation="sensorLandscape"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|density"
android:theme="@style/AppTheme" />
<activity
android:name=".files.FilePickerActivity"
android:exported="false"
android:screenOrientation="sensorLandscape"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|density"
android:theme="@style/AppTheme" />
<activity
android:name=".stores.StoreLoginActivity"
android:exported="false"
android:screenOrientation="sensorLandscape"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
android:theme="@style/AppTheme" />
<activity
+1
View File
@@ -30,6 +30,7 @@ string(SUBSTRING "${WINFG_CHAIN_HASH_FULL}" 0 12 WINFG_CHAIN_HASH)
message(STATUS "win-fg chain: ${WINFG_UPSTREAM} (src ${WINFG_CHAIN_HASH})")
add_subdirectory(waylandcomp)
add_subdirectory(questxr)
add_library(sdnative SHARED sdnative/sdnative.c)
target_link_libraries(sdnative log)
+44 -20
View File
@@ -1140,8 +1140,12 @@ struct DeckImu {
uint16_t pressure[2];
uint32_t controls;
uint32_t pad_type;
uint32_t latency;
};
static_assert(offsetof(DeckImu, pad_type) == 44, "DeckImu::pad_type matches FakeInputWriter");
static_assert(offsetof(DeckImu, latency) == 48, "DeckImu::latency matches FakeInputWriter");
static constexpr uint32_t LATENCY_CONTROLLER = 1, LATENCY_TOUCH = 2;
static constexpr int LOW_LATENCY_REPORT_INTERVAL_US = 1000;
static constexpr uint32_t DECK_EXTRA_L4 = 1, DECK_EXTRA_R4 = 2, DECK_EXTRA_L5 = 4,
DECK_EXTRA_R5 = 8, DECK_EXTRA_LPAD_TOUCH = 16,
DECK_EXTRA_RPAD_TOUCH = 32, DECK_EXTRA_LPAD_CLICK = 64,
@@ -1303,6 +1307,27 @@ __attribute__((visibility("hidden"))) static uint32_t live_pad_type() {
return value & PAD_TYPE_SET ? value & 0xff : session_pad_type();
}
__attribute__((visibility("hidden"))) static bool low_latency(uint32_t which) {
const uint8_t *blocks = ring_blocks();
const DeckImu *imu = blocks ? reinterpret_cast<const DeckImu *>(blocks + FAKE_INPUT_RING_SIZE) : nullptr;
return imu && (__atomic_load_n(&imu->latency, __ATOMIC_ACQUIRE) & which);
}
__attribute__((visibility("hidden"))) static int controller_report_interval_us(int normal_us) {
return low_latency(LATENCY_CONTROLLER) ? LOW_LATENCY_REPORT_INTERVAL_US : normal_us;
}
__attribute__((visibility("hidden"))) static void sleep_us(int us) {
struct timespec interval = {0, us * 1000L};
nanosleep(&interval, nullptr);
}
__attribute__((visibility("hidden"))) static uint64_t monotonic_us() {
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
return static_cast<uint64_t>(now.tv_sec) * 1000000ULL + static_cast<uint64_t>(now.tv_nsec) / 1000ULL;
}
static bool fake_triton_enabled() {
static int enabled = -1;
if (enabled < 0)
@@ -1453,8 +1478,7 @@ __attribute__((visibility("hidden"))) static void *deck_report_thread(void *arg)
if (send(self->peer, report, sizeof(report), MSG_DONTWAIT | MSG_NOSIGNAL) < 0 &&
errno != EAGAIN && errno != EWOULDBLOCK)
break;
struct timespec interval = {0, DECK_REPORT_INTERVAL_US * 1000L};
nanosleep(&interval, nullptr);
sleep_us(controller_report_interval_us(DECK_REPORT_INTERVAL_US));
}
syscall(SYS_close, self->peer);
munmap(self->ring, self->mapping_size);
@@ -1486,7 +1510,7 @@ __attribute__((visibility("hidden"))) static void put_sony_touch(uint8_t *at, So
}
__attribute__((visibility("hidden"))) static void
build_sony_report(uint8_t *report, uint8_t model, uint32_t packet, uint32_t buttons, const int32_t *axes,
build_sony_report(uint8_t *report, uint8_t model, uint32_t packet, uint64_t elapsed_us, uint32_t buttons, const int32_t *axes,
const DeckExtras &extras, SonyTouch &touch) {
memset(report, 0, SONY_REPORT_BYTES);
report[0] = 0x01;
@@ -1517,7 +1541,7 @@ build_sony_report(uint8_t *report, uint8_t model, uint32_t packet, uint32_t butt
p[6] = static_cast<uint8_t>(system | ((packet & 0x3f) << 2));
p[7] = left_trigger;
p[8] = right_trigger;
put16(p + 9, static_cast<int>(packet * 750));
put16(p + 9, static_cast<int>(elapsed_us * 3 / 16));
for (int i = 0; i < 3; i++) {
put16(p + 12 + i * 2, gyro[i]);
put16(p + 18 + i * 2, accel[i]);
@@ -1539,7 +1563,7 @@ build_sony_report(uint8_t *report, uint8_t model, uint32_t packet, uint32_t butt
put16(p + 15 + i * 2, gyro[i]);
put16(p + 21 + i * 2, accel[i]);
}
put32(p + 27, packet * 12000);
put32(p + 27, static_cast<uint32_t>(elapsed_us * 3));
put_sony_touch(p + 32, touch, 0, left, extras.pads[0], extras.pads[1], SONY_TOUCH_HEIGHT_DUALSENSE);
put_sony_touch(p + 36, touch, 1, right, extras.pads[2], extras.pads[3], SONY_TOUCH_HEIGHT_DUALSENSE);
p[52] = 0x2a;
@@ -1558,6 +1582,7 @@ __attribute__((visibility("hidden"))) static void *sony_report_thread(void *arg)
int32_t axes[8] = {};
DeckExtras extras;
SonyTouch touch;
const uint64_t start_us = monotonic_us();
while (live_pad_type() == type) {
if (read_snapshot(self->ring, snap) && snap.generation == ring_generation(self->ring)) {
buttons = snap.buttons;
@@ -1565,12 +1590,11 @@ __attribute__((visibility("hidden"))) static void *sony_report_thread(void *arg)
}
read_deck_extras(*self, extras);
uint8_t report[SONY_REPORT_BYTES];
build_sony_report(report, self->sony, ++packet, buttons, axes, extras, touch);
build_sony_report(report, self->sony, ++packet, monotonic_us() - start_us, buttons, axes, extras, touch);
if (send(self->peer, report, sizeof(report), MSG_DONTWAIT | MSG_NOSIGNAL) < 0 &&
errno != EAGAIN && errno != EWOULDBLOCK)
break;
struct timespec interval = {0, DECK_REPORT_INTERVAL_US * 1000L};
nanosleep(&interval, nullptr);
sleep_us(controller_report_interval_us(DECK_REPORT_INTERVAL_US));
}
syscall(SYS_close, self->peer);
munmap(self->ring, self->mapping_size);
@@ -1684,8 +1708,7 @@ __attribute__((visibility("hidden"))) static void *triton_report_thread(void *ar
errno != EAGAIN && errno != EWOULDBLOCK)
break;
}
struct timespec interval = {0, TRITON_REPORT_INTERVAL_US * 1000L};
nanosleep(&interval, nullptr);
sleep_us(controller_report_interval_us(TRITON_REPORT_INTERVAL_US));
}
syscall(SYS_close, self->peer);
munmap(self->ring, self->mapping_size);
@@ -1709,7 +1732,7 @@ static constexpr int16_t TRITON_WIRED_PRODUCT = 0x1302;
static constexpr int32_t TRITON_STICK_TOUCH = 2000;
__attribute__((visibility("hidden"))) static void
build_triton_report(uint8_t *report, uint32_t packet, uint32_t buttons, const int32_t *axes,
build_triton_report(uint8_t *report, uint32_t packet, uint64_t elapsed_us, uint32_t buttons, const int32_t *axes,
const DeckExtras &extras) {
memset(report, 0, TRITON_STATE_BYTES);
report[0] = static_cast<uint8_t>(packet);
@@ -1752,7 +1775,7 @@ build_triton_report(uint8_t *report, uint32_t packet, uint32_t buttons, const in
put16(report + 23, extras.pads[2]);
put16(report + 25, extras.pads[3]);
put16(report + 27, extras.pressure[1]);
put32(report + 29, packet * TRITON_REPORT_INTERVAL_US);
put32(report + 29, static_cast<uint32_t>(elapsed_us));
for (int i = 0; i < 3; i++) {
put16(report + 33 + i * 2, extras.accel[i]);
put16(report + 39 + i * 2, extras.gyro[i]);
@@ -1768,6 +1791,7 @@ __attribute__((visibility("hidden"))) static void *triton_pad_thread(void *arg)
uint32_t buttons = 0;
int32_t axes[8] = {};
DeckExtras extras;
const uint64_t start_us = monotonic_us();
while (live_pad_type() == PAD_TYPE_STEAM) {
if (read_snapshot(self->ring, snap) && snap.generation == ring_generation(self->ring)) {
buttons = snap.buttons;
@@ -1776,12 +1800,11 @@ __attribute__((visibility("hidden"))) static void *triton_pad_thread(void *arg)
read_deck_extras(*self, extras);
uint8_t report[TRITON_REPORT_ID_BYTES + TRITON_STATE_BYTES];
report[0] = TRITON_STATE_WIRED;
build_triton_report(report + 1, ++packet, buttons, axes, extras);
build_triton_report(report + 1, ++packet, monotonic_us() - start_us, buttons, axes, extras);
if (send(self->peer, report, sizeof(report), MSG_DONTWAIT | MSG_NOSIGNAL) < 0 &&
errno != EAGAIN && errno != EWOULDBLOCK)
break;
struct timespec interval = {0, TRITON_REPORT_INTERVAL_US * 1000L};
nanosleep(&interval, nullptr);
sleep_us(controller_report_interval_us(TRITON_REPORT_INTERVAL_US));
}
syscall(SYS_close, self->peer);
munmap(self->ring, self->mapping_size);
@@ -2019,8 +2042,7 @@ __attribute__((visibility("hidden"))) static void *touch_report_thread(void *arg
if (send(self->peer, report, sizeof(report), MSG_DONTWAIT | MSG_NOSIGNAL) < 0 &&
errno != EAGAIN && errno != EWOULDBLOCK)
break;
struct timespec interval = {0, TOUCH_REPORT_INTERVAL_US * 1000L};
nanosleep(&interval, nullptr);
sleep_us(low_latency(LATENCY_TOUCH) ? LOW_LATENCY_REPORT_INTERVAL_US : TOUCH_REPORT_INTERVAL_US);
}
syscall(SYS_close, self->peer);
touch_state([](TouchRingFile &r) { if (r.opened) r.opened--; });
@@ -3545,6 +3567,7 @@ EXPORT int close(int fd) {
}
static constexpr int kMaxRingWaitMs = 2;
static constexpr int kLowLatencyRingWaitUs = 250;
EXPORT ssize_t read(int fd, void *buf, size_t count) {
if (!watched(fd)) return syscall(SYS_read, fd, buf, count);
@@ -3633,7 +3656,8 @@ EXPORT ssize_t read(int fd, void *buf, size_t count) {
int result = nanosleep(&sleep_time, nullptr);
guard.lock();
if (result < 0) return -1;
if (backoff_ns < kMaxRingWaitMs * 1000 * 1000) backoff_ns *= 2;
if (low_latency(LATENCY_CONTROLLER)) backoff_ns = kLowLatencyRingWaitUs * 1000;
else if (backoff_ns < kMaxRingWaitMs * 1000 * 1000) backoff_ns *= 2;
}
}
@@ -3815,7 +3839,7 @@ static int poll_fake(struct pollfd *fds, nfds_t nfds, int timeout,
if (deadline_ms >= 0 && monotonic_ms() >= deadline_ms)
return 0;
if (backoff_ms < kMaxRingWaitMs)
if (backoff_ms < kMaxRingWaitMs && !low_latency(LATENCY_CONTROLLER))
backoff_ms *= 2;
}
}
@@ -3988,7 +4012,7 @@ EXPORT int select(int nfds, fd_set *readfds, fd_set *writefds,
if (deadline_ms >= 0 && monotonic_ms() >= deadline_ms)
return 0;
if (backoff_ms < kMaxRingWaitMs)
if (backoff_ms < kMaxRingWaitMs && !low_latency(LATENCY_CONTROLLER))
backoff_ms *= 2;
}
}
+13
View File
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.22.1)
project(droiddeckxr C CXX)
find_package(OpenXR REQUIRED CONFIG)
add_library(droiddeckxr_glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
target_include_directories(droiddeckxr_glue PUBLIC ${ANDROID_NDK}/sources/android/native_app_glue)
add_library(droiddeckxr SHARED quest_xr.cpp)
target_compile_features(droiddeckxr PRIVATE cxx_std_17)
target_compile_definitions(droiddeckxr PRIVATE XR_USE_PLATFORM_ANDROID XR_USE_GRAPHICS_API_OPENGL_ES XR_USE_TIMESPEC)
target_compile_options(droiddeckxr PRIVATE -Wall -Wextra -Wno-missing-field-initializers -Werror=return-type)
target_link_options(droiddeckxr PRIVATE -Wl,-z,max-page-size=16384 -uANativeActivity_onCreate)
target_link_libraries(droiddeckxr PRIVATE droiddeckxr_glue OpenXR::openxr_loader EGL GLESv3 android log)
target_include_directories(droiddeckxr PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../tools/vr/src)
+201
View File
@@ -0,0 +1,201 @@
#pragma once
#include <EGL/eglext.h>
#include <GLES3/gl31.h>
#include <GLES2/gl2ext.h>
#include <android/hardware_buffer.h>
#include "xr_gpu_channel.h"
class QuestGpuFrames {
public:
bool Start(const std::string &filename, EGLDisplay display) {
const char *extensions = reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS));
const char *eglExtensions = eglQueryString(display, EGL_EXTENSIONS);
if (!extensions || !eglExtensions || !strstr(extensions, "GL_EXT_external_buffer")
|| !strstr(eglExtensions, "EGL_ANDROID_get_native_client_buffer")) return false;
storage_ = reinterpret_cast<PFNGLBUFFERSTORAGEEXTERNALEXTPROC>(eglGetProcAddress("glBufferStorageExternalEXT"));
client_ = reinterpret_cast<PFNEGLGETNATIVECLIENTBUFFERANDROIDPROC>(eglGetProcAddress("eglGetNativeClientBufferANDROID"));
if (strstr(extensions, "GL_OES_texture_view")) view_ = reinterpret_cast<PFNGLTEXTUREVIEWOESPROC>(eglGetProcAddress("glTextureViewOES"));
else if (strstr(extensions, "GL_EXT_texture_view")) view_ = reinterpret_cast<PFNGLTEXTUREVIEWOESPROC>(eglGetProcAddress("glTextureViewEXT"));
if (!storage_ || !client_ || !view_ || filename.size() >= sizeof(sockaddr_un::sun_path)) return false;
const char *source = "#version 310 es\nlayout(local_size_x=8,local_size_y=8)in;"
"layout(std430,binding=0)readonly buffer Source{uint pixels[];};"
"layout(rgba8,binding=0)writeonly uniform highp image2D target;uniform bool bgra;"
"void main(){ivec2 p=ivec2(gl_GlobalInvocationID.xy),size=imageSize(target);"
"if(any(greaterThanEqual(p,size)))return;vec4 value=unpackUnorm4x8(pixels[p.y*size.x+p.x]);"
"imageStore(target,p,bgra?value.bgra:value);}";
GLuint shader = glCreateShader(GL_COMPUTE_SHADER); glShaderSource(shader, 1, &source, nullptr); glCompileShader(shader);
program_ = glCreateProgram(); glAttachShader(program_, shader); glLinkProgram(program_); glDeleteShader(shader);
GLint linked{}; glGetProgramiv(program_, GL_LINK_STATUS, &linked);
if (!linked) { Stop(); return false; }
lock_ = open((filename + ".lock").c_str(), O_CREAT | O_RDWR | O_CLOEXEC | O_NOFOLLOW, 0600);
struct stat status{};
if (lock_ < 0 || fstat(lock_, &status) || !S_ISREG(status.st_mode) || status.st_uid != getuid()
|| flock(lock_, LOCK_EX | LOCK_NB)) { Stop(); return false; }
if (lstat(filename.c_str(), &status) == 0) {
if (!S_ISSOCK(status.st_mode) || status.st_uid != getuid() || unlink(filename.c_str())) { Stop(); return false; }
} else if (errno != ENOENT) { Stop(); return false; }
listener_ = socket(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC | SOCK_NONBLOCK, 0);
sockaddr_un address{}; address.sun_family = AF_UNIX; strcpy(address.sun_path, filename.c_str());
if (listener_ < 0 || bind(listener_, reinterpret_cast<sockaddr *>(&address), sizeof(address))) { Stop(); return false; }
filename_ = filename;
if (chmod(filename.c_str(), 0600) || listen(listener_, 2)) { Stop(); return false; }
return true;
}
bool Take(DroidDeckXrFrameHeader &header, GLuint &texture) {
if (listener_ < 0) return false;
if (peer_ < 0) {
peer_ = accept4(listener_, nullptr, nullptr, SOCK_CLOEXEC | SOCK_NONBLOCK);
if (peer_ < 0) return false;
if (!xr_frame_peer(peer_)) { Disconnect(); return false; }
configured_ = false; deadline_ = xr_frame_now() + 2000000000LL;
}
pollfd ready{peer_, POLLIN, 0};
if (poll(&ready, 1, 0) <= 0) {
if (!configured_ && xr_frame_now() > deadline_) Disconnect();
return false;
}
if (!(ready.revents & POLLIN)) { Disconnect(); return false; }
if (!configured_) {
XrGpuRequest request;
if (!xr_gpu_receive(peer_, &request, sizeof(request)) || request.magic != XR_GPU_MAGIC
|| request.version != XR_GPU_VERSION || !xr_gpu_dimensions(request.width, request.height)
|| !Allocate(request.width, request.height)) { Disconnect(); return false; }
XrGpuPoolInfo info; info.width = width_; info.height = height_;
for (unsigned index = 0; index < XR_GPU_SLOTS; index++) info.sizes[index] = sizes_[index];
configured_ = xr_gpu_send(peer_, &info, sizeof(info), fds_.data(), fds_.size());
for (int &fd : fds_) { if (fd >= 0) close(fd); fd = -1; }
if (!configured_) Disconnect();
return false;
}
XrGpuFrame frame;
if (!xr_gpu_receive(peer_, &frame, sizeof(frame))) { Disconnect(); return false; }
auto state = xr_gpu_frame_state(frame, width_, height_, lastFrame_, xr_frame_now());
if (state == XrGpuFrameState::Invalid) {
rejected_++; Disconnect(); return false;
}
lastFrame_ = frame.header.frame_id;
if (state == XrGpuFrameState::Stale) {
// No GPU read was submitted, so the producer can safely reclaim a dropped frame.
dropped_++;
if (!xr_gpu_send(peer_, &frame.header.frame_id, sizeof(frame.header.frame_id))) Disconnect();
return false;
}
if (!Output()) { Disconnect(); return false; }
glMemoryBarrier(GL_ALL_BARRIER_BITS);
glUseProgram(program_); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, buffers_[frame.slot]);
glUniform1i(glGetUniformLocation(program_, "bgra"), !!(frame.flags & XR_GPU_BGRA));
glBindImageTexture(0, raw_, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_RGBA8);
glDispatchCompute((width_ + 7) / 8, (height_ + 7) / 8, 1);
glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT | GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
// The producer may overwrite this slot only after the native GPU has finished reading it.
glFinish();
if (glGetError() != GL_NO_ERROR) { rejected_++; Disconnect(); return false; }
if (!xr_gpu_send(peer_, &frame.header.frame_id, sizeof(frame.header.frame_id))) Disconnect();
received_++;
header = frame.header;
texture = header.color_space == DROIDDECK_XR_COLOR_SRGB_RGBA8 ? srgb_ : raw_;
return true;
}
uint64_t Received() const { return received_; }
uint64_t Rejected() const { return rejected_; }
uint64_t Dropped() const { return dropped_; }
void Stop() {
Disconnect(); DropPool();
glDeleteTextures(1, &srgb_); glDeleteTextures(1, &raw_); srgb_ = raw_ = 0;
if (program_) glDeleteProgram(program_); program_ = 0;
if (listener_ >= 0) close(listener_); listener_ = -1;
if (!filename_.empty()) unlink(filename_.c_str()); filename_.clear();
if (lock_ >= 0) close(lock_); lock_ = -1;
}
private:
int listener_ = -1, peer_ = -1, lock_ = -1;
std::string filename_;
bool configured_ = false;
int64_t deadline_{};
uint32_t width_{}, height_{}, outputWidth_{}, outputHeight_{};
uint64_t lastFrame_{}, received_{}, rejected_{}, dropped_{};
std::array<AHardwareBuffer *, XR_GPU_SLOTS> hardware_{};
std::array<GLuint, XR_GPU_SLOTS> buffers_{};
std::array<int, XR_GPU_SLOTS> fds_{{-1, -1, -1}};
std::array<uint64_t, XR_GPU_SLOTS> sizes_{};
GLuint raw_{}, srgb_{}, program_{};
PFNGLBUFFERSTORAGEEXTERNALEXTPROC storage_{};
PFNEGLGETNATIVECLIENTBUFFERANDROIDPROC client_{};
PFNGLTEXTUREVIEWOESPROC view_{};
void Disconnect() { if (peer_ >= 0) close(peer_); peer_ = -1; configured_ = false; lastFrame_ = 0; }
void DropPool() {
if (buffers_[0]) glFinish();
glDeleteBuffers(buffers_.size(), buffers_.data()); buffers_.fill(0);
for (auto *&buffer : hardware_) { if (buffer) AHardwareBuffer_release(buffer); buffer = nullptr; }
for (int &fd : fds_) { if (fd >= 0) close(fd); fd = -1; }
}
static int AllocationFd(AHardwareBuffer *buffer, uint64_t bytes, uint64_t &allocation) {
int pair[2];
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, pair)) return -1;
if (AHardwareBuffer_sendHandleToUnixSocket(buffer, pair[0])) { close(pair[0]); close(pair[1]); return -1; }
close(pair[0]);
int selected = -1; unsigned candidates = 0;
for (;;) {
unsigned char data[1024]; iovec bytesReceived{data, sizeof(data)};
alignas(cmsghdr) unsigned char control[CMSG_SPACE(32 * sizeof(int))]{};
msghdr message{}; message.msg_iov = &bytesReceived; message.msg_iovlen = 1;
message.msg_control = control; message.msg_controllen = sizeof(control);
ssize_t result = recvmsg(pair[1], &message, MSG_CMSG_CLOEXEC);
if (result < 0 && errno == EINTR) continue;
if (result <= 0) break;
for (auto *item = CMSG_FIRSTHDR(&message); item; item = CMSG_NXTHDR(&message, item)) {
if (item->cmsg_level != SOL_SOCKET || item->cmsg_type != SCM_RIGHTS) continue;
auto *fds = reinterpret_cast<int *>(CMSG_DATA(item));
for (unsigned index = 0; index < (item->cmsg_len - CMSG_LEN(0)) / sizeof(int); index++) {
struct stat status{};
if (!fstat(fds[index], &status) && status.st_size >= static_cast<int64_t>(bytes)
&& status.st_size <= static_cast<int64_t>(bytes + 65536)) {
candidates++; if (selected >= 0) close(selected);
selected = fds[index]; allocation = status.st_size;
} else close(fds[index]);
}
}
if (message.msg_flags & (MSG_TRUNC | MSG_CTRUNC)) { candidates = 0; break; }
}
close(pair[1]);
if (candidates != 1) { if (selected >= 0) close(selected); return -1; }
return selected;
}
bool Allocate(uint32_t width, uint32_t height) {
DropPool(); width_ = width; height_ = height;
const uint64_t bytes = uint64_t(width) * height * 4;
GLint64 limit{}; glGetInteger64v(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, &limit);
if (bytes > static_cast<uint64_t>(limit)) return false;
AHardwareBuffer_Desc description{}; description.width = bytes; description.height = description.layers = 1;
description.format = AHARDWAREBUFFER_FORMAT_BLOB;
description.usage = AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER;
glGenBuffers(buffers_.size(), buffers_.data());
for (unsigned index = 0; index < XR_GPU_SLOTS; index++) {
if (AHardwareBuffer_allocate(&description, &hardware_[index])) { DropPool(); return false; }
fds_[index] = AllocationFd(hardware_[index], bytes, sizes_[index]);
if (fds_[index] < 0) { DropPool(); return false; }
glBindBuffer(GL_SHADER_STORAGE_BUFFER, buffers_[index]);
storage_(GL_SHADER_STORAGE_BUFFER, 0, bytes, client_(hardware_[index]), 0);
if (glGetError() != GL_NO_ERROR) { DropPool(); return false; }
}
glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
return true;
}
bool Output() {
if (raw_ && outputWidth_ == width_ && outputHeight_ == height_) return true;
glDeleteTextures(1, &srgb_); glDeleteTextures(1, &raw_); srgb_ = raw_ = 0;
glGenTextures(1, &raw_); glBindTexture(GL_TEXTURE_2D, raw_);
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, width_, height_);
glGenTextures(1, &srgb_); view_(srgb_, GL_TEXTURE_2D, raw_, GL_SRGB8_ALPHA8, 0, 1, 0, 1);
for (GLuint texture : {raw_, srgb_}) {
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
outputWidth_ = width_; outputHeight_ = height_;
return glGetError() == GL_NO_ERROR;
}
};
+777
View File
@@ -0,0 +1,777 @@
#include <jni.h>
#include <EGL/egl.h>
#include <GLES3/gl3.h>
#include <android/log.h>
#include <android_native_app_glue.h>
#include <time.h>
#include <openxr/openxr.h>
#include <openxr/openxr_platform.h>
#include <array>
#include <vector>
#include <utility>
#include <string>
#include <stdexcept>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <chrono>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cerrno>
#include <cstddef>
#include <ctime>
#include "xr_tracking.h"
#include "xr_frame_channel.h"
#include "xr_frame_math.h"
#include "gpu_frames.h"
static void check(XrResult result, const char *operation) {
if (XR_FAILED(result)) throw std::runtime_error(std::string(operation) + ": " + std::to_string(result));
}
struct Eye {
XrSwapchain swapchain = XR_NULL_HANDLE;
int width = 0, height = 0;
std::vector<XrSwapchainImageOpenGLESKHR> images;
};
class QuestXR {
public:
explicit QuestXR(android_app *app) : app_(app) {}
~QuestXR() { cleanup(); }
void run() {
initialize();
while (!app_->destroyRequested && !exit_) {
android_poll_source *source = nullptr;
int events = 0;
int pollTimeout = running_ ? 0 : 100;
for (int eventCount = 0; eventCount < 32; eventCount++) {
if (ALooper_pollOnce(pollTimeout, nullptr, &events, reinterpret_cast<void **>(&source)) < 0) break;
if (source) source->process(app_, source);
if (app_->destroyRequested) break;
pollTimeout = 0;
}
receiveFrame();
pollEvents();
if (running_ && !app_->destroyRequested) frame();
}
if (exit_ && !app_->destroyRequested) ANativeActivity_finish(app_->activity);
}
void health(const char *error = "") {
int steamvrState = -1;
if (statusCallback_) {
steamvrState = env_->CallIntMethod(app_->activity->clazz, statusCallback_);
if (env_->ExceptionCheck()) { env_->ExceptionClear(); steamvrState = -1; }
}
std::string path = std::string(app_->activity->externalDataPath) + "/xr-health.json";
std::string temp = path + ".tmp";
FILE *file = std::fopen(temp.c_str(), "w");
if (!file) return;
std::fprintf(file,
"{\"frames\":%llu,\"rendered\":%llu,\"sessionState\":%d,\"headFlags\":%llu,"
"\"headPosition\":[%.6f,%.6f,%.6f],\"controllersActive\":[%s,%s],"
"\"periodNs\":%lld,\"surfaceSwapchain\":%s,\"source\":\"%s\",\"guestFrames\":%lld,\"steamvrState\":%d,"
"\"receivedFrames\":%llu,\"rejectedFrames\":%llu,\"uploadedFrames\":%llu,\"sourceFrameId\":%llu,"
"\"gpuReceivedFrames\":%llu,\"gpuDroppedFrames\":%llu,\"gpuVerifiedFrameId\":%llu,\"gpuChecksum\":%u,\"error\":\"%s\"}\n",
(unsigned long long)frames_, (unsigned long long)rendered_, state_,
(unsigned long long)head_.locationFlags,
head_.pose.position.x, head_.pose.position.y, head_.pose.position.z,
handActive_[0] ? "true" : "false", handActive_[1] ? "true" : "false",
(long long)period_, "false", "frames",
0LL, steamvrState, (unsigned long long)(receiver_.Received() + gpuFrames_.Received()),
(unsigned long long)(receiver_.Rejected() + gpuFrames_.Rejected()),
(unsigned long long)uploadedFrames_, (unsigned long long)sourceHeader_.frame_id,
(unsigned long long)gpuFrames_.Received(), (unsigned long long)gpuFrames_.Dropped(),
(unsigned long long)verifiedFrame_, gpuChecksum_, error);
std::fclose(file);
std::rename(temp.c_str(), path.c_str());
}
private:
android_app *app_;
JNIEnv *env_ = nullptr;
XrInstance instance_ = XR_NULL_HANDLE;
XrSession session_ = XR_NULL_HANDLE;
XrSystemId system_ = XR_NULL_SYSTEM_ID;
XrSpace world_ = XR_NULL_HANDLE, view_ = XR_NULL_HANDLE;
XrActionSet actions_ = XR_NULL_HANDLE;
XrAction grip_ = XR_NULL_HANDLE, trigger_ = XR_NULL_HANDLE, vibration_ = XR_NULL_HANDLE;
XrAction squeeze_ = XR_NULL_HANDLE, stick_ = XR_NULL_HANDLE, stickClick_ = XR_NULL_HANDLE;
XrAction primary_ = XR_NULL_HANDLE, secondary_ = XR_NULL_HANDLE, menu_ = XR_NULL_HANDLE;
XrAction triggerTouch_ = XR_NULL_HANDLE, stickTouch_ = XR_NULL_HANDLE, primaryTouch_ = XR_NULL_HANDLE;
XrAction secondaryTouch_ = XR_NULL_HANDLE, thumbrestTouch_ = XR_NULL_HANDLE;
DroidDeckXrHand inputs_[2]{};
PFN_xrConvertTimeToTimespecTimeKHR convertTime_ = nullptr;
bool timespecSupported_ = false;
PFN_xrPerfSettingsSetPerformanceLevelEXT setPerformance_ = nullptr;
bool performanceSupported_ = false;
XrPath hands_[2]{};
XrSpace handSpaces_[2]{};
XrSpaceLocation head_{XR_TYPE_SPACE_LOCATION};
XrSpaceLocation handLocations_[2]{{XR_TYPE_SPACE_LOCATION}, {XR_TYPE_SPACE_LOCATION}};
bool handActive_[2]{};
bool running_ = false, exit_ = false, quitRequested_ = false;
bool guestAttached_ = false, verifyPixels_ = false;
XrFrameReceiver receiver_;
QuestGpuFrames gpuFrames_;
DroidDeckXrFrameHeader sourceHeader_{};
uint64_t uploadedFrames_ = 0, verifiedFrame_ = 0;
uint32_t gpuChecksum_ = 0;
GLuint sourceTexture_ = 0, sourceProgram_ = 0;
GLuint cpuTexture_ = 0;
jmethodID frameCallback_ = nullptr;
jmethodID activeCallback_ = nullptr;
jmethodID statusCallback_ = nullptr;
DroidDeckXrTracking *tracking_ = nullptr;
DroidDeckXrHaptics *haptics_ = nullptr;
uint64_t lastPulse_[2]{};
XrSessionState state_ = XR_SESSION_STATE_UNKNOWN;
uint64_t frames_ = 0, rendered_ = 0;
XrDuration period_ = 0;
EGLDisplay display_ = EGL_NO_DISPLAY;
EGLContext context_ = EGL_NO_CONTEXT;
EGLSurface surface_ = EGL_NO_SURFACE;
std::array<Eye, 2> eyes_;
GLuint framebuffer_ = 0, vertexArray_ = 0;
GLint sourceEncoding_ = 0, eyeEncoding_ = 0;
std::string captureRequest() {
if (frames_ % 9) return {};
std::string file = std::string(app_->activity->externalDataPath) + "/xr-capture.request";
FILE *request = std::fopen(file.c_str(), "r");
if (!request) return {};
char token[34]{};
size_t size = std::fread(token, 1, sizeof(token) - 1, request);
std::fclose(request);
unlink(file.c_str());
if (size != 32 || std::strspn(token, "0123456789abcdef") != 32) return {};
unlink((std::string(app_->activity->externalDataPath) + "/xr-capture.json").c_str());
return token;
}
bool captureTexture(GLuint texture, int width, int height, const char *name) {
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
GLint encoding = 0;
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &encoding);
if (!std::strcmp(name, "source")) sourceEncoding_ = encoding;
else eyeEncoding_ = encoding;
std::vector<unsigned char> pixels((size_t)width * height * 4);
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels.data());
bool ok = glGetError() == GL_NO_ERROR;
glBindFramebuffer(GL_FRAMEBUFFER, 0);
if (!ok) return false;
std::string file = std::string(app_->activity->externalDataPath) +
"/xr-capture-" + name + ".ppm";
std::string temporary = file + ".tmp";
FILE *output = std::fopen(temporary.c_str(), "wb");
if (!output) return false;
ok = std::fprintf(output, "P6\n%d %d\n255\n", width, height) > 0;
std::vector<unsigned char> row((size_t)width * 3);
for (int y = height - 1; y >= 0 && ok; y--) {
for (int x = 0; x < width; x++)
std::memcpy(row.data() + x * 3, pixels.data() + ((size_t)y * width + x) * 4, 3);
ok = std::fwrite(row.data(), 1, row.size(), output) == row.size();
}
if (std::fclose(output) != 0) ok = false;
if (!ok) { unlink(temporary.c_str()); return false; }
return std::rename(temporary.c_str(), file.c_str()) == 0;
}
void captureResult(const std::string &token, bool ok, bool valid,
const XrCompositionLayerProjectionView (&views)[2], XrTime displayTime) {
std::string file = std::string(app_->activity->externalDataPath) + "/xr-capture.json";
std::string temporary = file + ".tmp";
FILE *output = std::fopen(temporary.c_str(), "w");
if (!output) return;
std::fprintf(output, "{\"id\":\"%s\",\"ok\":%s,\"validLayer\":%s,\"frame\":%llu,"
"\"sourceFrameId\":%llu,\"displayTime\":%lld,\"sessionState\":%d,\"eyes\":[",
token.c_str(), ok ? "true" : "false", valid ? "true" : "false",
(unsigned long long)frames_, (unsigned long long)sourceHeader_.frame_id, (long long)displayTime, state_);
for (int eye = 0; eye < 2; eye++) {
const auto &pose = views[eye].pose;
const auto &fov = views[eye].fov;
std::fprintf(output, "%s{\"width\":%d,\"height\":%d,\"position\":[%g,%g,%g],"
"\"orientation\":[%g,%g,%g,%g],\"fov\":[%g,%g,%g,%g]}",
eye ? "," : "", eyes_[eye].width, eyes_[eye].height,
pose.position.x, pose.position.y, pose.position.z,
pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w,
fov.angleLeft, fov.angleRight, fov.angleUp, fov.angleDown);
}
const char *extensions = reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS));
const bool srgbControl = extensions && std::strstr(extensions, "GL_EXT_sRGB_write_control");
std::fprintf(output, "],\"sourceImage\":true,\"sourceColorSpace\":\"%s\",\"sourceEncoding\":%d,\"eyeEncoding\":%d,"
"\"srgbWriteControl\":%s,\"srgbWriteEnabled\":%s}\n",
sourceHeader_.color_space == DROIDDECK_XR_COLOR_SRGB_RGBA8 ? "srgb" : "linear", sourceEncoding_, eyeEncoding_,
srgbControl ? "true" : "false", srgbControl && glIsEnabled(0x8DB9) ? "true" : "false");
if (std::fclose(output) == 0) std::rename(temporary.c_str(), file.c_str());
}
XrPath path(const char *text) {
XrPath result{};
check(xrStringToPath(instance_, text, &result), "xrStringToPath");
return result;
}
void initialize() {
app_->userData = this;
app_->onInputEvent = [](android_app *app, AInputEvent *event) -> int32_t {
if (AInputEvent_getType(event) != AINPUT_EVENT_TYPE_KEY || AKeyEvent_getKeyCode(event) != AKEYCODE_BACK
|| AKeyEvent_getAction(event) != AKEY_EVENT_ACTION_UP) return 0;
auto *runtime = static_cast<QuestXR *>(app->userData);
if (runtime->running_) {
XrResult result = xrRequestExitSession(runtime->session_);
if (XR_SUCCEEDED(result)) runtime->quitRequested_ = true;
else __android_log_print(ANDROID_LOG_ERROR, "DroidDeckXR", "exit request failed: %d", result);
} else ANativeActivity_finish(app->activity);
return 1;
};
app_->activity->vm->AttachCurrentThread(&env_, nullptr);
jclass activityClass = env_->GetObjectClass(app_->activity->clazz);
jmethodID getIntent = env_->GetMethodID(activityClass, "getIntent", "()Landroid/content/Intent;");
jobject intent = env_->CallObjectMethod(app_->activity->clazz, getIntent);
jclass intentClass = env_->GetObjectClass(intent);
jmethodID getBoolean = env_->GetMethodID(intentClass, "getBooleanExtra", "(Ljava/lang/String;Z)Z");
jstring extra = env_->NewStringUTF("frame_verify");
verifyPixels_ = env_->CallBooleanMethod(intent, getBoolean, extra, JNI_FALSE);
env_->DeleteLocalRef(extra);
activeCallback_ = env_->GetMethodID(activityClass, "onXrActive", "(Z)V");
frameCallback_ = env_->GetMethodID(activityClass, "onXrFrame", "(J)V");
statusCallback_ = env_->GetMethodID(activityClass, "onXrStatus", "()I");
if (env_->ExceptionCheck()) { env_->ExceptionClear(); throw std::runtime_error("XR activity bridge methods unavailable"); }
env_->DeleteLocalRef(intentClass); env_->DeleteLocalRef(intent); env_->DeleteLocalRef(activityClass);
PFN_xrInitializeLoaderKHR initializeLoader = nullptr;
check(xrGetInstanceProcAddr(XR_NULL_HANDLE, "xrInitializeLoaderKHR",
reinterpret_cast<PFN_xrVoidFunction *>(&initializeLoader)), "loader init entrypoint");
XrLoaderInitInfoAndroidKHR loader{XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR};
loader.applicationVM = app_->activity->vm;
loader.applicationContext = app_->activity->clazz;
check(initializeLoader(reinterpret_cast<XrLoaderInitInfoBaseHeaderKHR *>(&loader)), "xrInitializeLoaderKHR");
uint32_t count = 0;
check(xrEnumerateInstanceExtensionProperties(nullptr, 0, &count, nullptr), "extensions count");
std::vector<XrExtensionProperties> extensions(count, {XR_TYPE_EXTENSION_PROPERTIES});
check(xrEnumerateInstanceExtensionProperties(nullptr, count, &count, extensions.data()), "extensions");
for (const auto &extension : extensions) {
if (!std::strcmp(extension.extensionName, XR_KHR_CONVERT_TIMESPEC_TIME_EXTENSION_NAME))
timespecSupported_ = true;
if (!std::strcmp(extension.extensionName, XR_EXT_PERFORMANCE_SETTINGS_EXTENSION_NAME))
performanceSupported_ = true;
}
std::vector<const char *> enabled{XR_KHR_ANDROID_CREATE_INSTANCE_EXTENSION_NAME, XR_KHR_OPENGL_ES_ENABLE_EXTENSION_NAME};
if (timespecSupported_) enabled.push_back(XR_KHR_CONVERT_TIMESPEC_TIME_EXTENSION_NAME);
if (performanceSupported_) enabled.push_back(XR_EXT_PERFORMANCE_SETTINGS_EXTENSION_NAME);
XrInstanceCreateInfoAndroidKHR androidInfo{XR_TYPE_INSTANCE_CREATE_INFO_ANDROID_KHR};
androidInfo.applicationVM = app_->activity->vm;
androidInfo.applicationActivity = app_->activity->clazz;
XrInstanceCreateInfo create{XR_TYPE_INSTANCE_CREATE_INFO};
create.next = &androidInfo;
std::strcpy(create.applicationInfo.applicationName, "DroidDeck XR");
create.applicationInfo.applicationVersion = 1;
create.applicationInfo.apiVersion = XR_MAKE_VERSION(1, 0, 0);
create.enabledExtensionCount = enabled.size();
create.enabledExtensionNames = enabled.data();
check(xrCreateInstance(&create, &instance_), "xrCreateInstance");
if (performanceSupported_) {
XrResult result = xrGetInstanceProcAddr(instance_, "xrPerfSettingsSetPerformanceLevelEXT",
reinterpret_cast<PFN_xrVoidFunction *>(&setPerformance_));
if (XR_FAILED(result)) setPerformance_ = nullptr;
}
if (timespecSupported_) check(xrGetInstanceProcAddr(instance_, "xrConvertTimeToTimespecTimeKHR",
reinterpret_cast<PFN_xrVoidFunction *>(&convertTime_)), "time conversion entrypoint");
XrSystemGetInfo systemInfo{XR_TYPE_SYSTEM_GET_INFO};
systemInfo.formFactor = XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY;
check(xrGetSystem(instance_, &systemInfo, &system_), "xrGetSystem");
PFN_xrGetOpenGLESGraphicsRequirementsKHR requirementsFunction = nullptr;
check(xrGetInstanceProcAddr(instance_, "xrGetOpenGLESGraphicsRequirementsKHR",
reinterpret_cast<PFN_xrVoidFunction *>(&requirementsFunction)), "GLES requirements entrypoint");
XrGraphicsRequirementsOpenGLESKHR requirements{XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_ES_KHR};
check(requirementsFunction(instance_, system_, &requirements), "GLES requirements");
if (requirements.minApiVersionSupported > XR_MAKE_VERSION(3, 0, 0)
|| requirements.maxApiVersionSupported < XR_MAKE_VERSION(3, 0, 0))
throw std::runtime_error("Runtime does not support GLES 3.0");
display_ = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (!eglInitialize(display_, nullptr, nullptr)) throw std::runtime_error("eglInitialize failed");
const EGLint attributes[] = {EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT, EGL_SURFACE_TYPE, EGL_PBUFFER_BIT | EGL_WINDOW_BIT,
EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_DEPTH_SIZE, 24, EGL_NONE};
EGLConfig config{};
EGLint found = 0;
if (!eglChooseConfig(display_, attributes, &config, 1, &found) || found != 1)
throw std::runtime_error("EGL config unavailable");
const EGLint contextAttributes[] = {EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE};
context_ = eglCreateContext(display_, config, EGL_NO_CONTEXT, contextAttributes);
const EGLint surfaceAttributes[] = {EGL_WIDTH, 16, EGL_HEIGHT, 16, EGL_NONE};
surface_ = eglCreatePbufferSurface(display_, config, surfaceAttributes);
if (!eglMakeCurrent(display_, surface_, surface_, context_)) throw std::runtime_error("eglMakeCurrent failed");
XrGraphicsBindingOpenGLESAndroidKHR binding{XR_TYPE_GRAPHICS_BINDING_OPENGL_ES_ANDROID_KHR};
binding.display = display_; binding.config = config; binding.context = context_;
XrSessionCreateInfo sessionInfo{XR_TYPE_SESSION_CREATE_INFO};
sessionInfo.next = &binding; sessionInfo.systemId = system_;
check(xrCreateSession(instance_, &sessionInfo, &session_), "xrCreateSession");
XrReferenceSpaceCreateInfo reference{XR_TYPE_REFERENCE_SPACE_CREATE_INFO};
reference.poseInReferenceSpace.orientation.w = 1;
reference.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_STAGE;
XrResult referenceResult = xrCreateReferenceSpace(session_, &reference, &world_);
if (referenceResult == XR_ERROR_REFERENCE_SPACE_UNSUPPORTED) {
reference.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_LOCAL;
reference.poseInReferenceSpace.position.y = -1.6f;
check(xrCreateReferenceSpace(session_, &reference, &world_), "local standing space");
} else check(referenceResult, "stage space");
reference.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_VIEW;
reference.poseInReferenceSpace.position.y = 0;
check(xrCreateReferenceSpace(session_, &reference, &view_), "view space");
initializeActions();
initializeImages();
initializeGraphics();
initializeTracking();
{
std::string filename = std::string(app_->activity->internalDataPath) + "/.wayland-rt/" DROIDDECK_XR_FRAME_SOCKET;
if (!receiver_.Start(filename)) throw std::runtime_error("XR frame receiver unavailable");
bool gpu = !verifyPixels_ && gpuFrames_.Start(std::string(app_->activity->internalDataPath) + "/.wayland-rt/" DROIDDECK_XR_GPU_SOCKET, display_);
__android_log_print(ANDROID_LOG_INFO, "DroidDeckXR", "GPU frame channel available=%d", gpu);
}
health();
}
void initializeActions() {
hands_[0] = path("/user/hand/left"); hands_[1] = path("/user/hand/right");
XrActionSetCreateInfo setInfo{XR_TYPE_ACTION_SET_CREATE_INFO};
std::strcpy(setInfo.actionSetName, "quest"); std::strcpy(setInfo.localizedActionSetName, "Quest controllers");
check(xrCreateActionSet(instance_, &setInfo, &actions_), "action set");
auto action = [&](const char *name, XrActionType type, XrAction *handle) {
XrActionCreateInfo info{XR_TYPE_ACTION_CREATE_INFO};
std::strcpy(info.actionName, name); std::strcpy(info.localizedActionName, name);
info.actionType = type; info.countSubactionPaths = 2; info.subactionPaths = hands_;
check(xrCreateAction(actions_, &info, handle), "create action");
};
action("grip_pose", XR_ACTION_TYPE_POSE_INPUT, &grip_);
action("trigger", XR_ACTION_TYPE_FLOAT_INPUT, &trigger_);
action("squeeze", XR_ACTION_TYPE_FLOAT_INPUT, &squeeze_);
action("stick", XR_ACTION_TYPE_VECTOR2F_INPUT, &stick_);
action("stick_click", XR_ACTION_TYPE_BOOLEAN_INPUT, &stickClick_);
action("primary", XR_ACTION_TYPE_BOOLEAN_INPUT, &primary_);
action("secondary", XR_ACTION_TYPE_BOOLEAN_INPUT, &secondary_);
action("menu", XR_ACTION_TYPE_BOOLEAN_INPUT, &menu_);
action("trigger_touch", XR_ACTION_TYPE_BOOLEAN_INPUT, &triggerTouch_);
action("stick_touch", XR_ACTION_TYPE_BOOLEAN_INPUT, &stickTouch_);
action("primary_touch", XR_ACTION_TYPE_BOOLEAN_INPUT, &primaryTouch_);
action("secondary_touch", XR_ACTION_TYPE_BOOLEAN_INPUT, &secondaryTouch_);
action("thumbrest_touch", XR_ACTION_TYPE_BOOLEAN_INPUT, &thumbrestTouch_);
action("vibration", XR_ACTION_TYPE_VIBRATION_OUTPUT, &vibration_);
std::vector<XrActionSuggestedBinding> bindings;
for (const char *hand : {"left", "right"}) {
std::string root = std::string("/user/hand/") + hand;
bindings.push_back({grip_, path((root + "/input/grip/pose").c_str())});
bindings.push_back({trigger_, path((root + "/input/trigger/value").c_str())});
bindings.push_back({triggerTouch_, path((root + "/input/trigger/touch").c_str())});
bindings.push_back({squeeze_, path((root + "/input/squeeze/value").c_str())});
bindings.push_back({stick_, path((root + "/input/thumbstick").c_str())});
bindings.push_back({stickClick_, path((root + "/input/thumbstick/click").c_str())});
bindings.push_back({stickTouch_, path((root + "/input/thumbstick/touch").c_str())});
bindings.push_back({thumbrestTouch_, path((root + "/input/thumbrest/touch").c_str())});
bindings.push_back({primary_, path((root + (std::strcmp(hand, "left") == 0 ? "/input/x/click" : "/input/a/click")).c_str())});
bindings.push_back({secondary_, path((root + (std::strcmp(hand, "left") == 0 ? "/input/y/click" : "/input/b/click")).c_str())});
bindings.push_back({primaryTouch_, path((root + (std::strcmp(hand, "left") == 0 ? "/input/x/touch" : "/input/a/touch")).c_str())});
bindings.push_back({secondaryTouch_, path((root + (std::strcmp(hand, "left") == 0 ? "/input/y/touch" : "/input/b/touch")).c_str())});
bindings.push_back({vibration_, path((root + "/output/haptic").c_str())});
}
bindings.push_back({menu_, path("/user/hand/left/input/menu/click")});
XrInteractionProfileSuggestedBinding suggestion{XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING};
suggestion.interactionProfile = path("/interaction_profiles/oculus/touch_controller");
suggestion.countSuggestedBindings = bindings.size(); suggestion.suggestedBindings = bindings.data();
check(xrSuggestInteractionProfileBindings(instance_, &suggestion), "Touch bindings");
XrSessionActionSetsAttachInfo attach{XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO};
attach.countActionSets = 1; attach.actionSets = &actions_;
check(xrAttachSessionActionSets(session_, &attach), "attach actions");
for (int hand = 0; hand < 2; hand++) {
XrActionSpaceCreateInfo space{XR_TYPE_ACTION_SPACE_CREATE_INFO};
space.action = grip_; space.subactionPath = hands_[hand]; space.poseInActionSpace.orientation.w = 1;
check(xrCreateActionSpace(session_, &space, &handSpaces_[hand]), "controller space");
}
}
void initializeImages() {
uint32_t count = 0;
check(xrEnumerateViewConfigurationViews(instance_, system_, XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO,
0, &count, nullptr), "view count");
if (count != 2) throw std::runtime_error("Expected two stereo views");
std::vector<XrViewConfigurationView> views(count, {XR_TYPE_VIEW_CONFIGURATION_VIEW});
check(xrEnumerateViewConfigurationViews(instance_, system_, XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO,
count, &count, views.data()), "view configuration");
check(xrEnumerateSwapchainFormats(session_, 0, &count, nullptr), "format count");
std::vector<int64_t> formats(count);
check(xrEnumerateSwapchainFormats(session_, count, &count, formats.data()), "formats");
int64_t format = 0;
for (int64_t candidate : formats) if (candidate == GL_SRGB8_ALPHA8) format = candidate;
if (!format) throw std::runtime_error("sRGB swapchain unavailable");
for (int eye = 0; eye < 2; eye++) {
Eye &target = eyes_[eye];
target.width = views[eye].recommendedImageRectWidth;
target.height = views[eye].recommendedImageRectHeight;
XrSwapchainCreateInfo create{XR_TYPE_SWAPCHAIN_CREATE_INFO};
create.usageFlags = XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT;
create.format = format; create.sampleCount = 1;
create.width = target.width; create.height = target.height;
create.faceCount = 1; create.arraySize = 1; create.mipCount = 1;
check(xrCreateSwapchain(session_, &create, &target.swapchain), "swapchain");
check(xrEnumerateSwapchainImages(target.swapchain, 0, &count, nullptr), "image count");
target.images.resize(count, {XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_ES_KHR});
check(xrEnumerateSwapchainImages(target.swapchain, count, &count,
reinterpret_cast<XrSwapchainImageBaseHeader *>(target.images.data())), "images");
}
}
void initializeTracking() {
std::string directory = std::string(app_->activity->internalDataPath) + "/.wayland-rt";
if (mkdir(directory.c_str(), 0700) != 0 && errno != EEXIST)
throw std::runtime_error("XR tracking directory unavailable");
auto mapFile = [&](const char *name, size_t size) {
std::string filename = directory + "/" + name;
int descriptor = open(filename.c_str(), O_CREAT | O_RDWR | O_CLOEXEC, 0600);
if (descriptor < 0) throw std::runtime_error("XR IPC file unavailable");
if (ftruncate(descriptor, size) != 0) {
close(descriptor); throw std::runtime_error("XR IPC file size failed");
}
void *mapping = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, descriptor, 0);
close(descriptor);
if (mapping == MAP_FAILED) throw std::runtime_error("XR IPC map failed");
return mapping;
};
tracking_ = static_cast<DroidDeckXrTracking *>(mapFile(DROIDDECK_XR_FILE, sizeof(DroidDeckXrTracking)));
haptics_ = static_cast<DroidDeckXrHaptics *>(mapFile(DROIDDECK_XR_HAPTIC_FILE, sizeof(DroidDeckXrHaptics)));
haptics_->magic = DROIDDECK_XR_HAPTIC_MAGIC; haptics_->version = DROIDDECK_XR_VERSION;
for (int hand = 0; hand < 2; hand++) lastPulse_[hand] = haptics_->hands[hand].id;
}
static DroidDeckXrPose posePacket(const XrPosef &pose, XrSpaceLocationFlags flags) {
return {{pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w},
{pose.position.x, pose.position.y, pose.position.z}, (uint32_t)flags};
}
void publishTracking(const XrView views[2], XrTime predicted) {
if (!tracking_) return;
timespec now{}; clock_gettime(CLOCK_MONOTONIC, &now);
DroidDeckXrTracking packet{};
packet.magic = DROIDDECK_XR_MAGIC; packet.version = DROIDDECK_XR_VERSION;
packet.active = state_ == XR_SESSION_STATE_VISIBLE || state_ == XR_SESSION_STATE_FOCUSED;
packet.sampled_ns = (int64_t)now.tv_sec * 1000000000LL + now.tv_nsec;
if (convertTime_) {
timespec displayTime{};
check(convertTime_(instance_, predicted, &displayTime), "display time conversion");
packet.predicted_ns = (int64_t)displayTime.tv_sec * 1000000000LL + displayTime.tv_nsec;
}
packet.period_ns = period_;
packet.head = posePacket(head_.pose, head_.locationFlags);
for (int eye = 0; eye < 2; eye++) {
packet.eyes[eye].pose = posePacket(views[eye].pose, head_.locationFlags);
packet.eyes[eye].fov[0] = views[eye].fov.angleLeft;
packet.eyes[eye].fov[1] = views[eye].fov.angleRight;
packet.eyes[eye].fov[2] = views[eye].fov.angleUp;
packet.eyes[eye].fov[3] = views[eye].fov.angleDown;
packet.eyes[eye].width = eyes_[eye].width; packet.eyes[eye].height = eyes_[eye].height;
packet.hands[eye] = inputs_[eye];
packet.hands[eye].pose = posePacket(handLocations_[eye].pose, handLocations_[eye].locationFlags);
packet.hands[eye].active = handActive_[eye];
}
uint32_t sequence = __atomic_load_n(&tracking_->seq, __ATOMIC_RELAXED);
__atomic_store_n(&tracking_->seq, sequence | 1u, __ATOMIC_SEQ_CST);
__atomic_thread_fence(__ATOMIC_SEQ_CST);
std::memcpy(tracking_, &packet, offsetof(DroidDeckXrTracking, seq));
std::memcpy(reinterpret_cast<char *>(tracking_) + offsetof(DroidDeckXrTracking, active),
reinterpret_cast<const char *>(&packet) + offsetof(DroidDeckXrTracking, active),
sizeof(packet) - offsetof(DroidDeckXrTracking, active));
__atomic_store_n(&tracking_->seq, (sequence | 1u) + 1u, __ATOMIC_RELEASE);
}
void attachGuest(bool attach) {
if (attach == guestAttached_) return;
env_->CallVoidMethod(app_->activity->clazz, activeCallback_, static_cast<jboolean>(attach));
if (env_->ExceptionCheck()) {
env_->ExceptionDescribe(); env_->ExceptionClear(); throw std::runtime_error("Guest XR handshake failed");
}
guestAttached_ = attach;
}
void pollHaptics() {
if (!haptics_) return;
DroidDeckXrHaptics packet{};
uint32_t sequence = __atomic_load_n(&haptics_->seq, __ATOMIC_ACQUIRE);
if (sequence & 1u) return;
std::memcpy(&packet, haptics_, sizeof(packet));
__atomic_thread_fence(__ATOMIC_ACQUIRE);
if (__atomic_load_n(&haptics_->seq, __ATOMIC_RELAXED) != sequence
|| packet.magic != DROIDDECK_XR_HAPTIC_MAGIC || packet.version != DROIDDECK_XR_VERSION) return;
for (int hand = 0; hand < 2; hand++) {
const auto &pulse = packet.hands[hand];
if (pulse.id == lastPulse_[hand]) continue;
lastPulse_[hand] = pulse.id;
if (state_ != XR_SESSION_STATE_FOCUSED || !handActive_[hand]
|| pulse.duration_ns < 1000000 || pulse.duration_ns > 1000000000
|| !std::isfinite(pulse.amplitude) || pulse.amplitude < 0 || pulse.amplitude > 1
|| !std::isfinite(pulse.frequency) || pulse.frequency < 0) continue;
XrHapticActionInfo info{XR_TYPE_HAPTIC_ACTION_INFO}; info.action = vibration_; info.subactionPath = hands_[hand];
XrHapticVibration vibration{XR_TYPE_HAPTIC_VIBRATION};
vibration.duration = pulse.duration_ns; vibration.amplitude = pulse.amplitude; vibration.frequency = pulse.frequency;
check(xrApplyHapticFeedback(session_, &info, reinterpret_cast<XrHapticBaseHeader *>(&vibration)), "guest haptics");
}
}
GLuint shader(GLenum type, const char *text) {
GLuint handle = glCreateShader(type);
glShaderSource(handle, 1, &text, nullptr); glCompileShader(handle);
GLint success = 0; glGetShaderiv(handle, GL_COMPILE_STATUS, &success);
if (!success) { glDeleteShader(handle); throw std::runtime_error("Shader compile failed"); }
return handle;
}
void initializeGraphics() {
glGenFramebuffers(1, &framebuffer_);
glGenVertexArrays(1, &vertexArray_);
GLuint vertex = shader(GL_VERTEX_SHADER,
"#version 300 es\nout vec2 uv; uniform float eye; void main(){vec2 coordinate=vec2(float((gl_VertexID<<1)&2),float(gl_VertexID&2));uv=vec2(coordinate.x*0.5+eye*0.5,1.0-coordinate.y);gl_Position=vec4(coordinate*2.0-1.0,0.0,1.0);}");
GLuint fragment = shader(GL_FRAGMENT_SHADER,
"#version 300 es\nprecision highp float; in vec2 uv; uniform sampler2D source; uniform float eye; out vec4 outputColor; void main(){float edge=0.5/float(textureSize(source,0).x);vec2 coordinate=vec2(clamp(uv.x,eye*0.5+edge,(eye+1.0)*0.5-edge),uv.y);outputColor=texture(source,coordinate);}");
sourceProgram_ = glCreateProgram(); glAttachShader(sourceProgram_, vertex); glAttachShader(sourceProgram_, fragment);
glLinkProgram(sourceProgram_); glDeleteShader(vertex); glDeleteShader(fragment);
GLint linked = 0; glGetProgramiv(sourceProgram_, GL_LINK_STATUS, &linked);
if (!linked) throw std::runtime_error("Frame shader link failed");
glGenTextures(1, &sourceTexture_); glBindTexture(GL_TEXTURE_2D, sourceTexture_);
cpuTexture_ = sourceTexture_;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
void receiveFrame() {
if (gpuFrames_.Take(sourceHeader_, sourceTexture_)) {
uploadedFrames_++;
if (uploadedFrames_ % 72 == 1) health();
return;
}
DroidDeckXrPixels frame;
if (!receiver_.Take(&frame)) return;
GLint maximum = 0; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maximum);
if (frame.header.width > static_cast<uint32_t>(maximum) || frame.header.height > static_cast<uint32_t>(maximum))
throw std::runtime_error("XR source exceeds GPU texture limit");
sourceTexture_ = cpuTexture_;
glBindTexture(GL_TEXTURE_2D, sourceTexture_);
GLenum encoding = frame.header.color_space == DROIDDECK_XR_COLOR_SRGB_RGBA8 ? GL_SRGB8_ALPHA8 : GL_RGBA8;
glTexImage2D(GL_TEXTURE_2D, 0, encoding, frame.header.width, frame.header.height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, frame.pixels.data());
if (verifyPixels_) {
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, sourceTexture_, 0);
if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
throw std::runtime_error("Frame readback framebuffer incomplete");
std::vector<unsigned char> readback(frame.header.bytes);
glReadPixels(0, 0, frame.header.width, frame.header.height, GL_RGBA, GL_UNSIGNED_BYTE, readback.data());
if (readback != frame.pixels) throw std::runtime_error("Frame GPU readback does not match owned pixels");
gpuChecksum_ = 2166136261u;
for (unsigned char value : readback) gpuChecksum_ = (gpuChecksum_ ^ value) * 16777619u;
verifiedFrame_ = frame.header.frame_id;
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
if (glGetError() != GL_NO_ERROR) throw std::runtime_error("Frame texture upload failed");
sourceHeader_ = frame.header;
receiver_.Recycle(std::move(frame.pixels));
uploadedFrames_++;
if (verifyPixels_ || uploadedFrames_ % 72 == 1) health();
}
void render(Eye &eye, uint32_t image) {
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, eye.images[image].image, 0);
if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
throw std::runtime_error("Incomplete eye framebuffer");
{
glViewport(0, 0, eye.width, eye.height); glDisable(GL_DEPTH_TEST);
glUseProgram(sourceProgram_); glBindVertexArray(vertexArray_);
glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, sourceTexture_);
glUniform1i(glGetUniformLocation(sourceProgram_, "source"), 0);
glUniform1f(glGetUniformLocation(sourceProgram_, "eye"), &eye == &eyes_[1] ? 1.f : 0.f);
glDrawArrays(GL_TRIANGLES, 0, 3);
}
glBindFramebuffer(GL_FRAMEBUFFER, 0);
if (glGetError() != GL_NO_ERROR) throw std::runtime_error("OpenGL render error");
glFlush();
}
void pollEvents() {
XrEventDataBuffer event{XR_TYPE_EVENT_DATA_BUFFER};
XrResult result;
while ((result = xrPollEvent(instance_, &event)) == XR_SUCCESS) {
if (event.type == XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED) {
state_ = reinterpret_cast<XrEventDataSessionStateChanged *>(&event)->state;
__android_log_print(ANDROID_LOG_INFO, "DroidDeckXR", "session state=%d", state_);
attachGuest(state_ == XR_SESSION_STATE_VISIBLE || state_ == XR_SESSION_STATE_FOCUSED);
if (state_ == XR_SESSION_STATE_READY) {
XrSessionBeginInfo begin{XR_TYPE_SESSION_BEGIN_INFO};
begin.primaryViewConfigurationType = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO;
check(xrBeginSession(session_, &begin), "xrBeginSession"); running_ = true;
if (setPerformance_) {
for (auto domain : {XR_PERF_SETTINGS_DOMAIN_CPU_EXT, XR_PERF_SETTINGS_DOMAIN_GPU_EXT}) {
XrResult request = setPerformance_(session_, domain, XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT);
__android_log_print(ANDROID_LOG_INFO, "DroidDeckXR", "sustained performance domain=%d result=%d", domain, request);
}
}
} else if (state_ == XR_SESSION_STATE_STOPPING) {
check(xrEndSession(session_), "xrEndSession"); running_ = false;
if (quitRequested_) exit_ = true;
} else if (state_ == XR_SESSION_STATE_EXITING || state_ == XR_SESSION_STATE_LOSS_PENDING) exit_ = true;
health();
} else if (event.type == XR_TYPE_EVENT_DATA_INSTANCE_LOSS_PENDING) exit_ = true;
else if (event.type == XR_TYPE_EVENT_DATA_PERF_SETTINGS_EXT) {
const auto &performance = *reinterpret_cast<XrEventDataPerfSettingsEXT *>(&event);
__android_log_print(ANDROID_LOG_INFO, "DroidDeckXR", "performance domain=%d subdomain=%d level=%d->%d",
performance.domain, performance.subDomain, performance.fromLevel, performance.toLevel);
}
event = {XR_TYPE_EVENT_DATA_BUFFER};
}
check(result, "xrPollEvent");
}
void frame() {
XrFrameWaitInfo wait{XR_TYPE_FRAME_WAIT_INFO};
XrFrameState frameState{XR_TYPE_FRAME_STATE};
check(xrWaitFrame(session_, &wait, &frameState), "xrWaitFrame");
period_ = frameState.predictedDisplayPeriod;
XrFrameBeginInfo begin{XR_TYPE_FRAME_BEGIN_INFO}; check(xrBeginFrame(session_, &begin), "xrBeginFrame");
check(xrLocateSpace(view_, world_, frameState.predictedDisplayTime, &head_), "head pose");
if (state_ == XR_SESSION_STATE_FOCUSED) {
XrActiveActionSet active{actions_, XR_NULL_PATH};
XrActionsSyncInfo sync{XR_TYPE_ACTIONS_SYNC_INFO}; sync.countActiveActionSets = 1; sync.activeActionSets = &active;
check(xrSyncActions(session_, &sync), "xrSyncActions");
for (int hand = 0; hand < 2; hand++) {
XrActionStateGetInfo get{XR_TYPE_ACTION_STATE_GET_INFO}; get.action = grip_; get.subactionPath = hands_[hand];
XrActionStatePose pose{XR_TYPE_ACTION_STATE_POSE}; check(xrGetActionStatePose(session_, &get, &pose), "grip state");
handActive_[hand] = pose.isActive;
check(xrLocateSpace(handSpaces_[hand], world_, frameState.predictedDisplayTime, &handLocations_[hand]), "hand pose");
get.action = trigger_;
XrActionStateFloat trigger{XR_TYPE_ACTION_STATE_FLOAT}; check(xrGetActionStateFloat(session_, &get, &trigger), "trigger state");
inputs_[hand].trigger = trigger.isActive ? trigger.currentState : 0;
get.action = squeeze_;
XrActionStateFloat squeeze{XR_TYPE_ACTION_STATE_FLOAT}; check(xrGetActionStateFloat(session_, &get, &squeeze), "squeeze state");
inputs_[hand].squeeze = squeeze.isActive ? squeeze.currentState : 0;
get.action = stick_;
XrActionStateVector2f stick{XR_TYPE_ACTION_STATE_VECTOR2F}; check(xrGetActionStateVector2f(session_, &get, &stick), "stick state");
inputs_[hand].stick[0] = stick.isActive ? stick.currentState.x : 0;
inputs_[hand].stick[1] = stick.isActive ? stick.currentState.y : 0;
inputs_[hand].buttons = 0;
const std::pair<XrAction, uint32_t> buttons[] = {
{stickClick_, DROIDDECK_XR_STICK_CLICK}, {primary_, DROIDDECK_XR_PRIMARY_CLICK},
{secondary_, DROIDDECK_XR_SECONDARY_CLICK}, {menu_, DROIDDECK_XR_MENU_CLICK},
{triggerTouch_, DROIDDECK_XR_TRIGGER_TOUCH}, {stickTouch_, DROIDDECK_XR_STICK_TOUCH},
{primaryTouch_, DROIDDECK_XR_PRIMARY_TOUCH}, {secondaryTouch_, DROIDDECK_XR_SECONDARY_TOUCH},
{thumbrestTouch_, DROIDDECK_XR_THUMBREST_TOUCH}};
for (const auto &button : buttons) {
get.action = button.first;
XrActionStateBoolean value{XR_TYPE_ACTION_STATE_BOOLEAN}; check(xrGetActionStateBoolean(session_, &get, &value), "button state");
if (value.isActive && value.currentState) inputs_[hand].buttons |= button.second;
}
}
} else handActive_[0] = handActive_[1] = false;
pollHaptics();
XrViewLocateInfo locate{XR_TYPE_VIEW_LOCATE_INFO}; locate.viewConfigurationType = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO;
locate.displayTime = frameState.predictedDisplayTime; locate.space = world_;
XrViewState viewState{XR_TYPE_VIEW_STATE}; uint32_t count = 0;
XrView views[2]{{XR_TYPE_VIEW}, {XR_TYPE_VIEW}};
check(xrLocateViews(session_, &locate, &viewState, 2, &count, views), "xrLocateViews");
publishTracking(views, frameState.predictedDisplayTime);
if (guestAttached_) {
timespec now{}; clock_gettime(CLOCK_MONOTONIC, &now);
env_->CallVoidMethod(app_->activity->clazz, frameCallback_, (jlong)now.tv_sec * 1000000000LL + now.tv_nsec);
if (env_->ExceptionCheck()) { env_->ExceptionClear(); throw std::runtime_error("Guest frame callback failed"); }
}
XrCompositionLayerProjectionView projection[2]{{XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW}, {XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW}};
bool valid = frameState.shouldRender && count == 2 &&
(viewState.viewStateFlags & (XR_VIEW_STATE_ORIENTATION_VALID_BIT | XR_VIEW_STATE_POSITION_VALID_BIT))
== (XR_VIEW_STATE_ORIENTATION_VALID_BIT | XR_VIEW_STATE_POSITION_VALID_BIT);
{
valid = valid && sourceHeader_.frame_id && xr_frame_now() - sourceHeader_.captured_ns < 500000000LL;
if (valid) for (int eye = 0; eye < 2; eye++) {
auto source = xr_frame_view(sourceHeader_, eye);
views[eye].pose.orientation = {source.orientation[0], source.orientation[1], source.orientation[2], source.orientation[3]};
views[eye].pose.position = {source.position[0], source.position[1], source.position[2]};
views[eye].fov = {source.fov[0], source.fov[1], source.fov[2], source.fov[3]};
}
}
const std::string capture = captureRequest();
bool captured = valid;
if (!capture.empty() && valid)
captured = captureTexture(sourceTexture_, sourceHeader_.width, sourceHeader_.height, "source");
if (valid) for (int eye = 0; eye < 2; eye++) {
uint32_t image = 0;
XrSwapchainImageAcquireInfo acquire{XR_TYPE_SWAPCHAIN_IMAGE_ACQUIRE_INFO};
check(xrAcquireSwapchainImage(eyes_[eye].swapchain, &acquire, &image), "acquire image");
XrSwapchainImageWaitInfo imageWait{XR_TYPE_SWAPCHAIN_IMAGE_WAIT_INFO}; imageWait.timeout = XR_INFINITE_DURATION;
check(xrWaitSwapchainImage(eyes_[eye].swapchain, &imageWait), "wait image");
render(eyes_[eye], image);
if (!capture.empty()) captured = captureTexture(eyes_[eye].images[image].image, eyes_[eye].width, eyes_[eye].height, eye ? "right" : "left") && captured;
XrSwapchainImageReleaseInfo release{XR_TYPE_SWAPCHAIN_IMAGE_RELEASE_INFO};
check(xrReleaseSwapchainImage(eyes_[eye].swapchain, &release), "release image");
projection[eye].pose = views[eye].pose; projection[eye].fov = views[eye].fov;
projection[eye].subImage.swapchain = eyes_[eye].swapchain;
projection[eye].subImage.imageRect.extent = {eyes_[eye].width, eyes_[eye].height};
}
XrCompositionLayerProjection layer{XR_TYPE_COMPOSITION_LAYER_PROJECTION};
layer.space = world_; layer.viewCount = 2; layer.views = projection;
const XrCompositionLayerBaseHeader *layers[] = {reinterpret_cast<XrCompositionLayerBaseHeader *>(&layer)};
XrFrameEndInfo end{XR_TYPE_FRAME_END_INFO}; end.displayTime = frameState.predictedDisplayTime;
end.environmentBlendMode = XR_ENVIRONMENT_BLEND_MODE_OPAQUE; end.layerCount = valid ? 1 : 0; end.layers = layers;
check(xrEndFrame(session_, &end), "xrEndFrame");
if (!capture.empty()) captureResult(capture, captured, valid, projection, frameState.predictedDisplayTime);
frames_++; if (valid) rendered_++;
if (frames_ % 72 == 0) {
health();
__android_log_print(ANDROID_LOG_INFO, "DroidDeckXR", "frames=%llu rendered=%llu head=%llu hands=%d,%d period=%lld",
(unsigned long long)frames_, (unsigned long long)rendered_, (unsigned long long)head_.locationFlags,
handActive_[0], handActive_[1], (long long)period_);
}
}
void cleanup() {
receiver_.Stop();
gpuFrames_.Stop();
try { attachGuest(false); } catch (const std::exception &error) {
__android_log_print(ANDROID_LOG_ERROR, "DroidDeckXR", "cleanup: %s", error.what());
}
if (tracking_) {
__atomic_store_n(&tracking_->active, 0u, __ATOMIC_RELEASE);
munmap(tracking_, sizeof(DroidDeckXrTracking));
}
if (haptics_) munmap(haptics_, sizeof(DroidDeckXrHaptics));
if (display_ != EGL_NO_DISPLAY && context_ != EGL_NO_CONTEXT) {
glDeleteFramebuffers(1, &framebuffer_); glDeleteVertexArrays(1, &vertexArray_);
glDeleteTextures(1, &cpuTexture_); glDeleteProgram(sourceProgram_);
}
for (auto &eye : eyes_) if (eye.swapchain) xrDestroySwapchain(eye.swapchain);
for (auto space : handSpaces_) if (space) xrDestroySpace(space);
if (view_) xrDestroySpace(view_); if (world_) xrDestroySpace(world_);
if (session_) xrDestroySession(session_);
if (actions_) xrDestroyActionSet(actions_);
if (instance_) xrDestroyInstance(instance_);
if (display_ != EGL_NO_DISPLAY) {
eglMakeCurrent(display_, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (surface_ != EGL_NO_SURFACE) eglDestroySurface(display_, surface_);
if (context_ != EGL_NO_CONTEXT) eglDestroyContext(display_, context_);
eglTerminate(display_);
}
if (env_) app_->activity->vm->DetachCurrentThread();
}
};
void android_main(android_app *app) {
QuestXR runtime(app);
try { runtime.run(); }
catch (const std::exception &error) {
__android_log_print(ANDROID_LOG_ERROR, "DroidDeckXR", "%s", error.what());
runtime.health(error.what());
ANativeActivity_finish(app->activity);
}
}
+56 -2
View File
@@ -1871,7 +1871,12 @@ static void render_scene(void) {
else if (rendered && how == 2) droiddeck_color_frame_shown(hs.color, DROIDDECK_HDR_TONEMAPPED, 0);
else if (rendered) hdr_copy = "the HDR composition pass is unavailable on this driver";
}
if (hdr_route == 0 || hdr_route == 3) {
if (hdr_route == 0 && vkp_quest_layer_presentation() && !framegen && !cardboard &&
!ahb_layer_only_candidate(w, h)) {
/* The complete SDR scene stays on one display layer. Do not hide/re-show GAME
* on each desktop frame just because it is not a single fullscreen window. */
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
} else if (hdr_route == 0 || hdr_route == 3) {
const int pass_on = fx_on || framegen;
int li = (g_zero_copy && !framegen && !cardboard) ? layer_candidate(&dl, w, h) : -1;
int over = li >= 0 ? dl.n - 1 - li : 0;
@@ -2194,6 +2199,7 @@ struct constraint {
int pending_region_set;
int hint_set, pending_hint_set;
double hint_x, hint_y, pending_hint_x, pending_hint_y;
int gave_keys;
};
static struct wl_list g_constraints;
static struct constraint *g_active_constraint;
@@ -2272,6 +2278,14 @@ static void constraint_end(struct constraint *k, int tell_client, const char *wh
g_ptr_y = oy + k->hint_y;
}
g_raw_valid = 0;
if (k->gave_keys) {
k->gave_keys = 0;
for (int i = 0; i < g_nkbs; i++) {
if (!k->surface || g_kbs[i].focus != k->surface->resource) continue;
wl_keyboard_send_leave(g_kbs[i].kb, wl_display_next_serial(g_display), g_kbs[i].focus);
g_kbs[i].focus = NULL;
}
}
if (tell_client) constraint_send_state(k, 0);
constraint_describe(k, name, sizeof(name));
droiddeck_log("pointer", "%s: %s (%s), pointer at %d,%d", k->is_lock ? "unlocked" : "unconfined",
@@ -2290,6 +2304,12 @@ static void constraint_activate(struct constraint *k) {
if (!k->is_lock) confine_clamp(k, &g_ptr_x, &g_ptr_y);
constraint_origin(k, &ox, &oy);
pointer_focus(k->surface->resource, wl_fixed_from_double(g_ptr_x - ox), wl_fixed_from_double(g_ptr_y - oy));
int focused = 0;
for (int i = 0; i < g_nkbs; i++) if (g_kbs[i].focus) focused = 1;
if (k->is_lock && !focused && keyboard_for(wl_resource_get_client(k->surface->resource))) {
keyboard_focus(k->surface->resource);
k->gave_keys = 1;
}
constraint_send_state(k, 1);
constraint_describe(k, name, sizeof(name));
if (k->is_lock)
@@ -2594,7 +2614,24 @@ static void pointer_delta(double dx, double dy) {
}
static void pointer_button(uint32_t button, int pressed) {
pointer_input(0, 0, 1, button, pressed);
if (pressed) {
pointer_input(0, 0, 1, button, pressed);
return;
}
// Releases also clean up interrupted gestures. Deliver them to the existing
// pointer focus without motion or hit-testing: native touch has independent
// coordinates, so replaying g_ptr_x/y here can warp the game cursor.
uint32_t t = now_ms();
for (int i = 0; i < g_nptrs; i++) {
struct seat_pointer *sp = &g_ptrs[i];
if (!sp->focus) continue;
wl_pointer_send_button(sp->ptr, wl_display_next_serial(g_display), t, button,
WL_POINTER_BUTTON_STATE_RELEASED);
if (wl_resource_get_version(sp->ptr) >= WL_POINTER_FRAME_SINCE_VERSION)
wl_pointer_send_frame(sp->ptr);
}
g_grab = NULL;
wl_display_flush_clients(g_display);
}
static void deliver_pointer(const struct input_msg *m) {
@@ -2901,12 +2938,26 @@ static int on_input_readable(int fd, uint32_t mask, void *data) {
case 6: pointer_delta(m.p1 / 256.0, m.p2 / 256.0); break;
case 7: deliver_touch(&m); break;
case 8: output_resized(); break;
case 9:
vk_present_set_scale_mode(m.p1, m.p2);
schedule_render();
break;
default: deliver_pointer(&m); break;
}
}
return 0;
}
void droiddeck_wayland_set_scale_mode(int mode, int alignment) {
if (g_input_pipe[1] < 0) {
vk_present_set_scale_mode(mode, alignment);
return;
}
struct input_msg m = { 9, mode, alignment, 0, 0 };
ssize_t n = write(g_input_pipe[1], &m, sizeof(m));
(void)n;
}
void droiddeck_wayland_send_pointer(int action, int x, int y) {
if (g_input_pipe[1] < 0) return;
struct input_msg m = { 0, action, x, y, 0 };
@@ -3110,6 +3161,9 @@ int droiddeck_wayland_run(void) {
open_session_log();
if (vkp_ready() != 0) WLOGE("renderer unavailable; clients will connect but nothing is drawn");
/* Presentation compatibility is not HDR capability. Set the initial layer mode before
* clients bind, including when Desktop is the first session in this app process. */
if (vkp_quest_layer_presentation() && sc_layer_available()) g_zero_copy = 1;
struct wl_display *display = wl_display_create();
if (!display) {
@@ -0,0 +1,13 @@
#ifndef DROIDDECK_QUEST_DEVICE_H
#define DROIDDECK_QUEST_DEVICE_H
#include <string.h>
#include <strings.h>
/* Presentation only; this does not select a GPU driver or expand driver support. */
static inline int quest_device_matches(const char *model, const char *device, const char *maker) {
return !strcasecmp(model, "Quest 2") || !strcasecmp(model, "Quest 3") ||
!strcasecmp(model, "Quest 3S") ||
((!strcasecmp(maker, "Oculus") || !strcasecmp(maker, "Meta")) &&
(!strcmp(device, "hollywood") || !strcmp(device, "eureka") || !strcmp(device, "panther")));
}
#endif
+51 -4
View File
@@ -185,6 +185,8 @@ static int g_pending_cb;
static unsigned g_stat_layer_frames;
static int g_two_logged;
static AHardwareBuffer *g_blank;
static ASurfaceControl *g_base_sc;
static int g_base_w, g_base_h, g_base_shown;
static void layers_init(void) {
if (g_layers_ready) return;
@@ -262,14 +264,58 @@ static AHardwareBuffer *blank_buffer(void) {
AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY};
if (AHardwareBuffer_allocate(&d, &g_blank) != 0 || !g_blank) { g_blank = NULL; return NULL; }
void *p = NULL;
if (AHardwareBuffer_lock(g_blank, AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY, -1, NULL, &p) == 0 && p) {
AHardwareBuffer_Desc got; AHardwareBuffer_describe(g_blank, &got);
memset(p, 0, (size_t)got.stride * 4 * 16);
AHardwareBuffer_unlock(g_blank, NULL);
int locked = AHardwareBuffer_lock(g_blank, AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY, -1, NULL, &p);
if (locked != 0 || !p) {
if (locked == 0) AHardwareBuffer_unlock(g_blank, NULL);
AHardwareBuffer_release(g_blank); g_blank = NULL;
return NULL;
}
AHardwareBuffer_Desc got; AHardwareBuffer_describe(g_blank, &got);
memset(p, 0, (size_t)got.stride * 4 * got.height);
if (AHardwareBuffer_unlock(g_blank, NULL) != 0) {
AHardwareBuffer_release(g_blank); g_blank = NULL;
return NULL;
}
return g_blank;
}
int sc_layer_base_black(int width, int height) {
if (width <= 0 || height <= 0 || load_api() != 0 || !vkp_window()) return -1;
if (g_base_sc && g_base_shown && width == g_base_w && height == g_base_h) return 0;
AHardwareBuffer *black = blank_buffer();
if (!black) return -1;
if (!g_base_sc) g_base_sc = api.createFromWindow(vkp_window(), "droiddeck_wayland_black");
if (!g_base_sc) return -1;
ASurfaceTransaction *tx = api.txCreate();
if (!tx) return -1;
ARect src = {0, 0, 16, 16}, dst = {0, 0, width, height};
api.setBuffer(tx, g_base_sc, black, -1);
api.setBufferTransparency(tx, g_base_sc, ASC_TRANSPARENCY_OPAQUE);
api.setZOrder(tx, g_base_sc, 0); /* GAME = 1, OVERLAY = 2 */
api.setGeometry(tx, g_base_sc, &src, &dst, 0);
api.setVisibility(tx, g_base_sc, ASC_VISIBILITY_SHOW);
api.txApply(tx); api.txDelete(tx);
g_base_w = width; g_base_h = height; g_base_shown = 1;
return 0;
}
static void base_hide(int retire) {
if (!g_base_sc) return;
ASurfaceTransaction *tx = api.txCreate();
if (tx) {
api.setVisibility(tx, g_base_sc, ASC_VISIBILITY_HIDE);
if (retire) api.reparent(tx, g_base_sc, NULL);
api.txApply(tx); api.txDelete(tx);
g_base_shown = 0;
}
if (retire) {
api.release(g_base_sc); g_base_sc = NULL;
g_base_w = g_base_h = g_base_shown = 0;
}
}
void sc_layer_hide_base(void) { base_hide(0); }
static void replace_with_blank(ASurfaceTransaction *tx, struct layer *l) {
AHardwareBuffer *b = blank_buffer();
if (b) api.setBuffer(tx, l->sc, b, -1);
@@ -927,6 +973,7 @@ void sc_layer_hide_overlay(void) {
}
void sc_layer_window_gone(void) {
base_hide(1); /* the backdrop belongs to the old window, just like GAME and OVERLAY */
if (api.state != 1) return;
layers_init();
for (int i = SC_LAYER_COUNT - 1; i >= 0; i--) retire_sc(&g_layers[i]);
@@ -36,6 +36,8 @@ int sc_layer_overlay_affordable(void);
int sc_layer_present_overlay(struct vkp_image *src, const int geo[8], int translucent);
void sc_layer_hide(void);
int sc_layer_base_black(int width, int height);
void sc_layer_hide_base(void);
void sc_layer_hide_overlay(void);
void sc_layer_window_gone(void);
+107 -7
View File
@@ -8,9 +8,11 @@
#include "hdr_compose.h"
#include "blend_pass.h"
#include "droiddeck_color.h"
#include "quest_device.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/system_properties.h>
#include <unistd.h>
#include <errno.h>
#include <poll.h>
@@ -64,6 +66,21 @@ static VkExtent2D g_extent;
static int g_first_frame_done;
static int g_base_black;
int vkp_quest_layer_presentation(void) {
/* Compositor thread only; this is a process-wide device property, not a session setting.
* Quest 2 still needs its separate A6xx driver: this gate only chooses presentation. */
static int enabled = -1;
if (enabled < 0) {
char model[PROP_VALUE_MAX] = {0}, device[PROP_VALUE_MAX] = {0}, maker[PROP_VALUE_MAX] = {0};
__system_property_get("ro.product.model", model);
__system_property_get("ro.product.device", device);
__system_property_get("ro.product.manufacturer", maker);
enabled = quest_device_matches(model, device, maker);
if (enabled) droiddeck_log("gpu", "Quest presentation: display layers for Steam and desktop, CPU-initialized black backdrop; independent of HDR");
}
return enabled;
}
static VkExtent2D g_caps_extent;
static int64_t g_surface_checked_ns;
@@ -121,6 +138,9 @@ static pthread_mutex_t g_req_lock = PTHREAD_MUTEX_INITIALIZER;
static ANativeWindow *g_req_window;
static int g_req_pending;
static int g_req_detached;
static uint64_t g_req_generation, g_req_applied;
static pthread_cond_t g_req_condition = PTHREAD_COND_INITIALIZER;
static volatile int g_mode = VKP_MODE_STRETCH, g_align = VKP_ALIGN_CENTER;
@@ -130,6 +150,9 @@ static struct {
int rx, ry, rw, rh;
int valid;
} g_map;
static pthread_mutex_t g_game_picture_lock = PTHREAD_MUTEX_INITIALIZER;
static float g_game_picture_rect[4];
static int g_game_picture_top;
static int64_t g_swap_retry_at_ns;
static int g_swap_fail_logged;
@@ -198,26 +221,53 @@ void vk_present_set_window(ANativeWindow *window) {
if (g_req_pending && g_req_window && g_req_window != window) superseded = g_req_window;
g_req_window = window;
g_req_pending = 1;
g_req_generation++;
if (!window) g_req_detached = 1;
pthread_mutex_unlock(&g_req_lock);
if (superseded) ANativeWindow_release(superseded);
}
static void window_request_applied(uint64_t generation) {
pthread_mutex_lock(&g_req_lock);
g_req_applied = generation;
pthread_cond_broadcast(&g_req_condition);
pthread_mutex_unlock(&g_req_lock);
}
int vkp_wait_window_request(int timeout_ms) {
if (timeout_ms <= 0 || timeout_ms > 10000) return 0;
struct timespec deadline;
clock_gettime(CLOCK_REALTIME, &deadline);
deadline.tv_sec += timeout_ms / 1000;
deadline.tv_nsec += (timeout_ms % 1000) * 1000000L;
if (deadline.tv_nsec >= 1000000000L) { deadline.tv_sec++; deadline.tv_nsec -= 1000000000L; }
pthread_mutex_lock(&g_req_lock);
const uint64_t generation = g_req_generation;
int error = 0;
while (g_req_applied < generation && error == 0)
error = pthread_cond_timedwait(&g_req_condition, &g_req_lock, &deadline);
int applied = g_req_applied >= generation;
pthread_mutex_unlock(&g_req_lock);
return applied;
}
int vkp_apply_window_request(void) {
ANativeWindow *w;
pthread_mutex_lock(&g_req_lock);
if (!g_req_pending) { pthread_mutex_unlock(&g_req_lock); return 0; }
w = g_req_window;
const int detached = g_req_detached;
const uint64_t generation = g_req_generation;
g_req_window = NULL;
g_req_pending = 0;
g_req_detached = 0;
pthread_mutex_unlock(&g_req_lock);
if (w == g_window) {
if (w) ANativeWindow_release(w);
if (!w || !detached) return 0;
if (!w || !detached) { window_request_applied(generation); return 0; }
sc_layer_window_gone();
destroy_swapchain();
window_request_applied(generation);
droiddeck_log("gpu", "screen surface rebound: rebuilding the swapchain at its new size");
return 1;
}
@@ -228,6 +278,7 @@ int vkp_apply_window_request(void) {
g_window = w;
g_swap_retry_at_ns = 0;
g_swap_fail_logged = 0;
window_request_applied(generation);
droiddeck_log("gpu", w ? "screen surface attached" : "screen surface gone: presenting paused");
return 1;
}
@@ -244,7 +295,7 @@ int vkp_device_lost(void) { return g_dev_state == -2; }
void vk_present_set_scale_mode(int mode, int alignment) {
if (mode < VKP_MODE_OFF || mode > VKP_MODE_INTEGER) mode = VKP_MODE_FIT;
if (alignment < VKP_ALIGN_CENTER || alignment > VKP_ALIGN_BOTTOM) alignment = VKP_ALIGN_CENTER;
if (alignment < VKP_ALIGN_CENTER || alignment > VKP_ALIGN_PICTURE_BOTTOM) alignment = VKP_ALIGN_CENTER;
g_mode = mode;
g_align = alignment;
}
@@ -263,6 +314,8 @@ static const char *align_name(int a) {
switch (a) {
case VKP_ALIGN_TOP: return "top";
case VKP_ALIGN_BOTTOM: return "bottom";
case VKP_ALIGN_PICTURE_TOP: return "picture top";
case VKP_ALIGN_PICTURE_BOTTOM: return "picture bottom";
default: return "center";
}
}
@@ -298,13 +351,30 @@ static void update_map(int scene_w, int scene_h) {
g_map.off_x = (float)(g_map.rx + (int)((g_map.rw - scene_w * aspect) * 0.5f));
g_map.off_y = (float)(g_map.ry + (int)((g_map.rh - scene_h * aspect) * 0.5f));
}
if (align == VKP_ALIGN_PICTURE_TOP) g_map.off_y = 0;
else if (align == VKP_ALIGN_PICTURE_BOTTOM) g_map.off_y = H - scene_h * g_map.ky;
g_map.valid = 1;
pthread_mutex_lock(&g_game_picture_lock);
g_game_picture_top = align == VKP_ALIGN_PICTURE_TOP || align == VKP_ALIGN_PICTURE_BOTTOM;
g_game_picture_rect[0] = g_map.off_x;
g_game_picture_rect[1] = g_map.off_y;
g_game_picture_rect[2] = g_map.off_x + scene_w * g_map.kx;
g_game_picture_rect[3] = g_map.off_y + scene_h * g_map.ky;
pthread_mutex_unlock(&g_game_picture_lock);
droiddeck_log("screen", "%s, %s: %dx%d scene shown %dx%d at %d,%d on the %dx%d output",
mode_name(mode), align_name(align), scene_w, scene_h,
(int)(scene_w * g_map.kx + 0.5f), (int)(scene_h * g_map.ky + 0.5f),
(int)g_map.off_x, (int)g_map.off_y, W, H);
}
int vkp_game_picture_rect(float rect[4]) {
pthread_mutex_lock(&g_game_picture_lock);
int active = g_game_picture_top;
if (active) memcpy(rect, g_game_picture_rect, sizeof(g_game_picture_rect));
pthread_mutex_unlock(&g_game_picture_lock);
return active;
}
int vkp_output_to_scene(double ox, double oy, double *sx, double *sy) {
if (!g_map.valid || g_map.kx <= 0 || g_map.ky <= 0) return 0;
*sx = (ox - g_map.off_x) / g_map.kx;
@@ -1313,6 +1383,10 @@ static void check_surface_changed(void) {
int vkp_base_black(int scene_w, int scene_h) {
vkp_apply_window_request();
if (vkp_quest_layer_presentation()) {
if (vkp_update_map(scene_w, scene_h) != 0) return -1;
return sc_layer_base_black((int)g_extent.width, (int)g_extent.height);
}
check_surface_changed();
if (g_base_black && g_swapchain && g_window && g_dev_state == 1) {
g_perf.base_kept++;
@@ -1391,6 +1465,7 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
const struct vkp_hdr_frame *hf, int *how) {
if (how) *how = 0;
vkp_apply_window_request();
sc_layer_hide_base();
check_surface_changed();
if (g_dev_state == -2) return -1;
if (dev_init() != 0 || !g_window || scene_w <= 0 || scene_h <= 0) return -1;
@@ -1648,6 +1723,26 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
}
int vkp_render(int scene_w, int scene_h, const struct vkp_draw *draws, int n) {
if (vkp_quest_layer_presentation() && !vkp_framegen_active() && !vkp_cardboard_active()) {
/* The desktop (multiple windows), overlays and an empty scene must also avoid WSI.
* Merely enabling zero-copy handles only a single fullscreen window and leaves both
* the letterbox and every fallback frame going through the corrupted swapchain. */
vkp_apply_window_request();
sc_layer_hide_overlay();
if (n > 0) {
if (sc_layer_present_pass(draws, n, scene_w, scene_h) != 0) {
static int said;
if (!said) { said = 1; droiddeck_log("error", "Quest scene layer unavailable; retaining the previous frame rather than using the corrupt Android swapchain"); }
return -1;
}
} else {
sc_layer_hide();
}
/* sc_layer_present_pass signals only after submitting client content.
* A backdrop alone, or a successful no-op while a layer slot is unavailable,
* must not dismiss the app's loading UI or mark Steam's window as shown. */
return vkp_base_black(scene_w, scene_h);
}
return render_impl(scene_w, scene_h, draws, n, NULL, NULL);
}
@@ -1681,6 +1776,15 @@ void vkp_signal_first_frame(void) {
int vkp_update_map(int scene_w, int scene_h) {
if (g_dev_state == -2 || dev_init() != 0 || !g_window || scene_w <= 0 || scene_h <= 0) return -1;
if (vkp_quest_layer_presentation()) {
/* Layer geometry needs the window size, not a Vulkan swapchain. In particular, do
* not create/present a swapchain just to paint black under an otherwise clean layer. */
int w = ANativeWindow_getWidth(g_window), h = ANativeWindow_getHeight(g_window);
if (w <= 0 || h <= 0) return -1;
g_extent = (VkExtent2D){(uint32_t)w, (uint32_t)h};
update_map(scene_w, scene_h);
return g_map.valid ? 0 : -1;
}
check_surface_changed();
if (!g_swapchain && swap_init() != 0) return -1;
update_map(scene_w, scene_h);
@@ -1889,11 +1993,7 @@ int vkp_pass_begin_hdr(int scene_w, int scene_h, const struct vkp_draw *draws, i
static int pass_begin_impl(int scene_w, int scene_h, const struct vkp_draw *draws, int n,
const struct vkp_hdr_frame *hf, int *rw, int *rh) {
if (g_pass.active) vkp_pass_abort();
if (g_dev_state == -2 || dev_init() != 0 || !g_window || scene_w <= 0 || scene_h <= 0) return -1;
check_surface_changed();
if (!g_swapchain && swap_init() != 0) return -1;
update_map(scene_w, scene_h);
if (!g_map.valid) return -1;
if (vkp_update_map(scene_w, scene_h) != 0) return -1;
if (hf) {
if (ensure_img(&g_hdrscene, scene_w, scene_h, HDR_FMT,
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT |
@@ -8,10 +8,13 @@ void vk_present_set_driver(const char *driver_path, const char *library_name,
void vk_present_set_window(ANativeWindow *window);
int vkp_apply_window_request(void);
int vkp_quest_layer_presentation(void);
enum vkp_scale_mode { VKP_MODE_OFF = 0, VKP_MODE_FIT = 1, VKP_MODE_STRETCH = 2, VKP_MODE_FILL = 3,
VKP_MODE_INTEGER = 4 };
enum vkp_align { VKP_ALIGN_CENTER = 0, VKP_ALIGN_TOP = 1, VKP_ALIGN_BOTTOM = 2 };
enum vkp_align { VKP_ALIGN_CENTER = 0, VKP_ALIGN_TOP = 1, VKP_ALIGN_BOTTOM = 2, VKP_ALIGN_PICTURE_TOP = 3, VKP_ALIGN_PICTURE_BOTTOM = 4 };
void vk_present_set_scale_mode(int mode, int alignment);
int vkp_game_picture_rect(float rect[4]);
int vkp_output_to_scene(double ox, double oy, double *sx, double *sy);
void vkp_output_size(int *w, int *h);
@@ -48,6 +51,7 @@ const char *vkp_gpu_name(void);
int vkp_ready(void);
int vkp_has_window(void);
int vkp_wait_window_request(int timeout_ms);
int vkp_device_lost(void);
int vkp_render(int scene_w, int scene_h, const struct vkp_draw *draws, int n);
@@ -18,6 +18,7 @@
#include "droiddeck_color.h"
extern int droiddeck_wayland_run(void);
extern void droiddeck_wayland_set_scale_mode(int mode, int alignment);
extern void droiddeck_wayland_send_pointer(int action, int x, int y);
extern void droiddeck_wayland_send_touch(int action, int pointer_id, int x, int y);
extern int droiddeck_cursor_snapshot(int *out, int cap);
@@ -354,11 +355,20 @@ Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeResizeOutput(JNIEnv
JNIEXPORT void JNICALL
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetScaleMode(JNIEnv *env, jclass clazz, jint mode, jint alignment) {
vk_present_set_scale_mode(mode, alignment);
droiddeck_wayland_set_scale_mode(mode, alignment);
__android_log_print(ANDROID_LOG_INFO, TAG, "scale mode %d alignment %d", mode, alignment);
}
JNIEXPORT jboolean JNICALL
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeGamePictureRect(JNIEnv *env, jclass clazz, jfloatArray out) {
if (!out || (*env)->GetArrayLength(env, out) < 4) return JNI_FALSE;
float rect[4];
if (!vkp_game_picture_rect(rect)) return JNI_FALSE;
(*env)->SetFloatArrayRegion(env, out, 0, 4, rect);
return JNI_TRUE;
}
JNIEXPORT void JNICALL
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetUpscaler(JNIEnv *env, jclass clazz, jint mode) {
vkp_effects_set_scaling(mode);
@@ -582,6 +592,12 @@ static char *dup_bytes(JNIEnv *env, jbyteArray arr, int *len) {
return buf;
}
JNIEXPORT jboolean JNICALL
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeWaitSurface(
JNIEnv *env, jclass clazz, jint timeout_ms) {
return vkp_wait_window_request(timeout_ms) ? JNI_TRUE : JNI_FALSE;
}
JNIEXPORT void JNICALL
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetClipboardText(JNIEnv *env, jclass clazz, jbyteArray utf8) {
int len;
@@ -20,6 +20,7 @@ import com.droiddeck.launcher.gpu.TurnipDriver
import com.droiddeck.launcher.gpu.TurnipReleases
import com.droiddeck.launcher.session.SessionService
import com.droiddeck.launcher.session.SessionPrefs
import com.droiddeck.launcher.session.QuestExperimental
import com.droiddeck.launcher.ui.DriverRow
import com.droiddeck.launcher.ui.GpuDriversState
import com.droiddeck.launcher.ui.PairRow
@@ -103,7 +104,7 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
val lm = LinuxVulkanDriverManager(activity)
val td = TurnipDriver(activity)
val pairs = DriverPairs.from(TurnipReleases.cached(activity))
val recommended = DriverPairs.recommendedKey(gpu, pairs)
val recommended = if (QuestExperimental.isSupported()) null else DriverPairs.recommendedKey(gpu, pairs)
pairRows = pairs.map { p ->
val bundle = p.bundle?.let { installedBundle(it) }
val displayId = if (p.bundle != null) bundle?.androidId else p.display?.let { TurnipReleases.installedId(activity, it, td::isInstalled) }
@@ -132,6 +133,14 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
if (mode != SessionPrefs.GPU_DRIVERS_AUTO || pairBusy != null || releaseChecking) return
if (!force && autoCheckedThisProcess) return
autoCheckedThisProcess = true
val displayChanged = SessionPrefs.androidDriver(activity) != QuestExperimental.defaultAndroidDriver()
if (QuestExperimental.applyAutoDrivers(activity)) {
autoStatus = activity.getString(
if (displayChanged && CompositorHost.isStarted) R.string.drivers_using_quest_restart else R.string.drivers_using_quest,
)
refreshDrivers()
return
}
if (DriverPairs.recommendedKey(gpu, emptyList()) == null) {
autoStatus = activity.getString(R.string.drivers_none_to_set, gpu.supportText(activity).lowercase())
return
@@ -150,6 +150,7 @@ class MainActivity : ComponentActivity() {
private var phantomProcessStatus by mutableStateOf(PhantomProcessStatus.NOT_APPLICABLE)
private var showPhantomGate by mutableStateOf(false)
private var directAudio by mutableStateOf(false)
private var picturePosition by mutableStateOf("center")
private var stretch16x9 by mutableStateOf(false)
private var orientation by mutableStateOf(android.content.pm.ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE)
private var launcherFullscreen by mutableStateOf(true)
@@ -159,6 +160,8 @@ class MainActivity : ComponentActivity() {
private var storesOpenTab by mutableStateOf(SessionPrefs.STORES_OPEN_LIBRARY)
private var navRequest by mutableStateOf<String?>(null)
private var storesShowMature by mutableStateOf(false)
private var storesSort by mutableStateOf(SessionPrefs.STORES_SORTS.first())
private var storesView by mutableStateOf(SessionPrefs.STORES_VIEWS.first())
private var mic by mutableStateOf(false)
private var wifiDiscovery by mutableStateOf(false)
private var wifiDiscoveryPermission by mutableStateOf(false)
@@ -516,6 +519,8 @@ class MainActivity : ComponentActivity() {
gameStoresSpeedTier = SessionPrefs.gameStoresSpeedTier(this)
storesOpenTab = SessionPrefs.storesOpenTab(this)
storesShowMature = SessionPrefs.storesShowMature(this)
storesSort = SessionPrefs.storesSort(this)
storesView = SessionPrefs.storesView(this)
applyLauncherFullscreen()
updates.start()
setContent {
@@ -573,6 +578,8 @@ class MainActivity : ComponentActivity() {
addedGamesArt = addedGamesArt,
sgdbUserKey = sgdbUserKey,
storesShowMature = storesShowMature,
storesSort = storesSort,
storesView = storesView,
storeDownloadsActive = com.droiddeck.launcher.stores.StoresState.activeDownloads,
),
FrontEndActions(
@@ -728,6 +735,8 @@ class MainActivity : ComponentActivity() {
onStoresOpenTab = { tab -> SessionPrefs.setStoresOpenTab(this, tab); storesOpenTab = tab },
onNavigated = { navRequest = null },
onStoresShowMature = { show -> SessionPrefs.setStoresShowMature(this, show); storesShowMature = show },
onStoresSort = { sort -> SessionPrefs.setStoresSort(this, sort); storesSort = sort },
onStoresView = { view -> SessionPrefs.setStoresView(this, view); storesView = view },
onLibraryChanged = { refreshAddedGames(); refresh() },
onAnimationsEnabled = { on ->
SessionPrefs.setAnimationsEnabled(this, on)
@@ -1246,6 +1255,7 @@ class MainActivity : ComponentActivity() {
oscMode = if (mode == SessionService.MODE_STEAM) oscMode else null,
backActionsInverted = backActionsInverted,
directAudio = if (mode == SessionService.MODE_STEAM) directAudio else null,
picturePosition = if (mode == SessionService.MODE_STEAM) picturePosition else null,
stretch16x9 = if (mode == SessionService.MODE_STEAM) stretch16x9 else null,
mic = if (mode == SessionService.MODE_STEAM) mic else null,
gameStorage = if (mode == SessionService.MODE_STEAM) gameStorage else null,
@@ -1306,6 +1316,7 @@ class MainActivity : ComponentActivity() {
backActionsInverted = inverted
},
onDirectAudio = { on -> SessionPrefs.setDirectAudio(this, on); directAudio = on },
onPicturePosition = { value -> SessionPrefs.setPicturePosition(this, value); picturePosition = value },
onStretch16x9 = { on -> SessionPrefs.setStretch16x9(this, on); stretch16x9 = on },
onMic = { on ->
SessionPrefs.setMicEnabled(this, on)
@@ -1465,6 +1476,7 @@ class MainActivity : ComponentActivity() {
oscMode = SessionPrefs.oscMode(this)
backActionsInverted = SessionPrefs.backActionsInverted(this)
directAudio = SessionPrefs.directAudio(this)
picturePosition = SessionPrefs.picturePosition(this)
stretch16x9 = SessionPrefs.stretch16x9(this)
mic = SessionPrefs.micEnabled(this)
refreshWifiDiscovery()
@@ -0,0 +1,118 @@
package com.droiddeck.launcher
import android.app.NativeActivity
import android.os.Bundle
import android.os.SystemClock
import android.util.Log
import android.widget.Toast
import com.droiddeck.launcher.gpu.SteamVr
import com.droiddeck.launcher.session.SessionService
import com.droiddeck.launcher.session.SessionState
import com.droiddeck.launcher.wayland.CompositorHost
import com.droiddeck.launcher.wayland.WaylandCompositor
class QuestXrActivity : NativeActivity() {
private var steamVrStarted = false
@Volatile private var closing = false
@Volatile private var steamVrStatus = SteamVr.Status.UNAVAILABLE
private var sessionId: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
sessionId = SessionState.sessionId
SessionService.setXrActivityVisible(this, true)
super.onCreate(savedInstanceState)
}
fun onXrActive(active: Boolean) {
if (active) {
check(CompositorHost.isStarted) { "DroidDeck compositor is not running" }
SessionService.resume(this)
WaylandCompositor.nativeSetCardboard(false, 1, 0.064f, 3f, 4f, 0f, 0f, 90f, 0f, 0f)
WaylandCompositor.nativeSetFrameGenArmed(false, 0, 0)
WaylandCompositor.nativeSetZeroCopy(false)
CompositorHost.attachXr()
WaylandCompositor.nativeVsync(System.nanoTime())
check(WaylandCompositor.nativeWaitSurface(3000)) { "XR frame GPU handshake timed out" }
}
SessionService.setXrActivityVisible(this, active)
if (active) startSteamVr()
}
private fun startSteamVr() {
if (!steamVrStarted) {
steamVrStarted = true
Thread({
try {
val started = synchronized(steamVrLock) {
if (closing || !sessionAlive()) false else {
steamVrOwner = this
SteamVr.run(this, "start")
}
}
if (!started) {
if (!closing) leaveXr("SteamVR start failed", sessionAlive())
return@Thread
}
val startupDeadline = SystemClock.elapsedRealtime() + 30_000
var lastRunning: Long? = null
while (!closing) {
if (!sessionAlive()) {
leaveXr("Steam session ended", false)
break
}
steamVrStatus = SteamVr.status(this)
val now = SystemClock.elapsedRealtime()
if (steamVrStatus == SteamVr.Status.RUNNING) lastRunning = now
val deadline = lastRunning?.plus(5_000) ?: startupDeadline
if (steamVrStatus != SteamVr.Status.RUNNING && now >= deadline) {
leaveXr("SteamVR stopped or did not finish starting", true)
break
}
Thread.sleep(1000)
}
} finally {
synchronized(steamVrLock) {
// A retiring activity must not stop a replacement's SteamVR session.
if (steamVrOwner === this) {
if (sessionAlive()) SteamVr.run(this, "stop")
steamVrOwner = null
}
}
}
}, "quest-steamvr-start").start()
}
}
private fun sessionAlive() = SessionState.running && !SessionState.stopRequested &&
sessionId != null && SessionState.sessionId == sessionId
private fun leaveXr(reason: String, failed: Boolean) {
Log.w("DroidDeckXR", reason)
closing = true
runOnUiThread {
if (failed) Toast.makeText(this, R.string.cardboard_steamvr_failed, Toast.LENGTH_LONG).show()
finish()
}
}
fun onXrFrame(frameTimeNanos: Long) {
WaylandCompositor.nativeVsync(frameTimeNanos)
}
fun onXrStatus(): Int = steamVrStatus.ordinal
override fun onDestroy() {
closing = true
SessionService.setXrActivityVisible(this, false)
super.onDestroy()
}
override fun onStop() {
SessionService.setXrActivityVisible(this, false)
super.onStop()
}
companion object {
private val steamVrLock = Any()
private var steamVrOwner: QuestXrActivity? = null
}
}
@@ -120,6 +120,19 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
private var pipUi by mutableStateOf(false)
private var pipAutoEnter by mutableStateOf(false)
private var unfoldedControls by mutableStateOf(false)
private var picturePosition by mutableStateOf("center")
private fun applyGameAlignment() {
if (!CompositorHost.isStarted) return
val active = SessionState.mode == SessionService.MODE_STEAM &&
!pipUi && !isInPictureInPictureMode && !cardboard.enabled
val alignment = if (!active) ALIGN_CENTER else when (picturePosition) {
"top" -> ALIGN_PICTURE_TOP
"bottom" -> ALIGN_PICTURE_BOTTOM
else -> ALIGN_CENTER
}
WaylandCompositor.nativeSetScaleMode(SCALE_FIT, alignment)
}
private var unfoldedPanel: com.droiddeck.launcher.ui.DeckControlsPanel? = null
private lateinit var sessionRoot: FrameLayout
private val guestKeysDown = mutableSetOf<Int>()
@@ -162,6 +175,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
}
private var watching = true
private lateinit var touchpad: TouchpadGestures
private lateinit var threeFingerTap: com.droiddeck.launcher.input.ThreeFingerTap
private var touchMode by mutableStateOf(SessionPrefs.TOUCH_AUTO)
private var cursorPos by mutableStateOf(androidx.compose.ui.geometry.Offset(-100f, -100f))
private var cursorVisible by mutableStateOf(false)
@@ -177,6 +191,11 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
if (pointerLocked == locked) return@post
pointerLocked = locked
Log.i(TAG, "pointer lock " + if (locked) "taken by a program" else "released")
// Touchpad deltas are measured from the middle while locked (moveLockedPointer).
if (locked && ::touchpad.isInitialized) {
drawnRect()?.let { touchpad.place(it.centerX(), it.centerY()) }
cursorVisible = false
}
updatePointerCapture()
}
}
@@ -243,6 +262,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
private var drawerPage by mutableStateOf(SessionDrawerPage.CONTROLLER)
private var drawerControllerActive by mutableStateOf(false)
private var backActionsInverted by mutableStateOf(false)
private var lowLatencyController by mutableStateOf(false)
private var lowLatencyTouch by mutableStateOf(false)
private var padType by mutableStateOf(SessionPrefs.CONTROLLER_DECK)
private var pcKeyboardOpen by mutableStateOf(false)
private var achievementsInFront by mutableStateOf<AchievementsInFront?>(null)
@@ -308,16 +329,16 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
override fun onInputDeviceAdded(deviceId: Int) {
logInputDevice("connected", deviceId)
padBridge?.syncConnectedControllers()
updateOnScreenControls()
refreshControls()
updatePointerCapture()
}
override fun onInputDeviceRemoved(deviceId: Int) {
Log.i(TAG, "input device $deviceId disconnected")
padBridge?.onDeviceRemoved(deviceId)
updateOnScreenControls()
refreshControls()
updatePointerCapture()
}
override fun onInputDeviceChanged(deviceId: Int) = updateOnScreenControls()
override fun onInputDeviceChanged(deviceId: Int) = refreshControls()
}
private var runtimeRemovalBlocked = false
@@ -381,7 +402,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
bridge.setSelectSteam(ControllerPrefs.read(this).selectSteam)
padBridge = bridge
SessionState.padBridge = bridge
SteamControllerBle.listener = { uiHandler.post { updatePadMotion(); updateOnScreenControls() } }
SteamControllerBle.listener = { uiHandler.post { updatePadMotion(); refreshControls() } }
steamController = SteamControllerBle(this).also { it.start() }
padMotion = com.droiddeck.launcher.input.PadMotion(this) {
@Suppress("DEPRECATION")
@@ -397,6 +418,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
onScreenControls = OnScreenControls(this, bridge, onKeyboard = ::togglePcKeyboard).also { root.addView(it) }
keyboard = KeyboardHost(this).also { root.addView(it) }
touchpad = TouchpadGestures(PointerGestures.slop(this), pointerListener)
threeFingerTap = com.droiddeck.launcher.input.ThreeFingerTap(PointerGestures.slop(this) * 2)
val noCursor = android.view.PointerIcon.getSystemIcon(this, android.view.PointerIcon.TYPE_NULL)
root.pointerIcon = noCursor
surfaceView.pointerIcon = noCursor
@@ -458,6 +480,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
defaultFocusHighlightEnabled = false
setContent {
androidx.compose.runtime.LaunchedEffect(drawerOpen, pcKeyboardOpen, achievementsOpen, pipUi) { updatePointerCapture() }
androidx.compose.runtime.LaunchedEffect(picturePosition, SessionState.running, pipUi, cardboard.enabled) { applyGameAlignment() }
DroidDeckTheme {
if (pipUi) {
if (SessionState.suspended) androidx.compose.foundation.layout.Box(
@@ -498,8 +521,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
releaseDrawerDirection()
}
}
LaunchedEffect(cardboard.enabled, steamVrSwitchedPicture) {
while (cardboard.enabled || steamVrSwitchedPicture) {
LaunchedEffect(cardboard.enabled, steamVrSwitchedPicture, drawerOpen, drawerPage) {
while (cardboard.enabled || steamVrSwitchedPicture || (drawerOpen && drawerPage == SessionDrawerPage.STEAMVR)) {
val now = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) {
SteamVr.status(this@SessionActivity)
}
@@ -536,6 +559,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
onCardboard = { c -> SessionPrefs.setCardboard(this@SessionActivity, c); applyCardboard(c) },
onCardboardRecenter = { headTracker?.recenter() },
steamVr = steamVrStatus,
immersiveSteamVr = com.droiddeck.launcher.session.QuestExperimental.isSupported(),
onSteamVr = { action -> steamVrAction(action) },
textureAnisotropy = if (drawerGameProfileId == null) textureAnisotropy else drawerTextureAnisotropy,
textureLodBias = if (drawerGameProfileId == null) textureLodBias else drawerTextureLodBias,
@@ -612,6 +636,18 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
SessionPrefs.setBackActionsInverted(this@SessionActivity, inverted)
backActionsInverted = inverted
},
lowLatencyController = lowLatencyController,
lowLatencyTouch = lowLatencyTouch,
onLowLatencyController = { on ->
SessionPrefs.setLowLatencyController(this@SessionActivity, on)
lowLatencyController = on
applyLowLatency()
},
onLowLatencyTouch = { on ->
SessionPrefs.setLowLatencyTouch(this@SessionActivity, on)
lowLatencyTouch = on
applyLowLatency()
},
onOsc = { v ->
SessionPrefs.setOscMode(this@SessionActivity, v)
readPrefs()
@@ -1051,6 +1087,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
private fun readPrefs() {
pipAutoEnter = SessionPrefs.pipAutoEnter(this)
unfoldedControls = SessionPrefs.unfoldedControls(this)
picturePosition = SessionPrefs.picturePosition(this)
hudOn = SessionPrefs.hudEnabled(this)
upscaler = SessionPrefs.upscaler(this)
upscaleSharpness = SessionPrefs.upscaleSharpness(this)
@@ -1081,6 +1118,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
steamDownloadsInBackground = SessionPrefs.steamDownloadsInBackground(this)
oscMode = SessionPrefs.oscMode(this)
backActionsInverted = SessionPrefs.backActionsInverted(this)
lowLatencyController = SessionPrefs.lowLatencyController(this)
lowLatencyTouch = SessionPrefs.lowLatencyTouch(this)
padType = SessionPrefs.steamController(this)
}
@@ -1286,6 +1325,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
)
}
applyFrameGen()
applyGameAlignment()
}
private var surfaceW = 0
@@ -1705,9 +1745,11 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
}
private val pointerListener = object : PointerGestures.Listener {
override fun onMove(x: Float, y: Float) = movePointer(x, y)
override fun onMove(x: Float, y: Float) {
if (pointerLocked) moveLockedPointer(x, y) else movePointer(x, y)
}
override fun onButton(button: Int, pressed: Boolean, x: Float, y: Float) {
movePointer(x, y)
if (!pointerLocked) movePointer(x, y)
WaylandCompositor.nativeSendSceneInput(3, button, if (pressed) 1 else 0)
}
override fun onWheel(steps: Int) { WaylandCompositor.nativeSendSceneInput(4, steps, 0) }
@@ -1717,6 +1759,14 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
}
}
private fun moveLockedPointer(x: Float, y: Float) {
val rect = drawnRect() ?: return
val scale = SessionState.outputSize.first / rect.width()
WaylandCompositor.sendPointerDelta((x - rect.centerX()) * scale, (y - rect.centerY()) * scale)
touchpad.place(rect.centerX(), rect.centerY())
cursorVisible = false
}
private fun movePointer(x: Float, y: Float) {
val rect = drawnRect() ?: return
val cx = x.coerceIn(rect.left, rect.right)
@@ -1859,11 +1909,17 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
applyUnfoldedControls()
}
private fun refreshControls() {
applyUnfoldedControls()
updateOnScreenControls()
}
private fun applyUnfoldedControls() {
if (!::sessionRoot.isInitialized) return
val width = sessionRoot.width
val height = sessionRoot.height
val wanted = unfoldedControls && com.droiddeck.launcher.session.SessionDisplay.foldable(this) &&
!PadBridge.anyControllerConnected() && !SteamControllerBle.connected &&
SessionState.mode == SessionService.MODE_STEAM && SessionState.deckPad &&
!pipUi && !isInPictureInPictureMode && width > 0 && height > 0 &&
resources.configuration.smallestScreenWidthDp >= com.droiddeck.launcher.session.SessionDisplay.UNFOLDED_MIN_DP
@@ -1939,9 +1995,15 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
else -> SessionState.mode != SessionService.MODE_STEAM || SessionState.steamUi == "desktop"
}
private val gamePictureBounds = FloatArray(4)
private var topPictureMapped = false
private fun drawnRect(): android.graphics.RectF? {
val width = surfaceView.width.takeIf { it > 0 } ?: return null
val height = surfaceView.height.takeIf { it > 0 } ?: return null
topPictureMapped = CompositorHost.isStarted && WaylandCompositor.nativeGamePictureRect(gamePictureBounds)
if (topPictureMapped) return android.graphics.RectF(
gamePictureBounds[0], gamePictureBounds[1], gamePictureBounds[2], gamePictureBounds[3])
val out = SessionState.outputSize
val scale = minOf(width / out.first.toFloat(), height / out.second.toFloat())
val drawnW = out.first * scale
@@ -1951,9 +2013,19 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
return android.graphics.RectF(left, top, left + drawnW, top + drawnH)
}
private var ignoreGameTouch = false
override fun onTouchEvent(event: MotionEvent): Boolean {
if (event.isFromSource(android.view.InputDevice.SOURCE_MOUSE)) return onMouse(event)
if (routedTouchMode == SessionPrefs.TOUCH_OFF) return true
if (SessionState.mode == SessionService.MODE_STEAM && SessionState.steamUi != "desktop") {
val wasActive = threeFingerTap.active
if (threeFingerTap.onTouch(event)) padBridge?.triggerSteamKeyboard()
if (threeFingerTap.active && !wasActive) {
if (usingTouchpad()) touchpad.cancel() else WaylandCompositor.nativeSendTouch(3, -1, 0, 0)
}
if (threeFingerTap.active || wasActive) return true
}
if (usingTouchpad()) {
val rect = drawnRect() ?: return false
if (touchpad.bounds != rect) {
@@ -1964,6 +2036,14 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
return touchpad.onTouch(event)
}
val rect = drawnRect() ?: return false
if (event.actionMasked == MotionEvent.ACTION_DOWN)
ignoreGameTouch = topPictureMapped && !rect.contains(event.x, event.y)
if (ignoreGameTouch) {
if (event.actionMasked == MotionEvent.ACTION_DOWN)
WaylandCompositor.nativeSendTouch(3, -1, 0, 0)
if (event.actionMasked == MotionEvent.ACTION_UP || event.actionMasked == MotionEvent.ACTION_CANCEL) ignoreGameTouch = false
return true
}
fun sendTouch(action: Int, index: Int) {
val x = event.getX(index).coerceIn(rect.left, rect.right)
val y = event.getY(index).coerceIn(rect.top, rect.bottom)
@@ -2274,12 +2354,12 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
if (SessionState.guestPid > 1) padBridge?.syncConnectedControllers()
onScreenControls?.reload()
controllerSettings = ControllerPrefs.read(this)
updateOnScreenControls()
resumed = true
updatePointerCapture()
if (!pipUi) sessionClipboard.start()
updatePadMotion()
readPrefs()
refreshControls()
if (::pip.isInitialized) pip.resumed()
if (CompositorHost.isStarted) applyFrameGen()
SessionPrefs.sessionPrefs(this).registerOnSharedPreferenceChangeListener(cardboardPrefListener)
@@ -2304,6 +2384,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
}
private fun steamVrAction(action: String) {
if (action == "start" && com.droiddeck.launcher.session.QuestExperimental.isSupported()) {
startActivity(android.content.Intent(this, QuestXrActivity::class.java))
return
}
if (action == "start") {
switchPictureForSteamVr()
steamVrSeenRunning = false
@@ -2389,8 +2473,16 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
super.onAttachedToWindow()
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) return
val decor = window.decorView
decor.requestUnbufferedDispatch(UNBUFFERED_SOURCES)
decor.viewTreeObserver.addOnGlobalFocusChangeListener { _, _ -> decor.post { decor.requestUnbufferedDispatch(UNBUFFERED_SOURCES) } }
decor.requestUnbufferedDispatch(unbufferedSources())
decor.viewTreeObserver.addOnGlobalFocusChangeListener { _, _ -> decor.post { decor.requestUnbufferedDispatch(unbufferedSources()) } }
}
private fun unbufferedSources() =
if (lowLatencyTouch) UNBUFFERED_SOURCES or InputDevice.SOURCE_CLASS_POINTER else UNBUFFERED_SOURCES
private fun applyLowLatency() {
com.droiddeck.launcher.input.FakeInputWriter.setLowLatency(lowLatencyController, lowLatencyTouch)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) window.decorView.requestUnbufferedDispatch(unbufferedSources())
}
override fun onWindowFocusChanged(hasFocus: Boolean) {
@@ -2512,6 +2604,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
private const val DRAWER_REPEAT_ACCELERATION_MS = 1_400L
private const val SCALE_FIT = 1
private const val ALIGN_CENTER = 0
private const val ALIGN_PICTURE_TOP = 3
private const val ALIGN_PICTURE_BOTTOM = 4
private val RUNTIME_LINES = PackageLines(
R.string.session_runtime_downloading, R.string.session_runtime_downloading_mb,
R.string.session_runtime_checking, R.string.session_runtime_unpacking,
@@ -48,6 +48,12 @@ public final class Downloader {
if (have > 0) connection.setRequestProperty("Range", "bytes=" + have + "-");
int code = connection.getResponseCode();
boolean appending = code == HttpURLConnection.HTTP_PARTIAL;
if (appending && !rangeStartsAt(connection.getHeaderField("Content-Range"), have)) {
// A 206 that does not begin where the kept bytes end would corrupt the file if appended.
connection.disconnect();
destination.delete();
return downloadFile(url, destination, false, progress);
}
if (code / 100 != 2) {
if (have > 0) {
connection.disconnect();
@@ -87,6 +93,13 @@ public final class Downloader {
}
}
/** True when a `Content-Range: bytes START-END/TOTAL` header starts exactly at {@code start}. */
static boolean rangeStartsAt(String contentRange, long start) {
if (contentRange == null) return false;
java.util.regex.Matcher m = java.util.regex.Pattern.compile("^\\s*bytes\\s+(\\d+)-\\d+/(?:\\d+|\\*)\\s*$").matcher(contentRange);
return m.matches() && Long.parseLong(m.group(1)) == start;
}
private static HttpURLConnection open(String url) throws java.io.IOException {
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
connection.setConnectTimeout(TIMEOUT_MS);
@@ -36,6 +36,10 @@ object AddedGameArt {
class Option(val group: String, val thumb: String, val full: String)
class Choices(val options: List<Option>, val sgdb: SteamGridDb.Status)
class Found<T>(val items: List<T>, val status: SteamGridDb.Status)
private val CHOSEN = Regex("""chosen-(\w+)\.(\w+)""")
private fun chosen(cache: File, slot: Slot): File? =
@@ -108,7 +112,7 @@ object AddedGameArt {
dir.listFiles { f -> f.isFile && f.extension.lowercase() in CHOOSABLE }?.sortedBy { it.name.lowercase() }.orEmpty()
}.take(12)
fun options(context: Context, game: AddedGames.Game, slot: Slot): List<Option> {
fun choices(context: Context, game: AddedGames.Game, slot: Slot): Choices {
val out = ArrayList<Option>()
folderImages(game.folder).forEach { out.add(Option(FOLDER, it.path, it.path)) }
val cache = cacheDir(context, game)
@@ -118,16 +122,42 @@ object AddedGameArt {
val url = "$CDN$steamId/$remote".takeIf { exists(it) } ?: steamAssetUrl(steamId, remote)
if (url != null) out.add(Option(STEAM, url, url))
}
var status = SteamGridDb.Status.OK
val key = SteamGridDb.key(context)
if (key.isNotEmpty()) {
if (key.isEmpty()) {
status = SteamGridDb.Status.NO_KEY
} else {
cache.mkdirs()
val gridId = remembered(File(cache, "sgdb-id")) {
runCatching { SteamGridDb.gameId(key, steamId?.toIntOrNull(), game.name) }.getOrNull()?.toString()
}?.toIntOrNull()
if (gridId != null) runCatching { SteamGridDb.images(key, gridId, slot, if (slot == Slot.ICON) 3 else 5) }.getOrNull()
?.forEach { (thumb, full) -> out.add(Option(SGDB, thumb, full)) }
try {
val gridId = remembered(File(cache, "sgdb-id"), SteamGridDb.keyChangedAt(context), retryMiss = true) {
SteamGridDb.gameId(key, steamId?.toIntOrNull(), game.name)?.toString()
}?.toIntOrNull()
if (gridId == null) status = SteamGridDb.Status.NO_GAME
else SteamGridDb.images(key, gridId, slot, if (slot == Slot.ICON) 3 else 5)
.forEach { (thumb, full) -> out.add(Option(SGDB, thumb, full)) }
} catch (e: Exception) {
Log.w(TAG, "${game.name}: SteamGridDB failed (${e.javaClass.simpleName})")
status = (e as? SteamGridDb.Failed)?.status ?: SteamGridDb.Status.SERVER
}
}
return Choices(out, status)
}
fun searchGames(context: Context, term: String): Found<SteamGridDb.Game> = sgdb(context) { SteamGridDb.search(it, term) }
fun gameImages(context: Context, id: Int, slot: Slot, page: Int): Found<Option> = sgdb(context) { key ->
SteamGridDb.page(key, id, slot, page).map { (thumb, full) -> Option(SGDB, thumb, full) }
}
private fun <T> sgdb(context: Context, call: (String) -> List<T>): Found<T> {
val key = SteamGridDb.key(context)
if (key.isEmpty()) return Found(emptyList(), SteamGridDb.Status.NO_KEY)
return try {
Found(call(key), SteamGridDb.Status.OK)
} catch (e: Exception) {
Log.w(TAG, "SteamGridDB: ${e.javaClass.simpleName}")
Found(emptyList(), (e as? SteamGridDb.Failed)?.status ?: SteamGridDb.Status.SERVER)
}
return out
}
fun choose(context: Context, game: AddedGames.Game, slot: Slot, option: Option): Boolean {
@@ -180,6 +210,8 @@ object AddedGameArt {
fun fetchMissing(context: Context, games: List<AddedGames.Game>): Boolean {
if (!SessionPrefs.addedGamesArt(context)) return false
val sgdbKey = SteamGridDb.key(context)
val keyChangedAt = SteamGridDb.keyChangedAt(context)
var sgdbDown = false
var changed = false
for (game in games) {
if (local(game).portrait != null) continue
@@ -192,11 +224,24 @@ object AddedGameArt {
val appId = match.appId?.takeIf { match.certainty == SteamMatch.Certainty.FILES }
val id = match.appId?.toString()
if (id != null && download(id, cache)) changed = true
if (File(cache, "p.jpg").isFile || sgdbKey.isEmpty()) continue
val gridId = remembered(File(cache, "sgdb-id")) {
runCatching { SteamGridDb.gameId(sgdbKey, appId ?: id?.toIntOrNull(), game.name) }.getOrNull()?.toString()
}?.toIntOrNull() ?: continue
if (runCatching { SteamGridDb.download(sgdbKey, gridId, cache) }.getOrDefault(false)) changed = true
if (File(cache, "p.jpg").isFile || sgdbKey.isEmpty() || sgdbDown) continue
val stored: String? = try {
remembered(File(cache, "sgdb-id"), keyChangedAt) {
SteamGridDb.gameId(sgdbKey, appId ?: id?.toIntOrNull(), game.name)?.toString()
}
} catch (e: Exception) {
Log.w(TAG, "${game.name}: SteamGridDB lookup failed (${e.javaClass.simpleName}); not asking again this pass")
sgdbDown = true
null
}
val gridId = stored?.toIntOrNull() ?: continue
val grabbed = try {
SteamGridDb.download(sgdbKey, gridId, cache)
} catch (e: Exception) {
sgdbDown = true
false
}
if (grabbed) changed = true
}
return changed
}
@@ -207,11 +252,12 @@ object AddedGameArt {
return match
}
private fun remembered(marker: File, find: () -> String?): String? {
internal fun remembered(marker: File, notBefore: Long = 0L, retryMiss: Boolean = false, find: () -> String?): String? {
if (marker.isFile) {
val value = marker.readText().trim()
if (value != "none") return value
if (System.currentTimeMillis() - marker.lastModified() < RETRY_AFTER_MS) return null
val at = marker.lastModified()
if (!retryMiss && at >= notBefore && System.currentTimeMillis() - at < RETRY_AFTER_MS) return null
}
val found = find()
marker.writeText(found ?: "none")
@@ -76,7 +76,7 @@ object DependencyDetector {
fun consider(f: File, isDir: Boolean, insideRedist: Boolean) {
val name = f.name.lowercase(Locale.US)
val path = f.path.replace('\\', '/').lowercase(Locale.US)
val path = relativeReason(gameDir, f).lowercase(Locale.US)
val kind = if (insideRedist || isDir || name.endsWith(".exe") || name.endsWith(".msi") || name.endsWith(".cab"))
Kind.BUNDLED else Kind.SHIPPED
for (comp in classify(path, name, isDir)) {
@@ -5,12 +5,14 @@ import android.content.Context
import android.content.Intent
import android.content.pm.ShortcutInfo
import android.content.pm.ShortcutManager
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.drawable.Icon
import android.net.Uri
import android.widget.Toast
import com.droiddeck.launcher.MainActivity
import com.droiddeck.launcher.R
import java.io.File
object GameShortcuts {
fun launchIntent(context: Context, gameId: String) = Intent(Intent.ACTION_VIEW,
@@ -19,22 +21,35 @@ object GameShortcuts {
private fun info(context: Context, game: Library.SteamGame): ShortcutInfo {
val name = game.name.ifBlank { context.getString(R.string.app_name) }
val icon = listOfNotNull(game.icon, game.art).firstNotNullOfOrNull { file -> runCatching {
val bounds = BitmapFactory.Options().apply { inJustDecodeBounds = true }
BitmapFactory.decodeFile(file.path, bounds)
if (bounds.outWidth <= 0 || bounds.outHeight <= 0) return@runCatching null
val options = BitmapFactory.Options().apply {
inSampleSize = 1
while (maxOf(bounds.outWidth, bounds.outHeight) / inSampleSize > 256) inSampleSize *= 2
}
BitmapFactory.decodeFile(file.path, options)?.let(Icon::createWithBitmap)
}.getOrNull() } ?: Icon.createWithResource(context, R.mipmap.ic_launcher)
val icon = iconBitmap(game)?.let(Icon::createWithBitmap) ?: Icon.createWithResource(context, R.mipmap.ic_launcher)
return ShortcutInfo.Builder(context, "game:${game.gameIdString}")
.setActivity(android.content.ComponentName(context, MainActivity::class.java))
.setShortLabel(name.take(40)).setLongLabel(name).setIcon(icon)
.setIntent(launchIntent(context, game.gameIdString)).build()
}
internal fun iconBitmap(game: Library.SteamGame): Bitmap? {
val icon = game.icon?.let(::decode)
if (icon != null && minOf(icon.width, icon.height) >= SHARP_ICON_PX) return icon
return game.art?.let(::decode)?.let(::square) ?: icon
}
private fun decode(file: File): Bitmap? = runCatching {
val bounds = BitmapFactory.Options().apply { inJustDecodeBounds = true }
BitmapFactory.decodeFile(file.path, bounds)
if (bounds.outWidth <= 0 || bounds.outHeight <= 0) return@runCatching null
val options = BitmapFactory.Options().apply {
inSampleSize = 1
while (minOf(bounds.outWidth, bounds.outHeight) / (inSampleSize * 2) >= ICON_PX) inSampleSize *= 2
}
BitmapFactory.decodeFile(file.path, options)
}.getOrNull()
private fun square(bitmap: Bitmap): Bitmap {
val side = minOf(bitmap.width, bitmap.height)
return Bitmap.createBitmap(bitmap, (bitmap.width - side) / 2, (bitmap.height - side) / 2, side, side)
}
fun pin(activity: Activity, game: Library.SteamGame) {
val manager = activity.getSystemService(ShortcutManager::class.java)
val requested = runCatching { manager.isRequestPinShortcutSupported &&
@@ -44,4 +59,7 @@ object GameShortcuts {
fun result(activity: Activity, game: Library.SteamGame): Intent =
activity.getSystemService(ShortcutManager::class.java).createShortcutResultIntent(info(activity, game))
private const val ICON_PX = 256
private const val SHARP_ICON_PX = 128
}
@@ -128,6 +128,14 @@ object Library {
return out.values.toList()
}
fun steamLibraryArt(context: Context): List<Pair<Int, File>> {
val cache = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/appcache/librarycache")
return cache.listFiles().orEmpty().mapNotNull { dir ->
val appId = dir.name.toIntOrNull()?.takeIf { it !in NOT_GAMES } ?: return@mapNotNull null
steamCacheImage(cache, appId, STEAM_CAPSULES)?.let { appId to it }
}
}
fun launchableGames(context: Context, strictRead: Boolean = false, added: List<AddedGames.Game>? = null): List<SteamGame> {
val roots = steamLibraries(context).map { it.first }
return (steamGames(context, strictRead) + (added ?: AddedGames.scan(context)).map { g -> addedGame(context, g, roots) }).distinctBy { it.gameId }
@@ -0,0 +1,91 @@
package com.droiddeck.launcher.frontend
import android.content.Context
import android.util.Log
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.droiddeck.launcher.stores.StoreNet
import org.json.JSONArray
import org.json.JSONObject
import java.util.Locale
import java.util.concurrent.atomic.AtomicBoolean
object SteamFeatured {
class Game(val appId: Int, val name: String, val art: String)
private const val TAG = "SteamFeatured"
private const val PREFS = "steam_featured"
private const val KEY_GAMES = "games_v2"
private const val KEY_AT = "at"
private const val FRESH_MS = 6 * 60 * 60 * 1000L
private val SECTIONS = listOf("top_sellers", "new_releases", "specials")
private const val ASSET_ROOT = "https://shared.akamai.steamstatic.com/store_item_assets/"
private val HIDDEN_DESCRIPTORS = setOf(1, 3, 4)
var games by mutableStateOf<List<Game>>(emptyList())
private set
private val loading = AtomicBoolean(false)
fun load(context: Context) {
val prefs = context.applicationContext.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
if (games.isEmpty()) parse(prefs.getString(KEY_GAMES, null))?.let { games = it }
if (System.currentTimeMillis() - prefs.getLong(KEY_AT, 0L) in 0 until FRESH_MS && games.isNotEmpty()) return
if (!loading.compareAndSet(false, true)) return
Thread({
try {
val cc = Locale.getDefault().country.takeIf { it.length == 2 } ?: "US"
val body = StoreNet.get("https://store.steampowered.com/api/featuredcategories?cc=$cc&l=english") ?: return@Thread
val root = JSONObject(body)
val ids = LinkedHashSet<Int>()
for (section in SECTIONS) {
val items = root.optJSONObject(section)?.optJSONArray("items") ?: continue
for (i in 0 until items.length()) {
val o = items.optJSONObject(i) ?: continue
val id = o.optInt("id")
if (id > 0 && o.optInt("type", 0) == 0) ids += id
}
}
val list = withArt(ids, cc)
if (list.isEmpty()) return@Thread
prefs.edit().putString(KEY_GAMES, JSONArray(list.map { JSONObject().put("id", it.appId).put("name", it.name).put("art", it.art) }).toString())
.putLong(KEY_AT, System.currentTimeMillis()).apply()
android.os.Handler(android.os.Looper.getMainLooper()).post { games = list }
Log.i(TAG, "featured games: ${list.size}")
} catch (e: Exception) {
Log.w(TAG, "featured: ${e.javaClass.simpleName}")
} finally {
loading.set(false)
}
}, "steam-featured").start()
}
private fun withArt(ids: Collection<Int>, cc: String): List<Game> {
if (ids.isEmpty()) return emptyList()
val input = JSONObject()
.put("ids", JSONArray(ids.map { JSONObject().put("appid", it) }))
.put("context", JSONObject().put("language", "english").put("country_code", cc))
.put("data_request", JSONObject().put("include_assets", true))
val body = StoreNet.get(
"https://api.steampowered.com/IStoreBrowseService/GetItems/v1/?input_json=" + java.net.URLEncoder.encode(input.toString(), "UTF-8"),
) ?: return emptyList()
val items = JSONObject(body).optJSONObject("response")?.optJSONArray("store_items") ?: return emptyList()
return (0 until items.length()).mapNotNull { i ->
val o = items.optJSONObject(i) ?: return@mapNotNull null
val descriptors = o.optJSONArray("content_descriptorids")
if (descriptors != null && (0 until descriptors.length()).any { descriptors.optInt(it) in HIDDEN_DESCRIPTORS }) return@mapNotNull null
val assets = o.optJSONObject("assets") ?: return@mapNotNull null
val format = assets.optString("asset_url_format").takeIf { "\${FILENAME}" in it } ?: return@mapNotNull null
val file = listOf("library_capsule_2x", "library_capsule").firstNotNullOfOrNull { k -> assets.optString(k).takeIf { it.isNotEmpty() } }
?: return@mapNotNull null
Game(o.optInt("appid"), o.optString("name"), ASSET_ROOT + format.replace("\${FILENAME}", file))
}
}
private fun parse(text: String?): List<Game>? {
val a = runCatching { JSONArray(text ?: return null) }.getOrNull() ?: return null
return (0 until a.length()).mapNotNull { a.optJSONObject(it) }.map { Game(it.optInt("id"), it.optString("name"), it.optString("art")) }
.filter { it.appId > 0 && it.art.isNotEmpty() }.takeIf { it.isNotEmpty() }
}
}
@@ -16,6 +16,12 @@ object SteamGridDb {
private const val API = "https://www.steamgriddb.com/api/v2"
private const val QUERY = "nsfw=false&humor=false"
enum class Status { OK, NO_KEY, BAD_KEY, LIMIT, OFFLINE, SERVER, NO_GAME }
class Failed(val status: Status) : Exception(status.name)
class Game(val id: Int, val name: String, val verified: Boolean)
@VisibleForTesting
@Volatile
internal var keys: CredentialCipher.KeyProvider = CredentialCipher.Keystore
@@ -30,6 +36,8 @@ object SteamGridDb {
fun key(context: Context): String = pick(userKey(context), builtInKey())
fun keyChangedAt(context: Context): Long = keyFile(context).lastModified()
@Synchronized
fun userKey(context: Context): String {
val f = keyFile(context)
@@ -97,17 +105,37 @@ object SteamGridDb {
return got
}
fun images(key: String, id: Int, slot: AddedGameArt.Slot, limit: Int): List<Pair<String, String>> {
val path = when (slot) {
fun search(key: String, term: String): List<Game> {
val q = term.trim()
if (q.isEmpty()) return emptyList()
val enc = URLEncoder.encode(q, "UTF-8").replace("+", "%20")
val data = json(key, "$API/search/autocomplete/$enc")?.optJSONArray("data") ?: return emptyList()
return games(data)
}
internal fun games(data: JSONArray): List<Game> =
(0 until data.length()).mapNotNull { data.optJSONObject(it) }
.filter { it.optInt("id") > 0 && it.optString("name").isNotEmpty() }
.map { Game(it.optInt("id"), it.optString("name"), it.optBoolean("verified")) }
internal fun path(id: Int, slot: AddedGameArt.Slot, page: Int): String {
val base = when (slot) {
AddedGameArt.Slot.COVER -> "grids/game/$id?dimensions=600x900&$QUERY"
AddedGameArt.Slot.BACKGROUND -> "heroes/game/$id?$QUERY"
AddedGameArt.Slot.LOGO -> "logos/game/$id?$QUERY"
AddedGameArt.Slot.ICON -> "icons/game/$id?$QUERY"
}
val items = json(key, "$API/$path")?.optJSONArray("data") ?: return emptyList()
return ranked(items, pngOnly = slot == AddedGameArt.Slot.LOGO || slot == AddedGameArt.Slot.ICON).take(limit)
return if (page > 0) "$base&page=$page" else base
}
fun page(key: String, id: Int, slot: AddedGameArt.Slot, page: Int): List<Pair<String, String>> {
val items = json(key, "$API/${path(id, slot, page)}")?.optJSONArray("data") ?: return emptyList()
return ranked(items, pngOnly = slot == AddedGameArt.Slot.LOGO || slot == AddedGameArt.Slot.ICON)
}
fun images(key: String, id: Int, slot: AddedGameArt.Slot, limit: Int): List<Pair<String, String>> =
page(key, id, slot, 0).take(limit)
internal fun ranked(items: JSONArray, pngOnly: Boolean): List<Pair<String, String>> =
(0 until items.length()).map { items.getJSONObject(it) }
.filter { it.optString("url").startsWith("https://") && (!pngOnly || it.optString("mime") == "image/png" || it.optString("url").endsWith(".png", true)) }
@@ -119,6 +147,13 @@ object SteamGridDb {
.filter { it.optString("url").startsWith("https://") && (!pngOnly || it.optString("mime") == "image/png" || it.optString("url").endsWith(".png", true)) }
.maxByOrNull { it.optInt("score", 0) }?.optString("url")
internal fun failure(code: Int): Status? = when {
code == 401 || code == 403 -> Status.BAD_KEY
code == 429 -> Status.LIMIT
code >= 500 -> Status.SERVER
else -> null
}
private fun json(key: String, url: String): JSONObject? {
val c = URL(url).openConnection() as HttpURLConnection
c.connectTimeout = 10_000
@@ -126,8 +161,19 @@ object SteamGridDb {
c.setRequestProperty("User-Agent", "DroidDeck-launcher")
c.setRequestProperty("Authorization", "Bearer $key")
return try {
if (c.responseCode != 200) { Log.w(TAG, "${URL(url).path}: HTTP ${c.responseCode}"); null }
else JSONObject(c.inputStream.use { it.readBytes() }.toString(Charsets.UTF_8)).takeIf { it.optBoolean("success", true) }
val code = c.responseCode
if (code == 200) {
JSONObject(c.inputStream.use { it.readBytes() }.toString(Charsets.UTF_8)).takeIf { it.optBoolean("success", true) }
} else {
Log.w(TAG, "${URL(url).path}: HTTP $code")
failure(code)?.let { throw Failed(it) }
null
}
} catch (e: Failed) {
throw e
} catch (e: java.io.IOException) {
Log.w(TAG, "${URL(url).path}: ${e.javaClass.simpleName}")
throw Failed(Status.OFFLINE)
} catch (e: Exception) {
Log.w(TAG, "${URL(url).path}: ${e.javaClass.simpleName}"); null
} finally {
@@ -81,7 +81,7 @@ data class GpuInfo(
)
}
private fun threeDigits(text: String): Int = Regex("""(\d{3})""").find(text)?.groupValues?.get(1)?.toIntOrNull() ?: 0
internal fun threeDigits(text: String): Int = Regex("""(\d{3})""").find(text)?.groupValues?.get(1)?.toIntOrNull() ?: 0
private val PLATFORMS = mapOf(
"msmnile" to 640, "kona" to 650, "lahaina" to 660, "taro" to 730, "cape" to 730,
@@ -8,6 +8,7 @@ import android.util.Log;
import com.droiddeck.launcher.R;
import com.droiddeck.launcher.core.FileUtils;
import com.droiddeck.launcher.core.TarZst;
import com.droiddeck.launcher.session.QuestExperimental;
import com.droiddeck.launcher.session.SessionPrefs;
import org.json.JSONObject;
@@ -281,6 +282,8 @@ public final class TurnipDriver {
if (forced.startsWith("a7")) return DRIVER_A7XX;
if (forced.startsWith("a6")) return DRIVER_A6XX;
}
String quest = QuestExperimental.INSTANCE.defaultAndroidDriver();
if (quest != null) return quest;
String model = gpuModel();
Log.i(TAG, "gpu model: " + (model == null ? "unknown" : model));
if (model != null) {
@@ -79,6 +79,10 @@ public class FakeInputWriter {
private static final int DECK_CONTROLS_OFFSET = IMU_OFFSET + 40;
private static final int PAD_TYPE_OFFSET = IMU_OFFSET + 44;
private static final int PAD_TYPE_SET = 0x80000000;
private static final int LATENCY_OFFSET = IMU_OFFSET + 48;
public static final int LATENCY_CONTROLLER = 1;
public static final int LATENCY_TOUCH = 2;
private static volatile int latency = 0;
public static final int PAD_TYPE_DECK = 0;
public static final int PAD_TYPE_STEAM = 1;
public static final int PAD_TYPE_XBOX = 2;
@@ -214,6 +218,7 @@ public class FakeInputWriter {
data.putInt(DECK_CONTROLS_OFFSET, 0);
int type = padType;
data.putInt(PAD_TYPE_OFFSET, type >= 0 ? PAD_TYPE_SET | type : 0);
data.putInt(LATENCY_OFFSET, latency);
data.putInt(TRITON_OFFSET, TRITON_MAGIC);
data.putInt(TRITON_CONNECTED_OFFSET, tritonConnected ? 1 : 0);
data.putLong(TRITON_INPUT_SEQ_OFFSET, 0L);
@@ -514,6 +519,22 @@ public class FakeInputWriter {
}
}
public static void setLowLatency(boolean controller, boolean touch) {
int flags = (controller ? LATENCY_CONTROLLER : 0) | (touch ? LATENCY_TOUCH : 0);
latency = flags;
RingSlot ringSlot;
synchronized (RING_LOCK) {
ringSlot = RING_SLOTS[0];
}
if (ringSlot == null) return;
synchronized (ringSlot) {
ByteBuffer ring = ringSlot.data;
if (ring == null) return;
nativeStoreFence();
ring.putInt(LATENCY_OFFSET, flags);
}
}
public static void setTritonConnected(int slot, boolean connected) {
tritonConnected = connected;
RingSlot ringSlot = tritonSlot(slot);
@@ -19,6 +19,7 @@ public final class PadBridge {
private static final float DEAD_ZONE = 0.12f;
private static final int[] JOYSTICK_AXES = {
MotionEvent.AXIS_X, MotionEvent.AXIS_Y, MotionEvent.AXIS_Z, MotionEvent.AXIS_RZ,
MotionEvent.AXIS_RX, MotionEvent.AXIS_RY,
MotionEvent.AXIS_HAT_X, MotionEvent.AXIS_HAT_Y, MotionEvent.AXIS_LTRIGGER,
MotionEvent.AXIS_RTRIGGER, MotionEvent.AXIS_BRAKE, MotionEvent.AXIS_GAS
};
@@ -54,7 +55,8 @@ public final class PadBridge {
private boolean systemGuidePressed;
private boolean systemQamPressed;
private boolean qamChordActive;
private boolean qamSyntheticAPressed;
private int chordButton = -1;
private boolean chordButtonPressed;
private boolean qamTapPressed;
private int qamChordGeneration;
private volatile Runnable onPlayerInput;
@@ -100,6 +102,7 @@ public final class PadBridge {
}
public synchronized void stop() {
releaseBackPaddles();
activeControllerId = NO_CONTROLLER;
for (int slot = 0; slot < SLOTS; slot++) {
owners[slot] = NO_CONTROLLER;
@@ -113,7 +116,7 @@ public final class PadBridge {
systemGuidePressed = false;
systemQamPressed = false;
qamChordActive = false;
qamSyntheticAPressed = false;
chordButtonPressed = false;
qamTapPressed = false;
qamChordGeneration++;
if (open) {
@@ -243,6 +246,12 @@ public final class PadBridge {
case KeyEvent.KEYCODE_BUTTON_THUMBR: pad.press(9, pressed); break;
case KeyEvent.KEYCODE_BUTTON_MODE:
case KeyEvent.KEYCODE_HOME: pad.press(PadState.GUIDE, pressed); break;
case KeyEvent.KEYCODE_BUTTON_Z:
if (isPrimary(event)) DeckControls.INSTANCE.setGrip(DeckControls.L4, pressed);
break;
case KeyEvent.KEYCODE_BUTTON_C:
if (isPrimary(event)) DeckControls.INSTANCE.setGrip(DeckControls.R4, pressed);
break;
case KeyEvent.KEYCODE_BUTTON_L2: pad.leftTrigger = pressed ? 1f : 0f; break;
case KeyEvent.KEYCODE_BUTTON_R2: pad.rightTrigger = pressed ? 1f : 0f; break;
case KeyEvent.KEYCODE_DPAD_UP: pad.up = pressed; break;
@@ -269,12 +278,27 @@ public final class PadBridge {
scheduleStats();
pad.leftX = axis(event, MotionEvent.AXIS_X);
pad.leftY = axis(event, MotionEvent.AXIS_Y);
pad.rightX = axis(event, MotionEvent.AXIS_Z);
pad.rightY = axis(event, MotionEvent.AXIS_RZ);
float lt = event.getAxisValue(MotionEvent.AXIS_LTRIGGER);
float rt = event.getAxisValue(MotionEvent.AXIS_RTRIGGER);
if (lt == 0f) lt = event.getAxisValue(MotionEvent.AXIS_BRAKE);
if (rt == 0f) rt = event.getAxisValue(MotionEvent.AXIS_GAS);
InputDevice device = event.getDevice();
boolean wiredXboxLayout = device != null
&& ((device.getVendorId() == 0x20d6 && device.getProductId() == 0x2063)
|| (device.getVendorId() == 0x0e6f && device.getProductId() == 0x02f0))
&& device.getMotionRange(MotionEvent.AXIS_RX, event.getSource()) != null
&& device.getMotionRange(MotionEvent.AXIS_RY, event.getSource()) != null
&& device.getMotionRange(MotionEvent.AXIS_Z, event.getSource()) != null
&& device.getMotionRange(MotionEvent.AXIS_RZ, event.getSource()) != null;
pad.rightX = axis(event, wiredXboxLayout ? MotionEvent.AXIS_RX : MotionEvent.AXIS_Z);
pad.rightY = axis(event, wiredXboxLayout ? MotionEvent.AXIS_RY : MotionEvent.AXIS_RZ);
float lt;
float rt;
if (wiredXboxLayout) {
lt = Math.max(0f, Math.min(1f, (event.getAxisValue(MotionEvent.AXIS_Z) + 1f) / 2f));
rt = Math.max(0f, Math.min(1f, (event.getAxisValue(MotionEvent.AXIS_RZ) + 1f) / 2f));
} else {
lt = event.getAxisValue(MotionEvent.AXIS_LTRIGGER);
rt = event.getAxisValue(MotionEvent.AXIS_RTRIGGER);
if (lt == 0f) lt = event.getAxisValue(MotionEvent.AXIS_BRAKE);
if (rt == 0f) rt = event.getAxisValue(MotionEvent.AXIS_GAS);
}
pad.leftTrigger = lt;
pad.rightTrigger = rt;
float hatX = event.getAxisValue(MotionEvent.AXIS_HAT_X);
@@ -317,11 +341,12 @@ public final class PadBridge {
boolean qamStarted = qamPressed && !systemQamPressed;
systemGuidePressed = guidePressed;
systemQamPressed = qamPressed;
if (qamStarted && !nativeQam()) startQamChord();
if (qamStarted && !nativeQam()) startChord(PadState.A);
else publish();
}
public synchronized void releaseAll() {
releaseBackPaddles();
state.clear();
publish();
for (int slot = 1; slot < SLOTS; slot++) {
@@ -343,7 +368,7 @@ public final class PadBridge {
public synchronized void triggerQam() {
if (!nativeQam()) {
startQamChord();
startChord(PadState.A);
return;
}
if (qamTapPressed) return;
@@ -359,12 +384,17 @@ public final class PadBridge {
publish();
}
private void startQamChord() {
public synchronized void triggerSteamKeyboard() {
startChord(PadState.X);
}
private void startChord(int button) {
if (qamChordActive) return;
qamChordActive = true;
chordButton = button;
int generation = ++qamChordGeneration;
publish();
chordHandler.postDelayed(() -> pressQamA(generation), qamGuideLeadMs());
chordHandler.postDelayed(() -> pressChordButton(generation), qamGuideLeadMs());
}
static long qamGuideLeadMs() {
@@ -373,16 +403,16 @@ public final class PadBridge {
return Math.max(QAM_GUIDE_LEAD_MIN_MS, Math.min(QAM_GUIDE_LEAD_MAX_MS, frame * QAM_GUIDE_LEAD_FRAMES));
}
private synchronized void pressQamA(int generation) {
private synchronized void pressChordButton(int generation) {
if (generation != qamChordGeneration || !qamChordActive) return;
qamSyntheticAPressed = true;
chordButtonPressed = true;
publish();
chordHandler.postDelayed(() -> releaseQamA(generation), QAM_A_HOLD_MS);
chordHandler.postDelayed(() -> releaseChordButton(generation), QAM_A_HOLD_MS);
}
private synchronized void releaseQamA(int generation) {
private synchronized void releaseChordButton(int generation) {
if (generation != qamChordGeneration || !qamChordActive) return;
qamSyntheticAPressed = false;
chordButtonPressed = false;
publish();
chordHandler.postDelayed(() -> releaseQamGuide(generation), QAM_GUIDE_TAIL_MS);
}
@@ -415,11 +445,21 @@ public final class PadBridge {
return slot == 0 ? state : playerStates[slot];
}
private boolean isPrimary(KeyEvent event) {
return owners[0] == event.getDevice().getId();
}
private void releaseBackPaddles() {
DeckControls.INSTANCE.setGrip(DeckControls.L4, false);
DeckControls.INSTANCE.setGrip(DeckControls.R4, false);
}
private void free(int slot) {
Log.i(TAG, "player " + (slot + 1) + " (id " + owners[slot] + ") left");
owners[slot] = NO_CONTROLLER;
slotControllers.set(slot, NO_CONTROLLER);
if (slot == 0) {
releaseBackPaddles();
state.clear();
publish();
return;
@@ -491,7 +531,7 @@ public final class PadBridge {
effectiveState.copyFrom(state);
if (guide) effectiveState.press(PadState.GUIDE, true);
if (qam) effectiveState.press(PadState.QAM, true);
if (qamSyntheticAPressed) effectiveState.press(PadState.A, true);
if (chordButtonPressed) effectiveState.press(chordButton, true);
writer.writePad(effectiveState);
}
@@ -158,7 +158,8 @@ object SteamTouchConfig {
fun load(context: Context, appId: Int): Config {
val dir = configDir(context)
val file = dir?.let { autosaveConfig(it, appId) }
val file = dir?.let { deviceConfig(context, it, appId) }
?: dir?.let { autosaveConfig(it, appId) }
?: loggedConfig(context, appId)?.takeIf { isTouchConfig(it) }
?: dir?.let { configsetConfig(context, it, appId) }
if (file == null) {
@@ -207,11 +208,16 @@ object SteamTouchConfig {
null
}
private fun configsetConfig(context: Context, dir: File, appId: Int): File? = try {
val set = KeyValues.parse(File(dir, CONFIGSET).readText()).child("controller_config")?.child(appId.toString())
private fun configsetConfig(context: Context, dir: File, appId: Int): File? = entryConfig(context, dir, CONFIGSET, appId)
private fun deviceConfig(context: Context, dir: File, appId: Int): File? = entryConfig(context, dir, DEVICE_CONFIGSET, appId)
private fun entryConfig(context: Context, dir: File, configset: String, appId: Int): File? = try {
val set = KeyValues.parse(File(dir, configset).readText()).child("controller_config")?.child(appId.toString())
when {
set == null -> null
set.string("autosave") == "1" -> File(dir, "$appId/controller_mobile_touch.vdf")
set.string("workshop") != null -> workshopConfig(context, set.string("workshop")!!)
set.string("template") != null -> File(steamRoot(context), "controller_base/templates/" + set.string("template"))
else -> null
}?.takeIf { it.isFile }
@@ -219,7 +225,16 @@ object SteamTouchConfig {
null
}
internal fun workshopConfig(context: Context, id: String): File? {
if (!id.all(Char::isDigit)) return null
return File(steamRoot(context), "steamapps/workshop/content/$CONFIGS_APP/$id").listFiles()
?.filter { it.isFile && (it.name.endsWith(".vdf") || it.name.endsWith(".bin")) }
?.maxByOrNull { it.lastModified() }
}
private const val CONFIGSET = "configset_controller_mobile_touch.vdf"
private const val DEVICE_CONFIGSET = "configset_MT-DROIDDECK0001.vdf"
private const val CONFIGS_APP = 241100
private fun availability(mappings: KeyValues.Node): Map<Int, Set<Int>> {
@@ -363,10 +378,20 @@ object SteamTouchConfig {
tmp.writeText(text)
if (!tmp.renameTo(target)) return null
selectAutosave(dir, appId)
dropDeviceEntry(dir, appId)
Log.i(TAG, "steam touch: saved layouts ${sets.keys} for app $appId to ${target.path}")
return target
}
private fun dropDeviceEntry(dir: File, appId: Int) {
val file = File(dir, DEVICE_CONFIGSET)
if (!file.isFile) return
val text = file.readText()
val block = Regex("""\n\s*"$appId"\s*\{[^}]*\}""")
if (!block.containsMatchIn(text)) return
File(file.path + ".tmp").apply { writeText(text.replace(block, "")) }.renameTo(file)
}
private fun selectAutosave(dir: File, appId: Int) {
val file = File(dir, CONFIGSET)
val text = if (file.isFile) file.readText() else "\"controller_config\"\n{\n}\n"
@@ -0,0 +1,55 @@
package com.droiddeck.launcher.input
import android.view.MotionEvent
import kotlin.math.hypot
class ThreeFingerTap(private val slopPx: Float) {
var active = false
private set
private val starts = HashMap<Int, Pair<Float, Float>>()
private var downAt = 0L
private var threeAt = 0L
private var valid = false
fun onTouch(event: MotionEvent): Boolean {
when (event.actionMasked) {
MotionEvent.ACTION_DOWN -> {
starts.clear()
active = false
valid = true
downAt = event.eventTime
note(event, event.actionIndex)
}
MotionEvent.ACTION_POINTER_DOWN -> {
note(event, event.actionIndex)
if (event.pointerCount > 3) valid = false
if (event.pointerCount == 3 && !active) {
active = true
threeAt = event.eventTime
if (threeAt - downAt > LAND_MS) valid = false
}
}
MotionEvent.ACTION_MOVE -> for (i in 0 until event.pointerCount) {
val start = starts[event.getPointerId(i)] ?: continue
if (hypot(event.getX(i) - start.first, event.getY(i) - start.second) > slopPx) valid = false
}
MotionEvent.ACTION_UP -> {
val fired = active && valid && event.eventTime - threeAt < TAP_MS
active = false
return fired
}
MotionEvent.ACTION_CANCEL -> active = false
}
return false
}
private fun note(event: MotionEvent, index: Int) {
starts[event.getPointerId(index)] = event.getX(index) to event.getY(index)
}
private companion object {
const val LAND_MS = 250L
const val TAP_MS = 350L
}
}
@@ -230,9 +230,31 @@ public final class LinuxRuntimeInstaller {
}
}
/**
* The download is named after the release, so a partial file is only ever resumed for the same
* version and checksum, never for a different runtime that happens to share a fixed name.
*/
static String archiveName(Release release) {
String version = release.version.replaceAll("[^A-Za-z0-9._-]", "_");
String sum = release.sha256.replaceAll("[^A-Za-z0-9]", "");
if (sum.length() > 12) sum = sum.substring(0, 12);
return "linuxfs-" + version + "-" + sum + ".tar.zst";
}
/** Removes archives left by other releases and by builds that used the fixed name. */
private static void deleteOtherArchives(File dir, String keep) {
File[] files = dir.listFiles((d, name) -> name.startsWith("linuxfs") && name.endsWith(".tar.zst") && !name.equals(keep));
if (files == null) return;
for (File file : files) file.delete();
}
private static boolean installOnce(Context context, Release release, ProgressListener listener) {
File archive = new File(context.getCacheDir(), "linuxfs.tar.zst");
File archive = new File(context.getCacheDir(), archiveName(release));
// A failed download keeps what it fetched so the next attempt resumes it; anything that
// reached verification and failed is not trusted and is removed.
boolean keepPartial = false;
try {
deleteOtherArchives(context.getCacheDir(), archive.getName());
File pendingRemoval = removalDirectory(LinuxRuntime.rootDir(context));
if (pendingRemoval.exists() && listener != null) listener.onProgress(context.getString(R.string.rtinst_removing_leftovers), -1);
if (!discard(pendingRemoval, null)) throw new IOException("Cannot clear the previous runtime: " + pendingRemoval);
@@ -247,6 +269,7 @@ public final class LinuxRuntimeInstaller {
});
if (!ok) {
Log.w(TAG, "download failed");
keepPartial = true;
return false;
}
@@ -300,7 +323,7 @@ public final class LinuxRuntimeInstaller {
Log.e(TAG, "install", e);
return false;
} finally {
archive.delete();
if (!keepPartial) archive.delete();
}
}
@@ -45,8 +45,9 @@ class BatteryComponent(val dir: File, private val vpowerDir: File) : SessionPart
val tempDeci = sticky?.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, 0) ?: 0
val tech = sticky?.getStringExtra(BatteryManager.EXTRA_TECHNOLOGY)?.takeIf { it.isNotBlank() } ?: "Li-ion"
val chargeNowUah = bm?.getLongProperty(BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER)?.takeIf { it > 0 && it != Long.MIN_VALUE } ?: 0L
val currentNowUa = bm?.getLongProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_NOW)?.takeIf { it != Long.MIN_VALUE } ?: 0L
val currentAvgUa = bm?.getLongProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_AVERAGE)?.takeIf { it != Long.MIN_VALUE && it != 0L } ?: currentNowUa
val currentNowUa = toMicroamps(bm?.getLongProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_NOW)?.takeIf { it != Long.MIN_VALUE } ?: 0L)
val currentAvgUa = toMicroamps(bm?.getLongProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_AVERAGE)?.takeIf { it != Long.MIN_VALUE && it != 0L } ?: 0L)
.takeIf { it != 0L } ?: currentNowUa
val discharging = status == BatteryManager.BATTERY_STATUS_DISCHARGING || status == BatteryManager.BATTERY_STATUS_NOT_CHARGING
val chargeFullUah = if (chargeNowUah > 0 && pct > 0) chargeNowUah * 100 / pct else 0L
val energyNowUwh = chargeNowUah * voltageUv / 1_000_000L
@@ -125,6 +126,12 @@ class BatteryComponent(val dir: File, private val vpowerDir: File) : SessionPart
companion object {
private const val TAG = "SessionService"
// CURRENT_NOW/CURRENT_AVERAGE are documented as µA, but Samsung and other vendors report mA,
// which made every lifetime estimate 1000x too long. No real µA reading under load is below 10 mA,
// and no mA reading is above 10 A, so anything smaller than 10_000 is taken as mA.
private const val MILLIAMP_CEILING = 10_000L
internal fun toMicroamps(raw: Long): Long = if (abs(raw) < MILLIAMP_CEILING) raw * 1000L else raw
private const val PERIOD_MS = 5_000L
private val VPOWER_FILES = listOf(
"ac_status", "battery_percent", "battery_status",
@@ -29,7 +29,7 @@ object ProtonExtras {
val tools = listOf(
Tool("ge", "GE-Proton", "GE-Proton", "GloriousEggroll/proton-ge-custom", Regex("aarch64\\.tar\\.(gz|xz)$")),
Tool("cachyos", "proton-cachyos", "proton-cachyos", "CachyOS/proton-cachyos", Regex("arm64\\.tar\\.(gz|xz)$")),
Tool("droiddeck", "DroidDeck-Proton", "DroidDeck-Proton", "The412Banner/DroidDeck-Proton", Regex("aarch64\\.tar\\.(gz|xz)$")),
Tool("droiddeck", "DroidDeck-Proton", "DroidDeck-Proton", "Droid-Deck/DroidDeck-Proton", Regex("aarch64\\.tar\\.(gz|xz)$")),
)
private fun home(context: Context) = File(LinuxRuntime.rootDir(context), "root")
@@ -24,6 +24,22 @@ object QuestExperimental {
fun isSupported(): Boolean = supported(Build.MODEL, Build.DEVICE, Build.MANUFACTURER)
fun isQuest2(): Boolean = quest2(Build.MODEL, Build.DEVICE, Build.MANUFACTURER)
fun defaultAndroidDriver(): String? = when {
!isSupported() -> null
isQuest2() -> DRIVER_A6XX
else -> DRIVER
}
fun applyAutoDrivers(context: Context): Boolean {
if (SessionPrefs.gpuDriverMode(context) != SessionPrefs.GPU_DRIVERS_AUTO) return false
val driver = defaultAndroidDriver() ?: return false
context.getSharedPreferences("session", Context.MODE_PRIVATE).edit()
.putString("androidDriver", driver)
.putString("linuxDriver", "")
.apply()
return true
}
fun initialize(context: Context) {
if (!isSupported()) return
val prefs = context.getSharedPreferences("session", Context.MODE_PRIVATE)
@@ -119,7 +119,7 @@ object SessionArtifacts {
val lines = StringBuilder("rules ${LogRedactor.RULES_VERSION}\n")
record.files.forEach { (f, s) ->
lines.append(s.length).append('\t').append(s.modified).append('\t')
.append(f.relativeTo(dir).path).append('\n')
.append(f.relativeTo(dir).invariantSeparatorsPath).append('\n')
}
tree.writeText(lines.toString())
true
@@ -71,6 +71,8 @@ object SessionFiles {
"usr/local/bin/droiddeck-steam-games" to "usr/local/bin/droiddeck-steam-games",
"usr/local/bin/droiddeck-pad-defaults" to "usr/local/bin/droiddeck-pad-defaults",
"usr/local/bin/droiddeck-steamvr" to "usr/local/bin/droiddeck-steamvr",
"usr/local/bin/droiddeck-steamvr-settings" to "usr/local/bin/droiddeck-steamvr-settings",
"usr/local/bin/droiddeck-steamvr-game" to "usr/local/bin/droiddeck-steamvr-game",
"usr/local/bin/droiddeck-bwrap" to "usr/local/bin/droiddeck-bwrap",
"usr/local/bin/droiddeck-flatpak" to "usr/local/bin/droiddeck-flatpak",
"usr/local/bin/droiddeck-flatpak-setup" to "usr/local/bin/droiddeck-flatpak-setup",
@@ -104,6 +106,7 @@ object SessionFiles {
listOf("NOTICE", "GPL-2", "GPL-3", "LGPL-2.1", "7zip-License", "7zip-unRarLicense").map { "usr/local/share/licenses/droiddeck-msitools/$it" }
val vr = listOf(
"droiddeck/bin/linuxarm64/driver_droiddeck.so",
"droiddeck/bin/linuxarm64/xr-display-mode",
"droiddeck/driver.vrdrivermanifest",
"droiddeck/resources/settings/default.vrsettings",
"layer/libVkLayer_droiddeck_vr.so",
@@ -58,7 +58,7 @@ object SessionLogShare {
if (percent != shown) { shown = percent; onProgress?.invoke(percent / 100f) }
}
ZipOutputStream(zip.outputStream().buffered()).use { z ->
files.forEach { f -> addEntry(z, folder.name + "/" + f.relativeTo(folder).path, f); advance(f) }
files.forEach { f -> addEntry(z, folder.name + "/" + f.relativeTo(folder).invariantSeparatorsPath, f); advance(f) }
live.forEach { f -> addEntry(z, folder.name + "/steam/" + f.name, f); advance(f) }
stores.forEach { f -> addEntry(z, "$STORES_DIR/" + f.name, f); advance(f) }
tools.forEach { f -> addEntry(z, SessionPaths.TOOLS_DIR + "/" + f.name, f); advance(f) }
@@ -10,7 +10,7 @@ import java.util.Locale
object SessionPaths {
private const val TAG = "SessionPaths"
const val KEEP_SESSIONS = 30
const val KEEP_SESSIONS = 3
const val TOOLS_DIR = "tools"
@@ -104,6 +104,23 @@ object SessionPrefs {
prefs(context).edit().putBoolean("storesShowMature", show).apply()
}
fun storesSort(context: Context): String =
prefs(context).getString("storesSort", null)?.takeIf { it in STORES_SORTS } ?: STORES_SORTS.first()
fun setStoresSort(context: Context, sort: String) {
prefs(context).edit().putString("storesSort", if (sort in STORES_SORTS) sort else STORES_SORTS.first()).apply()
}
fun storesView(context: Context): String =
prefs(context).getString("storesView", null)?.takeIf { it in STORES_VIEWS } ?: STORES_VIEWS.first()
fun setStoresView(context: Context, view: String) {
prefs(context).edit().putString("storesView", if (view in STORES_VIEWS) view else STORES_VIEWS.first()).apply()
}
val STORES_SORTS = listOf("lastPlayed", "recentlyInstalled", "titleAsc", "titleDesc", "sizeDesc", "sizeAsc", "releaseDateDesc")
val STORES_VIEWS = listOf("cards", "list")
const val STORES_OPEN_LIBRARY = "library"
const val STORES_OPEN_STORE = "store"
@@ -130,6 +147,18 @@ object SessionPrefs {
private fun mangoappSession(context: Context) =
SessionState.mode == SessionService.MODE_STEAM && mangoapp(context)
fun lowLatencyController(context: Context): Boolean = prefs(context).getBoolean("lowLatencyController", false)
fun setLowLatencyController(context: Context, on: Boolean) {
prefs(context).edit().putBoolean("lowLatencyController", on).apply()
}
fun lowLatencyTouch(context: Context): Boolean = prefs(context).getBoolean("lowLatencyTouch", false)
fun setLowLatencyTouch(context: Context, on: Boolean) {
prefs(context).edit().putBoolean("lowLatencyTouch", on).apply()
}
fun backActionsInverted(context: Context): Boolean = prefs(context).getBoolean("backActionsInverted", false)
fun setBackActionsInverted(context: Context, inverted: Boolean) {
@@ -195,6 +224,15 @@ object SessionPrefs {
}
fun picturePosition(context: Context): String =
prefs(context).getString("picturePosition", "center")
?.takeIf { it in listOf("top", "bottom", "center") } ?: "center"
fun setPicturePosition(context: Context, position: String) {
prefs(context).edit().putString("picturePosition",
position.takeIf { it in listOf("top", "bottom", "center") } ?: "center").apply()
}
fun stretch16x9(context: Context): Boolean = prefs(context).getBoolean("stretch16x9", false)
fun setStretch16x9(context: Context, on: Boolean) {
@@ -71,6 +71,8 @@ class SessionService : Service() {
private var suspendPolicy = SessionPrefs.SUSPEND_MANUAL
private var steamDownloadsInBackground = false
private var activityVisible = true
private var xrActivityVisible = false
private val hasVisibleSurface get() = sessionHasVisibleSurface(activityVisible, screenOn, xrActivityVisible)
private var screenOn = true
private var manualPauseRequested = false
private var steamSleepToken: String? = null
@@ -170,6 +172,17 @@ class SessionService : Service() {
updateSuspendPolicy()
return START_NOT_STICKY
}
ACTION_XR_ACTIVITY_VISIBLE -> {
xrActivityVisible = true
resumeSession(panelVisible = false)
return START_NOT_STICKY
}
ACTION_XR_ACTIVITY_HIDDEN -> {
xrActivityVisible = false
suspendAttemptFailed = false
updateSuspendPolicy()
return START_NOT_STICKY
}
ACTION_SUSPEND_POLICY_CHANGED -> {
if (!SessionState.running) return START_NOT_STICKY
suspendPolicy = SessionPrefs.suspendPolicy(this, SessionState.mode)
@@ -205,6 +218,7 @@ class SessionService : Service() {
suspendPolicy = SessionPrefs.suspendPolicy(this, SessionState.mode)
steamDownloadsInBackground = SessionPrefs.steamDownloadsInBackground(this)
activityVisible = true
xrActivityVisible = false
screenOn = (getSystemService(Context.POWER_SERVICE) as? PowerManager)?.isInteractive ?: true
manualPauseRequested = false
suspendDownloadNow = false
@@ -610,6 +624,7 @@ class SessionService : Service() {
SessionState.deckPad = deckBinds.isNotEmpty()
if (wantsDeck && !SessionState.deckPad) Log.w(TAG, "deck pad: not available this session; the pad stays an Xbox 360 controller")
logControllersAtStart()
com.droiddeck.launcher.input.FakeInputWriter.setLowLatency(SessionPrefs.lowLatencyController(this), SessionPrefs.lowLatencyTouch(this))
if (uinput) {
guest.add("FAKE_EVDEV_UINPUT=1")
if (SessionState.deckPad) {
@@ -918,8 +933,8 @@ class SessionService : Service() {
Log.i(TAG, "queued Steam game $gameId for the running client")
}
private fun resumeSession() {
activityVisible = true
private fun resumeSession(panelVisible: Boolean = true) {
if (panelVisible) activityVisible = true
screenOn = (getSystemService(Context.POWER_SERVICE) as? PowerManager)?.isInteractive ?: screenOn
manualPauseRequested = false
suspendDownloadNow = false
@@ -1110,11 +1125,11 @@ class SessionService : Service() {
private fun updateSuspendPolicy() {
if (!SessionState.running) return
if (suspendPolicy == SessionPrefs.SUSPEND_MANUAL && (!activityVisible || !screenOn)) {
if (suspendPolicy == SessionPrefs.SUSPEND_MANUAL && !hasVisibleSurface) {
manualPauseRequested = true
}
val controller = suspendController ?: return
val hidden = !activityVisible || !screenOn
val hidden = !hasVisibleSurface
val downloadsBlockingSuspend = steamDownloadsInBackground && SessionState.mode == MODE_STEAM &&
suspendPolicy != SessionPrefs.SUSPEND_NEVER && hidden && downloadActive && !suspendDownloadNow
if (downloadsBlockingSuspend) acquireLocks()
@@ -1136,6 +1151,7 @@ class SessionService : Service() {
SessionEvents.record(if (shouldSuspend) "session.suspend_requested" else "session.resume_requested", mapOf(
"policy" to suspendPolicy, "activityVisible" to activityVisible,
"screenOn" to screenOn, "steamSleep" to (steamSleepToken != null),
"xrActivityVisible" to xrActivityVisible,
"nativeSleep" to (nativeSleepToken != null),
))
if (shouldSuspend) {
@@ -1193,7 +1209,7 @@ class SessionService : Service() {
}
private fun resumeSteamSleepOnReturn() {
if (suspendPolicy in setOf(SessionPrefs.SUSPEND_AUTO, SessionPrefs.SUSPEND_NATIVE) && activityVisible && screenOn) {
if (suspendPolicy in setOf(SessionPrefs.SUSPEND_AUTO, SessionPrefs.SUSPEND_NATIVE) && hasVisibleSurface) {
if (steamSleepToken == null && (nativeSleepToken == null || nativeSleepFallback)) requestSteamWake()
completeNativeSleep()
completeSteamSleep()
@@ -1304,6 +1320,7 @@ class SessionService : Service() {
if (!SessionState.running) return
SessionState.running = false
}
xrActivityVisible = false
updateDownloadMonitoring()
val stoppedGen = sessionGen
val stoppedSession = SessionState.sessionId
@@ -1356,8 +1373,8 @@ class SessionService : Service() {
}
override fun onTaskRemoved(rootIntent: Intent?) {
if (pipTask) {
Log.i(TAG, "PiP task dismissed - retaining the session under its background policy")
if (pipTask || xrActivityVisible) {
Log.i(TAG, "panel task dismissed - retaining the session under its active surface policy")
activityVisible = false
updateSuspendPolicy()
return
@@ -1558,6 +1575,8 @@ class SessionService : Service() {
private const val ACTION_SUSPEND_POLICY_CHANGED = "com.droiddeck.launcher.SUSPEND_POLICY_CHANGED"
private const val ACTION_ACTIVITY_VISIBLE = "com.droiddeck.launcher.ACTIVITY_VISIBLE"
private const val ACTION_ACTIVITY_HIDDEN = "com.droiddeck.launcher.ACTIVITY_HIDDEN"
private const val ACTION_XR_ACTIVITY_VISIBLE = "com.droiddeck.launcher.XR_ACTIVITY_VISIBLE"
private const val ACTION_XR_ACTIVITY_HIDDEN = "com.droiddeck.launcher.XR_ACTIVITY_HIDDEN"
private const val ACTION_TRACK_AUXILIARY = "com.droiddeck.launcher.TRACK_AUXILIARY"
private const val ACTION_STOP_AUXILIARY = "com.droiddeck.launcher.STOP_AUXILIARY"
private const val ACTION_AUXILIARY_EXITED = "com.droiddeck.launcher.AUXILIARY_EXITED"
@@ -1617,6 +1636,12 @@ class SessionService : Service() {
context.startService(Intent(context, SessionService::class.java).setAction(action))
}
fun setXrActivityVisible(context: Context, visible: Boolean) {
if (!SessionState.running) return
val action = if (visible) ACTION_XR_ACTIVITY_VISIBLE else ACTION_XR_ACTIVITY_HIDDEN
context.startService(Intent(context, SessionService::class.java).setAction(action))
}
fun resume(context: Context) {
if (!SessionState.running) return
context.startService(Intent(context, SessionService::class.java).setAction(ACTION_RESUME))
@@ -0,0 +1,4 @@
package com.droiddeck.launcher.session
internal fun sessionHasVisibleSurface(panelVisible: Boolean, screenOn: Boolean, xrVisible: Boolean): Boolean =
xrVisible || (panelVisible && screenOn)
@@ -13,7 +13,7 @@ object SettingsReset {
"orientation", "launcherFullscreen", "animations", "theme", "runSteamAtStartup", "addedGamesArt",
"gameStoresEnabled", "gameStoresSpeedTier", "gameStoresParallel", "storesOpenTab", "storesShowMature",
"hud", "hudDeck", "backActionsInverted", "touch", "osc", "shape", "steamController",
"gamepadLeft", "gamepadRight", "pipAutoEnter", "unfoldedControls", "stretch16x9",
"gamepadLeft", "gamepadRight", "pipAutoEnter", "unfoldedControls", "stretch16x9", "picturePosition",
"gpuDriverMode", "androidDriver", "linuxDriver", "linuxDriver.steam", "linuxDriver.desktop",
"tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime",
"directAudio", "mic", "wifiDiscovery", "clientCpusOverride", "clientCpus", "gameCpus",
@@ -31,6 +31,7 @@ class StoreShelves(
val deals: List<CatalogItem> = emptyList(),
val free: List<CatalogItem> = emptyList(),
val trending: List<CatalogItem> = emptyList(),
val art: List<String> = emptyList(),
) {
val isEmpty: Boolean get() = whatsNew.isEmpty() && deals.isEmpty() && free.isEmpty() && trending.isEmpty()
val all: List<CatalogItem> get() = (whatsNew + deals + free + trending).distinctBy { it.id }
@@ -52,6 +53,35 @@ fun installedCards(store: Store, installed: List<InstalledStoreGame>, library: L
}.distinctBy { it.id }.sortedBy { it.title.lowercase() }
}
private fun releaseDateValue(item: CatalogItem): Long =
item.releaseDate.take(10).takeIf { it.length == 10 }?.let { raw ->
runCatching { java.time.LocalDate.parse(raw).toEpochDay() }.getOrDefault(0L)
} ?: 0L
fun sortCatalogItems(
items: List<CatalogItem>,
sort: String,
lastPlayed: (CatalogItem) -> Long = { 0L },
installedAt: (CatalogItem) -> Long = { 0L },
size: (CatalogItem) -> Long = { it.sizeBytes },
): List<CatalogItem> = when (sort) {
"lastPlayed" -> items.sortedWith(compareByDescending(lastPlayed).thenBy { it.title.lowercase() })
"recentlyInstalled" -> items.sortedWith(compareByDescending(installedAt).thenBy { it.title.lowercase() })
"titleAsc" -> items.sortedBy { it.title.lowercase() }
"titleDesc" -> items.sortedByDescending { it.title.lowercase() }
"sizeDesc" -> items.sortedWith(compareByDescending(size).thenBy { it.title.lowercase() })
"sizeAsc" -> items.sortedWith(compareBy<CatalogItem> { size(it).takeIf { b -> b > 0 } ?: Long.MAX_VALUE }.thenBy { it.title.lowercase() })
"releaseDateDesc" -> items.sortedWith(compareByDescending(::releaseDateValue).thenBy { it.title.lowercase() })
else -> items
}
internal fun retainCatalogOrder(items: List<CatalogItem>, previous: List<CatalogItem>): List<CatalogItem> {
if (items.size != previous.size) return items
val byKey = items.associateBy { it.key }
if (previous.any { it.key !in byKey }) return items
return previous.map { byKey.getValue(it.key) }
}
fun mergeItems(old: List<CatalogItem>?, new: List<CatalogItem>): List<CatalogItem> {
if (old.isNullOrEmpty()) return new
val before = old.associateBy { it.key }
@@ -12,6 +12,7 @@ import com.droiddeck.launcher.stores.epic.EpicCredentialStore
import com.droiddeck.launcher.stores.epic.EpicDownloadManager
import com.droiddeck.launcher.stores.epic.EpicInstallTags
import com.droiddeck.launcher.stores.epic.EpicPrefs
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.Executors
@@ -20,7 +21,8 @@ object StoreSizes {
val known = mutableStateMapOf<String, Long>()
private val asked = ConcurrentHashMap.newKeySet<String>()
private val sizeRequests = ConcurrentHashMap<String, CompletableFuture<Long?>>()
private val diskRequests = ConcurrentHashMap<String, CompletableFuture<Long?>>()
private val pool = Executors.newFixedThreadPool(3, com.droiddeck.launcher.stores.download.DownloadQueue.workerFactory("sizes"))
fun size(item: CatalogItem): Long = known[item.key] ?: item.sizeBytes
@@ -29,22 +31,35 @@ object StoreSizes {
private fun cache(context: Context, store: Store) = caches.getOrPut(store) { SizeCache.forStore(context.applicationContext.filesDir, store) }
fun request(context: Context, item: CatalogItem) {
if (!item.owned || item.sizeBytes > 0 || item.store == Store.GOG) return
if (known.containsKey(item.key) || !asked.add(item.key)) return
if (!item.owned || item.sizeBytes > 0 || item.store == Store.GOG || known.containsKey(item.key)) return
resolve(context, item).thenAccept { bytes ->
if (bytes != null) StoresState.post { known[item.key] = bytes }
}
}
fun resolve(context: Context, item: CatalogItem): CompletableFuture<Long?> {
val available = known[item.key] ?: item.sizeBytes.takeIf { it > 0 }
if (!item.owned || item.store == Store.GOG || item.sizeBytes > 0) return CompletableFuture.completedFuture(available)
if (available != null) return CompletableFuture.completedFuture(available)
val app = context.applicationContext
val version = item.extra["version"].orEmpty()
pool.execute {
val cached = cache(app, item.store).get(item.id, version)
if (cached != null) { StoresState.post { known[item.key] = cached }; return@execute }
val bytes = runCatching { fetch(app, item) }.onFailure { Log.w(TAG, "${item.key}: ${it.javaClass.simpleName}") }.getOrNull() ?: 0L
if (bytes > 0) {
cache(app, item.store).put(item.id, version, bytes)
when (item.store) {
Store.EPIC -> EpicPrefs.get(app).edit().putLong("size_${item.id}", bytes).apply()
Store.AMAZON -> AmazonPrefs.get(app).edit().putLong("size_${item.id}", bytes).apply()
Store.GOG -> {}
return sizeRequests.computeIfAbsent(item.key) {
CompletableFuture.supplyAsync({
val cached = cache(app, item.store).get(item.id, version)
val bytes = cached ?: runCatching { fetch(app, item) }
.onFailure { Log.w(TAG, "${item.key}: ${it.javaClass.simpleName}") }
.getOrNull()
bytes?.takeIf { it > 0 }?.also {
cache(app, item.store).put(item.id, version, it)
when (item.store) {
Store.EPIC -> EpicPrefs.get(app).edit().putLong("size_${item.id}", it).apply()
Store.AMAZON -> AmazonPrefs.get(app).edit().putLong("size_${item.id}", it).apply()
Store.GOG -> {}
}
}
StoresState.post { known[item.key] = bytes }
}, pool).exceptionally { error ->
Log.w(TAG, "${item.key}: size resolution failed", error)
null
}
}
}
@@ -52,14 +67,25 @@ object StoreSizes {
val onDisk = mutableStateMapOf<String, Long>()
fun requestDisk(context: Context, key: String, game: InstalledStoreGame) {
if (onDisk.containsKey(key) || !asked.add("disk:$key")) return
resolveDisk(context, key, game).thenAccept { bytes ->
if (bytes != null) StoresState.post { onDisk[key] = bytes }
}
}
fun resolveDisk(context: Context, key: String, game: InstalledStoreGame): CompletableFuture<Long?> {
onDisk[key]?.let { return CompletableFuture.completedFuture(it) }
val app = context.applicationContext
val version = "disk:${game.sidecar.installedAt}:${game.sidecar.installVersion}"
pool.execute {
val c = cache(app, game.sidecar.store)
val bytes = c.get("disk:${game.sidecar.id}", version)
?: game.folder.walkTopDown().filter { it.isFile && !it.name.startsWith(".droiddeck") }.sumOf { it.length() }.also { c.put("disk:${game.sidecar.id}", version, it) }
if (bytes > 0) StoresState.post { onDisk[key] = bytes }
return diskRequests.computeIfAbsent(key) {
CompletableFuture.supplyAsync({
val c = cache(app, game.sidecar.store)
c.get("disk:${game.sidecar.id}", version)
?: game.folder.walkTopDown().filter { it.isFile && !it.name.startsWith(".droiddeck") }
.sumOf { it.length() }.also { c.put("disk:${game.sidecar.id}", version, it) }
}, pool).thenApply { it.takeIf { bytes -> bytes > 0 } }.exceptionally { error ->
Log.w(TAG, "$key: disk size resolution failed", error)
null
}
}
}
@@ -233,7 +233,10 @@ object StoresState {
val overlay = java.io.File(com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context), "root/.local/share/droiddeck/epic-overlay")
if (overlay.exists()) Thread({ overlay.deleteRecursively(); Log.i(TAG, "removed the old EOS overlay download") }, "epic-overlay-cleanup").start()
val app = context.applicationContext
Thread({ CloudSaves.uploadAllDirty(app, "recovery") }, "cloud-recovery").start()
Thread({
runCatching { CloudSaves.uploadAllDirty(app, "recovery") }
.onFailure { Log.w(TAG, "cloud save recovery failed", it) }
}, "cloud-recovery").start()
}
internal fun post(block: () -> Unit) = main.post(block)
@@ -55,7 +55,20 @@ object AmazonBackend : StoreBackend {
Thread({ AmazonLibrary.sync(app, force) }, "amazon-sync").start()
}
override fun loadShelves(context: Context, force: Boolean) {}
override fun loadShelves(context: Context, force: Boolean) {
val app = context.applicationContext
AmazonShelves.cached(app)?.let { s -> StoresState.post { withArt(s.art) } }
Thread({
val shelves = AmazonShelves.featured(app, force)
if (shelves != null) StoresState.post { withArt(shelves.art) }
}, "amazon-shelves").start()
}
private fun withArt(art: List<String>) {
val s = StoresState.shelves[store]
StoresState.shelves[store] = if (s == null) com.droiddeck.launcher.stores.StoreShelves(art = art)
else com.droiddeck.launcher.stores.StoreShelves(s.whatsNew, s.deals, s.free, s.trending, art)
}
override fun install(context: Context, item: CatalogItem, root: java.io.File) {
val app = context.applicationContext
@@ -102,7 +102,7 @@ object AmazonLibrary {
StoresState.post {
StoresState.library[store] = mergeItems(StoresState.library[store], items)
val installed = StoresState.installed.filter { it.sidecar.store == store }.map { it.sidecar.id }.toSet()
StoresState.shelves[store] = StoreShelves(trending = items.filterNot { it.id in installed })
StoresState.shelves[store] = StoreShelves(trending = items.filterNot { it.id in installed }, art = StoresState.shelves[store]?.art.orEmpty())
}
}
@@ -0,0 +1,92 @@
package com.droiddeck.launcher.stores.amazon
import android.content.Context
import android.util.Log
import com.droiddeck.launcher.stores.StoreNet
import com.droiddeck.launcher.stores.StoreShelves
import org.json.JSONArray
import org.json.JSONObject
import java.net.HttpURLConnection
import java.net.URL
object AmazonShelves {
private const val TAG = "AmazonShelves"
private const val PAGE = "https://luna.amazon.com/claims/home"
private const val GRAPHQL = "https://luna.amazon.com/graphql"
private const val KEY_ART = "store_art"
private const val KEY_ART_AT = "store_art_at"
private const val FRESH_MS = 3 * 60 * 60 * 1000L
private const val QUERY = "query { items(collectionType: FEATURED_CONTENT, pageSize: 50) { items { assets { title " +
"cardMedia { defaultMedia { src1x src2x } } } } } }"
@Volatile private var memory: StoreShelves? = null
fun cached(context: Context): StoreShelves? =
memory ?: fromPrefs(AmazonPrefs.get(context).getString(KEY_ART, null))?.also { memory = it }
fun featured(context: Context, force: Boolean): StoreShelves? {
val prefs = AmazonPrefs.get(context)
if (!force && System.currentTimeMillis() - prefs.getLong(KEY_ART_AT, 0L) in 0 until FRESH_MS) cached(context)?.let { return it }
val art = runCatching { fetch() }.onFailure { Log.w(TAG, "featured: ${it.javaClass.simpleName}") }.getOrNull().orEmpty()
if (art.isEmpty()) return cached(context)
prefs.edit().putString(KEY_ART, JSONArray(art).toString()).putLong(KEY_ART_AT, System.currentTimeMillis()).apply()
Log.i(TAG, "featured art: ${art.size}")
return StoreShelves(art = art).also { memory = it }
}
private fun fromPrefs(text: String?): StoreShelves? {
val a = runCatching { JSONArray(text ?: return null) }.getOrNull() ?: return null
val art = List(a.length()) { a.optString(it) }.filter { it.isNotEmpty() }
return if (art.isEmpty()) null else StoreShelves(art = art)
}
private fun fetch(): List<String> {
val (page, cookies) = openPage() ?: return emptyList()
val token = Regex("""name=['"]csrf-key['"] value=['"]([^'"]+)['"]""").find(page)?.groupValues?.get(1) ?: run {
Log.w(TAG, "claims page had no csrf key")
return emptyList()
}
val body = StoreNet.postJson(
GRAPHQL, JSONObject().put("query", QUERY).toString(),
headers = mapOf("client-id" to "CarboniteApp", "csrf-token" to token, "Cookie" to cookies, "Origin" to "https://luna.amazon.com", "Referer" to PAGE),
) ?: return emptyList()
val items = JSONObject(body).optJSONObject("data")?.optJSONObject("items")?.optJSONArray("items") ?: return emptyList()
return (0 until items.length()).mapNotNull { i ->
val media = items.optJSONObject(i)?.optJSONObject("assets")?.optJSONObject("cardMedia")?.optJSONObject("defaultMedia")
media?.optString("src2x")?.takeIf { it.isNotEmpty() } ?: media?.optString("src1x")?.takeIf { it.isNotEmpty() }
}.distinct()
}
private fun openPage(): Pair<String, String>? {
val jar = LinkedHashMap<String, String>()
var url = PAGE
repeat(5) {
val conn = (URL(url).openConnection() as HttpURLConnection).apply {
connectTimeout = 20_000
readTimeout = 20_000
instanceFollowRedirects = false
setRequestProperty("User-Agent", StoreNet.BROWSER_UA)
setRequestProperty("Accept", "text/html")
if (jar.isNotEmpty()) setRequestProperty("Cookie", jar.entries.joinToString("; ") { "${it.key}=${it.value}" })
}
try {
val code = conn.responseCode
conn.headerFields["Set-Cookie"].orEmpty().forEach { c ->
val pair = c.substringBefore(';')
val name = pair.substringBefore('=').trim()
if (name.isNotEmpty() && '=' in pair) jar[name] = pair.substringAfter('=')
}
if (code in 300..399) {
url = URL(URL(url), conn.getHeaderField("Location") ?: return null).toString()
return@repeat
}
if (code !in 200..299) { Log.w(TAG, "claims page $code"); return null }
val page = conn.inputStream.bufferedReader().use { it.readText() }
return page to jar.entries.joinToString("; ") { "${it.key}=${it.value}" }
} finally {
runCatching { conn.disconnect() }
}
}
return null
}
}
@@ -64,14 +64,16 @@ object EpicShelves {
val a = o.optJSONArray(key) ?: return emptyList()
return (0 until a.length()).mapNotNull { a.optJSONObject(it) }.mapNotNull(::itemFrom).distinctBy { it.id }
}
val s = StoreShelves(shelf("new"), shelf("deals"), shelf("free"), shelf("trending"))
return if (s.isEmpty) null else s
val art = o.optJSONArray("art")?.let { a -> List(a.length()) { a.optString(it) }.filter { it.isNotEmpty() } }.orEmpty()
val s = StoreShelves(shelf("new"), shelf("deals"), shelf("free"), shelf("trending"), art)
return if (s.isEmpty && art.isEmpty()) null else s
}
fun toJson(s: StoreShelves): String = JSONObject().apply {
listOf(s.whatsNew, s.deals, s.free, s.trending).zip(SHELF_KEYS).forEach { (items, key) ->
put(key, JSONArray().apply { items.forEach { put(itemJson(it)) } })
}
put("art", JSONArray(s.art))
}.toString()
fun cached(context: Context): StoreShelves? =
@@ -111,6 +113,6 @@ object EpicShelves {
releaseDate = owned.releaseDate.ifBlank { shelf.releaseDate },
)
}
return StoreShelves(mark(s.whatsNew), mark(s.deals), mark(s.free), mark(s.trending))
return StoreShelves(mark(s.whatsNew), mark(s.deals), mark(s.free), mark(s.trending), s.art)
}
}
@@ -62,7 +62,7 @@ object GogBackend : StoreBackend {
private fun markOwned(s: com.droiddeck.launcher.stores.StoreShelves): com.droiddeck.launcher.stores.StoreShelves {
val owned = StoresState.library[store]?.associateBy { it.id } ?: return s
fun mark(l: List<CatalogItem>) = l.map { i -> owned[i.id]?.let { o -> i.copy(owned = true, sizeBytes = o.sizeBytes) } ?: i }
return com.droiddeck.launcher.stores.StoreShelves(mark(s.whatsNew), mark(s.deals), mark(s.free), mark(s.trending))
return com.droiddeck.launcher.stores.StoreShelves(mark(s.whatsNew), mark(s.deals), mark(s.free), mark(s.trending), s.art)
}
override fun install(context: Context, item: CatalogItem, root: File) {
@@ -22,6 +22,7 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.outlined.Image
import androidx.compose.material.icons.outlined.Search
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -56,6 +57,7 @@ import com.droiddeck.launcher.R
import com.droiddeck.launcher.frontend.AddedGameArt
import com.droiddeck.launcher.frontend.AddedGameEdits
import com.droiddeck.launcher.frontend.AddedGames
import com.droiddeck.launcher.frontend.SteamGridDb
import com.droiddeck.launcher.session.SessionPrefs
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@@ -356,9 +358,15 @@ private fun ArtChooserDialog(
val shown = rememberShown(onBack)
val back = { shown.targetState = false }
var options by remember { mutableStateOf<List<AddedGameArt.Option>?>(null) }
var sgdb by remember { mutableStateOf(SteamGridDb.Status.OK) }
var picking by remember { mutableStateOf(false) }
var searching by remember { mutableStateOf(false) }
val chosenRef = remember(current) { AddedGameArt.chosenSource(app, game, slot).second }
LaunchedEffect(slot) { options = withContext(Dispatchers.IO) { runCatching { AddedGameArt.options(app, game, slot) }.getOrDefault(emptyList()) } }
LaunchedEffect(slot) {
val found = withContext(Dispatchers.IO) { runCatching { AddedGameArt.choices(app, game, slot) }.getOrNull() }
options = found?.options ?: emptyList()
sgdb = found?.sgdb ?: SteamGridDb.Status.SERVER
}
val first = remember { FocusRequester() }
LaunchedEffect(Unit) { focusWithinFrames({ false }) { first } }
val apply: (AddedGameArt.Option) -> Unit = { option ->
@@ -394,7 +402,9 @@ private fun ArtChooserDialog(
}
}
}
if (sgdb != SteamGridDb.Status.OK) SgdbNote(sgdb)
}
PickerRow(Icons.Outlined.Search, stringResource(R.string.art_search_sgdb), null) { searching = true }
PickerRow(Icons.Outlined.Image, stringResource(R.string.art_pick_image), null, focus = if (opts?.isEmpty() != false) first else null) { picking = true }
PickerRow(null, stringResource(R.string.art_reset), null) {
scope.launch {
@@ -408,6 +418,136 @@ private fun ArtChooserDialog(
if (picking) ExePickerDialog(stringResource(R.string.art_pick_title, slotName), kind = PickKind.IMAGE, onDismiss = { picking = false }, onPick = { file ->
apply(AddedGameArt.Option(AddedGameArt.FILE, file.path, file.path))
})
if (searching) SgdbSearchDialog(
game, slot, current,
onBack = { searching = false }, onCloseAll = { searching = false; onCloseAll() }, onPick = apply,
)
}
@Composable
private fun SgdbNote(status: SteamGridDb.Status) {
val colors = MaterialTheme.colorScheme
val quiet = status == SteamGridDb.Status.NO_KEY || status == SteamGridDb.Status.NO_GAME
Text(
stringResource(
when (status) {
SteamGridDb.Status.NO_KEY -> R.string.art_sgdb_no_key
SteamGridDb.Status.BAD_KEY -> R.string.art_sgdb_bad_key
SteamGridDb.Status.LIMIT -> R.string.art_sgdb_limit
SteamGridDb.Status.OFFLINE -> R.string.art_sgdb_offline
SteamGridDb.Status.NO_GAME -> R.string.art_sgdb_no_game
else -> R.string.art_sgdb_server
},
),
fontSize = 12.sp, color = if (quiet) colors.onSurfaceVariant else colors.error, modifier = Modifier.padding(start = 2.dp, top = 4.dp),
)
}
@OptIn(ExperimentalLayoutApi::class)
@Composable
private fun SgdbSearchDialog(
game: AddedGames.Game, slot: AddedGameArt.Slot, current: AddedGameArt.SlotState?,
onBack: () -> Unit, onCloseAll: () -> Unit, onPick: (AddedGameArt.Option) -> Unit,
) {
val app = LocalContext.current.applicationContext
val colors = MaterialTheme.colorScheme
val scope = rememberCoroutineScope()
val shown = rememberShown(onBack)
val back = { shown.targetState = false }
var query by remember { mutableStateOf(game.name) }
var matches by remember { mutableStateOf<List<SteamGridDb.Game>?>(null) }
var picked by remember { mutableStateOf<SteamGridDb.Game?>(null) }
var images by remember { mutableStateOf<List<AddedGameArt.Option>>(emptyList()) }
var page by remember { mutableIntStateOf(0) }
var more by remember { mutableStateOf(false) }
var busy by remember { mutableStateOf(true) }
var status by remember { mutableStateOf(SteamGridDb.Status.OK) }
val chosenRef = remember(current) { AddedGameArt.chosenSource(app, game, slot).second }
val slotName = slot.label()
val showImages: (SteamGridDb.Game) -> Unit = { found ->
scope.launch {
picked = found
images = emptyList()
page = 0
more = false
busy = true
status = SteamGridDb.Status.OK
val result = withContext(Dispatchers.IO) { AddedGameArt.gameImages(app, found.id, slot, 0) }
images = result.items
status = result.status
more = result.items.isNotEmpty()
busy = false
}
}
val search: () -> Unit = {
scope.launch {
busy = true
picked = null
status = SteamGridDb.Status.OK
val result = withContext(Dispatchers.IO) { AddedGameArt.searchGames(app, query) }
matches = result.items
status = result.status
busy = false
val sure = result.items.firstOrNull { AddedGameArt.nameMatch(query, it.name) == 3 } ?: result.items.singleOrNull()
if (sure != null) showImages(sure)
}
}
val loadMore: () -> Unit = {
val found = picked
if (found != null && !busy) scope.launch {
busy = true
val result = withContext(Dispatchers.IO) { AddedGameArt.gameImages(app, found.id, slot, page + 1) }
val fresh = result.items.filter { next -> images.none { it.full == next.full } }
images = images + fresh
page += 1
more = fresh.isNotEmpty()
if (result.status != SteamGridDb.Status.OK) status = result.status
busy = false
}
}
LaunchedEffect(Unit) { search() }
AppDialog(shown, back, "sgdbSearch", wide = false, maxWidth = 460.dp) {
DialogTitleRow(stringResource(R.string.art_sgdb_title, slotName), onClose = { onCloseAll() }, leading = {
SmallIconButton(Icons.AutoMirrored.Filled.ArrowBack, stringResource(R.string.common_back), colors.onBackground, onClick = back)
})
androidx.compose.material3.OutlinedTextField(
query, { query = it }, singleLine = true, modifier = Modifier.fillMaxWidth(),
label = { Text(stringResource(R.string.art_sgdb_search_label)) },
keyboardActions = androidx.compose.foundation.text.KeyboardActions(onSearch = { search() }),
keyboardOptions = androidx.compose.foundation.text.KeyboardOptions(imeAction = androidx.compose.ui.text.input.ImeAction.Search),
)
val maxHeight = (LocalConfiguration.current.screenHeightDp * 0.6f).dp
Column(
verticalArrangement = Arrangement.spacedBy(8.dp),
modifier = Modifier.fillMaxWidth().heightIn(max = maxHeight).verticalScroll(rememberScrollState()),
) {
if (status != SteamGridDb.Status.OK) SgdbNote(status)
val chosenGame = picked
val list = matches.orEmpty()
if (chosenGame == null) {
for (match in list) key(match.id) { PickerRow(null, match.name, null) { showImages(match) } }
if (matches != null && list.isEmpty() && !busy && status == SteamGridDb.Status.OK) {
Text(stringResource(R.string.art_sgdb_none), fontSize = 12.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(start = 2.dp, top = 4.dp))
}
} else {
Text(chosenGame.name, fontSize = 12.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(start = 2.dp, top = 4.dp))
FlowRow(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
for (option in images) key(option.full) {
ArtOption(
slot, option, selected = current?.chosen == true && option.full == chosenRef, focus = null,
description = "${artSourceLabel(AddedGameArt.SGDB)} $slotName",
) { onPick(option) }
}
}
if (images.isEmpty() && !busy && status == SteamGridDb.Status.OK) {
Text(stringResource(R.string.art_sgdb_none), fontSize = 12.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(start = 2.dp, top = 4.dp))
}
if (more && !busy) PickerRow(null, stringResource(R.string.art_sgdb_more), null) { loadMore() }
if (list.size > 1) PickerRow(null, stringResource(R.string.art_sgdb_other_games), null) { picked = null }
}
if (busy) androidx.compose.material3.LinearProgressIndicator(Modifier.fillMaxWidth().padding(vertical = 8.dp))
}
}
}
@Composable
@@ -46,10 +46,10 @@ import kotlin.math.min
import kotlin.math.sin
@Composable
internal fun EmptyLibrary(avoid: Rect?, fade: @Composable () -> Unit) {
internal fun EmptyLibrary(avoid: Rect?, wall: (@Composable () -> Unit)? = null, fade: @Composable () -> Unit) {
val clock = rememberMarkClock(avoid)
Box(Modifier.fillMaxSize().onSizeChanged { clock.page = Size(it.width.toFloat(), it.height.toFloat()) }) {
EmptyWall(clock)
if (wall != null) wall() else EmptyWall(clock)
fade()
Mark(clock)
}
@@ -139,6 +139,8 @@ class FrontEndState(
val addedGamesArt: Boolean = true,
val sgdbUserKey: Boolean = false,
val storesShowMature: Boolean = false,
val storesSort: String = SessionPrefs.STORES_SORTS.first(),
val storesView: String = SessionPrefs.STORES_VIEWS.first(),
val storeDownloadsActive: Int = 0,
val updates: UpdatesState = UpdatesState(),
)
@@ -199,6 +201,8 @@ class FrontEndActions(
val onStoresOpenTab: (String) -> Unit = {},
val onNavigated: () -> Unit = {},
val onStoresShowMature: (Boolean) -> Unit = {},
val onStoresSort: (String) -> Unit = {},
val onStoresView: (String) -> Unit = {},
val onLibraryChanged: () -> Unit = {},
val onHomeApp: () -> Unit = {},
val onHomeScreen: (Boolean) -> Unit = {},
@@ -77,6 +77,7 @@ class ModeSettings(
val fexPreset: String? = null,
val forceSsbs: Boolean = false,
val syncBackend: String? = null,
val picturePosition: String? = null,
val stretch16x9: Boolean? = null,
val steamRepairQueued: Boolean = false,
val mangoapp: Boolean = true,
@@ -120,6 +121,7 @@ class ModeSettingsActions(
val onFexPreset: (String) -> Unit = {},
val onForceSsbs: (Boolean) -> Unit = {},
val onSyncBackend: (String) -> Unit = {},
val onPicturePosition: (String) -> Unit = {},
val onStretch16x9: (Boolean) -> Unit = {},
val onSteamRepair: () -> Unit = {},
val onMangoapp: (Boolean) -> Unit = {},
@@ -167,6 +169,13 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras:
val displaySize = com.droiddeck.launcher.session.SessionDisplay.resolveChoice(s.panelSize, s.resolution)
SettingsGroup(stringResource(R.string.display_session)) {
ResolutionRow(host, s.resolution, s.panelSize, a.onResolution)
s.picturePosition?.let { position ->
ChoiceRow(host, "picture-position", stringResource(R.string.display_picture_position), null,
listOf("top" to stringResource(R.string.display_position_top),
"bottom" to stringResource(R.string.display_position_bottom),
"center" to stringResource(R.string.display_position_center)),
position, onPick = a.onPicturePosition)
}
if (s.stretch16x9 != null && (com.droiddeck.launcher.session.SessionDisplay.canStretch16x9(s.panelSize) ||
com.droiddeck.launcher.session.SessionDisplay.canStretch16x9(displaySize))) {
val canStretch = com.droiddeck.launcher.session.SessionDisplay.canStretch16x9(displaySize)
@@ -5,6 +5,8 @@ internal enum class SessionDrawerPage(val firstControl: String) {
SECOND_SCREEN("second-screen:none"),
DISPLAY("hud"),
EFFECTS("look"),
STEAMVR("steamvr"),
CARDBOARD("cardboard"),
GAMES("anisotropy"),
SESSION("suspend"),
}
@@ -42,6 +42,8 @@ import androidx.compose.material.icons.outlined.PictureInPictureAlt
import androidx.compose.material.icons.automirrored.outlined.ExitToApp
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material.icons.outlined.SportsEsports
import androidx.compose.material.icons.outlined.ViewInAr
import androidx.compose.material.icons.outlined.Vrpano
import androidx.compose.material3.Icon
import androidx.compose.material3.RadioButton
import androidx.compose.material3.RadioButtonDefaults
@@ -151,6 +153,8 @@ private val SessionDrawerPage.title: Int get() = when (this) {
SessionDrawerPage.CONTROLLER -> R.string.drawer_page_controller
SessionDrawerPage.SECOND_SCREEN -> R.string.drawer_second_screen
SessionDrawerPage.DISPLAY -> R.string.drawer_page_display
SessionDrawerPage.STEAMVR -> R.string.steamvr_title
SessionDrawerPage.CARDBOARD -> R.string.cardboard_title
SessionDrawerPage.EFFECTS -> R.string.drawer_page_effects
SessionDrawerPage.GAMES -> R.string.game_settings_title
SessionDrawerPage.SESSION -> R.string.mode_session
@@ -160,6 +164,8 @@ private val SessionDrawerPage.icon get() = when (this) {
SessionDrawerPage.CONTROLLER -> Icons.Outlined.SportsEsports
SessionDrawerPage.SECOND_SCREEN -> Icons.Outlined.ScreenShare
SessionDrawerPage.DISPLAY -> Icons.Outlined.DesktopWindows
SessionDrawerPage.STEAMVR -> Icons.Outlined.ViewInAr
SessionDrawerPage.CARDBOARD -> Icons.Outlined.Vrpano
SessionDrawerPage.EFFECTS -> Icons.Outlined.AutoFixHigh
SessionDrawerPage.GAMES -> Icons.Outlined.Layers
SessionDrawerPage.SESSION -> Icons.Outlined.Settings
@@ -209,6 +215,7 @@ class DrawerActions(
val cardboard: Cardboard = Cardboard.OFF,
val cardboardSensor: Boolean = false,
val steamVr: SteamVr.Status? = null,
val immersiveSteamVr: Boolean = false,
val textureAnisotropy: Int? = 0,
val textureLodBias: String? = TextureFiltering.LOD_BIAS_OFF,
val secondScreenMode: SecondScreenMode,
@@ -233,6 +240,10 @@ class DrawerActions(
val onSuspendPolicy: (String) -> Unit,
val onSteamDownloadsInBackground: (Boolean) -> Unit = {},
val onBackActionsInverted: (Boolean) -> Unit,
val lowLatencyController: Boolean = false,
val lowLatencyTouch: Boolean = false,
val onLowLatencyController: (Boolean) -> Unit = {},
val onLowLatencyTouch: (Boolean) -> Unit = {},
val onTouch: (String) -> Unit,
val onFexPreset: (String) -> Unit,
val onUpscaler: (Int) -> Unit = {},
@@ -448,12 +459,13 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
stringResource(R.string.display_sharpness), null, a.upscaleSharpness, 0..100, step = 5,
format = { "$it%" }, modifier = focus.track(page, "upscale-sharpness"), onChange = a.onUpscaleSharpness)
}
CardboardGroup(host, a) { key -> focus.track(page, key) }
}
SessionDrawerPage.EFFECTS -> {
ScreenEffectsGroup(host, a, advancedEffectsExpanded,
onAdvancedToggle = { advancedEffectsExpanded = !advancedEffectsExpanded }) { key -> focus.track(page, key) }
}
SessionDrawerPage.STEAMVR -> SteamVrGroup(a) { key -> focus.track(page, key) }
SessionDrawerPage.CARDBOARD -> CardboardGroup(host, a) { key -> focus.track(page, key) }
SessionDrawerPage.CONTROLLER -> {
SettingsGroup(stringResource(R.string.drawer_page_controller)) {
a.padType?.let { type ->
@@ -497,6 +509,14 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
stringResource(R.string.unfolded_controls_hint), a.unfoldedControls,
chipModifier = focus.track(page, "unfolded-controls"), onChange = a.onUnfoldedControls)
}
SettingsGroup(stringResource(R.string.drawer_latency)) {
ToggleRow(host, "low-latency-controller", stringResource(R.string.drawer_low_latency_controller),
stringResource(R.string.drawer_low_latency_controller_hint), a.lowLatencyController,
chipModifier = focus.track(page, "low-latency-controller"), onChange = a.onLowLatencyController)
ToggleRow(host, "low-latency-touch", stringResource(R.string.drawer_low_latency_touch),
stringResource(R.string.drawer_low_latency_touch_hint), a.lowLatencyTouch,
chipModifier = focus.track(page, "low-latency-touch"), onChange = a.onLowLatencyTouch)
}
SettingsGroup(stringResource(R.string.drawer_keyboard)) {
Row(horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.fillMaxWidth().padding(8.dp)) {
DrawerOutlineButton(stringResource(R.string.drawer_pc_keyboard), modifier = Modifier.weight(1f).height(48.dp).then(focus.track(page, "hardware"))) {
@@ -903,17 +923,34 @@ private fun CardboardGroup(host: MenuHost, a: DrawerActions, track: (String) ->
}
if (c.headTracking && a.cardboardSensor)
ActionRow(stringResource(R.string.cardboard_recenter), null, stringResource(R.string.cardboard_recenter_button), a.onCardboardRecenter)
}
}
@Composable
private fun SteamVrGroup(a: DrawerActions, track: (String) -> Modifier) {
SettingsGroup(stringResource(R.string.steamvr_title)) {
val vrLabel = stringResource(R.string.cardboard_steamvr)
val enterLabel = stringResource(if (a.immersiveSteamVr) R.string.steamvr_enter else R.string.cardboard_steamvr_start)
val enterHint = stringResource(if (a.immersiveSteamVr) R.string.steamvr_quest_ready_hint else R.string.cardboard_steamvr_ready_hint)
@Composable fun button(label: String, hint: String?, text: String, action: String) {
SettingsRow(label, hint) {
SecondaryButton(text, modifier = track("steamvr"), onClick = { a.onSteamVr(action) })
}
}
when (a.steamVr) {
SteamVr.Status.NOT_INSTALLED -> ActionRow(vrLabel, stringResource(R.string.cardboard_steamvr_install_hint),
stringResource(R.string.cardboard_steamvr_install), { a.onSteamVr("install") })
SteamVr.Status.NOT_INSTALLED -> button(vrLabel, stringResource(R.string.cardboard_steamvr_install_hint),
stringResource(R.string.cardboard_steamvr_install), "install")
SteamVr.Status.INSTALLING -> SettingsRow(vrLabel, stringResource(R.string.cardboard_steamvr_installing)) {}
SteamVr.Status.READY -> ActionRow(vrLabel, stringResource(R.string.cardboard_steamvr_ready_hint),
stringResource(R.string.cardboard_steamvr_start), { a.onSteamVr("start") })
SteamVr.Status.RUNNING -> ActionRow(vrLabel, stringResource(R.string.cardboard_steamvr_running_hint),
stringResource(R.string.cardboard_steamvr_stop), { a.onSteamVr("stop") })
SteamVr.Status.READY -> button(vrLabel, enterHint, enterLabel, "start")
SteamVr.Status.RUNNING -> {
if (a.immersiveSteamVr) button(vrLabel, enterHint, enterLabel, "start")
SettingsRow(vrLabel, stringResource(R.string.cardboard_steamvr_running_hint)) {
SecondaryButton(stringResource(R.string.cardboard_steamvr_stop),
modifier = track(if (a.immersiveSteamVr) "steamvr-stop" else "steamvr"), onClick = { a.onSteamVr("stop") })
}
}
SteamVr.Status.UNAVAILABLE -> SettingsRow(vrLabel, stringResource(R.string.cardboard_steamvr_unavailable)) {}
null -> {}
null -> SettingsRow(vrLabel, stringResource(R.string.steamvr_checking)) {}
}
}
}
@@ -32,6 +32,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.produceState
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.geometry.Rect
@@ -66,13 +67,23 @@ import coil.request.ImageRequest
import coil.size.Scale
import coil.transform.RoundedCornersTransformation
import kotlin.math.roundToInt
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
private const val WALL_MIN_GAMES = 4
private const val WALL_DISTINCT = 40
private const val DRIFT_STEP_NS = 15_000_000L
@Composable
internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier) {
val ctx = androidx.compose.ui.platform.LocalContext.current
LaunchedEffect(Unit) { com.droiddeck.launcher.frontend.SteamFeatured.load(ctx) }
val featured = com.droiddeck.launcher.frontend.SteamFeatured.games
val signedIn = s.offlineAccount != null
val owned by produceState(emptyList<Pair<Int, java.io.File>>(), signedIn) {
value = if (!signedIn) emptyList() else withContext(Dispatchers.IO) { runCatching { Library.steamLibraryArt(ctx).shuffled() }.getOrDefault(emptyList()) }
}
val games = remember(s.steamGames) { s.steamGames.sortedWith(compareByDescending<Library.SteamGame> { it.lastPlayed }.thenBy { it.gameId }) }
val narrow = LocalNarrowPane.current
var words by remember { mutableStateOf<Rect?>(null) }
@@ -100,9 +111,12 @@ internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier)
start = if (narrow) 20.dp else 44.dp, bottom = if (narrow) 20.dp else 44.dp,
background = {
when {
games.isEmpty() -> EmptyLibrary(avoid = words) { Box(Modifier.fillMaxSize().graphicsLayer { scaleX = 1.06f; scaleY = 1.06f }) { WallFade() } }
games.isEmpty() -> EmptyLibrary(
avoid = words,
wall = if (owned.isEmpty() && featured.isEmpty()) null else { { CapsuleWall(emptyList(), owned = owned, featured = featured) } },
) { Box(Modifier.fillMaxSize().graphicsLayer { scaleX = 1.06f; scaleY = 1.06f }) { WallFade() } }
games.size < WALL_MIN_GAMES -> CapsuleFan(games)
else -> CapsuleWall(games)
else -> CapsuleWall(games, owned = owned, featured = featured)
}
},
scrim = { if (games.size >= WALL_MIN_GAMES) WallFade() },
@@ -143,10 +157,24 @@ internal fun CapsuleWall(
games: List<Library.SteamGame>,
driftMs: Int = if (games.isEmpty()) 75_000 else 40_000,
modifier: Modifier = Modifier,
owned: List<Pair<Int, java.io.File>> = emptyList(),
featured: List<com.droiddeck.launcher.frontend.SteamFeatured.Game> = emptyList(),
) {
val pal = LocalPalette.current
val blank = remember(pal) { WallCapsule(Brush.linearGradient(listOf(pal.surface, pal.background)), edge = pal.line) }
TiltedWall(games.size, driftMs, modifier) { i -> if (games.isEmpty()) blank else WallCapsule(artBrush(hueOf(games[i].name)), games[i].art) }
val padding = remember(games, owned, featured) {
val shown = games.map { it.appId }.toMutableSet()
val library = owned.filter { shown.add(it.first) }.map { (id, art) -> id.toString() to art }
val store = if (owned.isEmpty()) featured.filter { shown.add(it.appId) }.map { it.name to it.art } else emptyList()
(library + store).take((WALL_DISTINCT - games.size).coerceAtLeast(0))
}
TiltedWall(games.size + padding.size, driftMs, modifier) { i ->
when {
i < games.size -> WallCapsule(artBrush(hueOf(games[i].name)), games[i].art)
i - games.size < padding.size -> padding[i - games.size].let { (seed, art) -> WallCapsule(artBrush(hueOf(seed)), art) }
else -> blank
}
}
}
internal class WallCapsule(val ground: Brush, val art: Any? = null, val edge: Color? = null, val icon: Any? = null, val bar: Color? = null)
@@ -85,6 +85,11 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.automirrored.filled.Login
import androidx.compose.material.icons.filled.GridView
import androidx.compose.material.icons.filled.Sort
import androidx.compose.material.icons.filled.ViewList
import com.droiddeck.launcher.stores.sortCatalogItems
import com.droiddeck.launcher.stores.retainCatalogOrder
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.basicMarquee
import androidx.compose.material.icons.filled.PlayArrow
@@ -95,6 +100,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.State
import androidx.compose.runtime.getValue
import androidx.compose.runtime.key
@@ -132,6 +138,10 @@ import com.droiddeck.launcher.stores.StoresState
import com.droiddeck.launcher.stores.download.DownloadStage
import com.droiddeck.launcher.stores.download.DownloadState
import com.droiddeck.launcher.stores.formatBytes
import java.util.concurrent.CompletableFuture
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlinx.coroutines.suspendCancellableCoroutine
private const val DOWNLOADS = "downloads"
@@ -649,8 +659,14 @@ private fun SignInCard(store: Store, height: Dp) {
val c = sourceColours(store.id)
LaunchedEffect(store) { StoresState.preview(ctx, store) }
val art = remember(StoresState.shelves[store]) {
StoresState.shelves[store]?.all.orEmpty().filter { !it.mature }.mapNotNull { it.tallImageUrl ?: it.imageUrl }.distinct().take(48)
.takeIf { it.size >= 8 }.orEmpty()
val shelves = StoresState.shelves[store]
val urls = (shelves?.art?.takeIf { it.isNotEmpty() }
?: shelves?.all.orEmpty().filter { !it.mature && !it.owned }.mapNotNull { it.tallImageUrl ?: it.imageUrl }).distinct().take(48)
when {
urls.size >= 8 -> urls
urls.size >= 4 -> urls + urls.drop(urls.size / 2) + urls.take(urls.size / 2)
else -> emptyList()
}
}
val shape = RoundedCornerShape(20.dp)
val blank = WallCapsule(Brush.linearGradient(listOf(c.fill, colors.background)), edge = c.dot.copy(alpha = 0.22f))
@@ -732,13 +748,72 @@ private fun Storefront(
val installedOnly = tab == "installed"
val loaded = StoresState.library.containsKey(store)
val showGrid = tab != "store" || q.isNotEmpty()
val visible = remember(library, installedItems, everything, tab, q, s.storesShowMature) {
val sort = s.storesSort
val lastPlayedFor = remember(s.steamGames) {
val byKey = s.steamGames.associate { "${it.source}:${it.storeId}" to it.lastPlayed }
val lookup: (CatalogItem) -> Long = { i -> byKey[i.key] ?: 0L }
lookup
}
val installedAtFor = remember(StoresState.installed) {
val byKey = StoresState.installed.associate { "${it.sidecar.store.id}:${it.sidecar.id}" to it.sidecar.installedAt }
val lookup: (CatalogItem) -> Long = { i -> byKey[i.key] ?: 0L }
lookup
}
val isSizeSort = (tab == "library" || tab == "installed") && (sort == "sizeAsc" || sort == "sizeDesc")
val candidates = remember(library, installedItems, everything, tab, q, s.storesShowMature) {
when (tab) {
"library" -> library.filter(::matches)
"installed" -> installedItems.filter(::matches)
else -> everything.filter { matches(it) && shown(it) }
}
}
val candidateKeys = remember(candidates) { candidates.map { it.key } }
var resolvedSizeSortKey by remember(store, tab) { mutableStateOf<List<String>?>(null) }
val sizeSortPending = isSizeSort && resolvedSizeSortKey != candidateKeys
var stableVisible by remember(store, tab) { mutableStateOf(emptyList<CatalogItem>()) }
val resolvedSizes = when {
!isSizeSort -> emptyMap<String, Long>()
installedOnly -> com.droiddeck.launcher.stores.StoreSizes.onDisk.toMap()
else -> com.droiddeck.launcher.stores.StoreSizes.known.toMap()
}
val sizeFor = remember(resolvedSizes, installedOnly) {
val resolved = resolvedSizes
val lookup: (CatalogItem) -> Long = { item ->
resolved[item.key] ?: if (installedOnly) 0L else item.sizeBytes
}
lookup
}
val sortedVisible = remember(candidates, tab, sort, lastPlayedFor, installedAtFor, sizeFor) {
if (tab == "library" || tab == "installed")
sortCatalogItems(candidates, sort, lastPlayed = lastPlayedFor, installedAt = installedAtFor, size = sizeFor)
else candidates
}
val visible = remember(sizeSortPending, candidates, stableVisible, sortedVisible) {
if (sizeSortPending) retainCatalogOrder(candidates, stableVisible) else sortedVisible
}
SideEffect {
if (!sizeSortPending && stableVisible != sortedVisible) stableVisible = sortedVisible
}
LaunchedEffect(store, tab, sort, candidates, candidateKeys) {
if (!isSizeSort || resolvedSizeSortKey == candidateKeys) return@LaunchedEffect
val requests = candidates.map { item ->
val future: CompletableFuture<Long?> = if (tab == "installed") {
StoresState.installedGame(store, item.id)?.let {
com.droiddeck.launcher.stores.StoreSizes.resolveDisk(ctx, item.key, it)
} ?: CompletableFuture.completedFuture<Long?>(null)
} else {
com.droiddeck.launcher.stores.StoreSizes.resolve(ctx, item)
}
item to future
}
CompletableFuture.allOf(*requests.map { it.second }.toTypedArray()).await()
requests.forEach { (item, future) ->
val bytes = future.getNow(null) ?: return@forEach
if (tab == "installed") com.droiddeck.launcher.stores.StoreSizes.onDisk[item.key] = bytes
else if (item.owned && item.sizeBytes <= 0) com.droiddeck.launcher.stores.StoreSizes.known[item.key] = bytes
}
resolvedSizeSortKey = candidateKeys
}
val empty = stringResource(when {
installedOnly -> R.string.stores_installed_empty
tab == "library" && library.isEmpty() && StoresState.status[store] != null -> R.string.stores_library_loading
@@ -749,7 +824,9 @@ private fun Storefront(
val density = androidx.compose.ui.platform.LocalDensity.current
val focus = LocalFrontFocus.current
val scope = rememberCoroutineScope()
val headerItems = 1 + (if (StoresState.status[store] != null) 1 else 0) + (if (StoresState.problems[store] != null) 1 else 0)
val headerItems = 1 + (if (sizeSortPending) 1 else 0) +
(if (StoresState.status[store] != null) 1 else 0) + (if (StoresState.problems[store] != null) 1 else 0)
val listMode = s.storesView == "list" && (tab == "library" || tab == "installed")
val card: @Composable (CatalogItem) -> Unit = { item ->
val first = if (showGrid) item.key == visible.firstOrNull()?.key else !firstPlaced
firstPlaced = true
@@ -761,7 +838,7 @@ private fun Storefront(
else -> 0
}
val index = visible.indexOfFirst { it.key == item.key }
val next = storeGridNeighbor(index, visible.size, columns, direction)
val next = storeGridNeighbor(index, visible.size, if (listMode) 1 else columns, direction)
when {
direction == 0 || index < 0 -> false
next == null -> direction > 0
@@ -780,12 +857,13 @@ private fun Storefront(
}
}
}
GameCard(item, store, s, a, installedKeys, onOpen, first, navigation)
if (listMode) GameListRow(item, store, installedKeys, onOpen, first, navigation)
else GameCard(item, store, s, a, installedKeys, onOpen, first, navigation)
}
LazyVerticalGrid(
columns = GridCells.Adaptive(CardWidth), state = grid, modifier = Modifier.fillMaxSize().focusGroup().onSizeChanged {
columns = if (listMode) GridCells.Fixed(1) else GridCells.Adaptive(CardWidth), state = grid, modifier = Modifier.fillMaxSize().focusGroup().onSizeChanged {
val gap = with(density) { 10.dp.roundToPx() }
val minimum = with(density) { CardWidth.roundToPx() }
val minimum = with(density) { (if (listMode) CardWidth * 2 else CardWidth).roundToPx() }
columns = ((it.width + gap) / (minimum + gap)).toInt().coerceAtLeast(1)
},
horizontalArrangement = Arrangement.spacedBy(10.dp), verticalArrangement = Arrangement.spacedBy(10.dp),
@@ -807,12 +885,25 @@ private fun Storefront(
else -> stringResource(R.string.stores_search_library)
},
) {
if (tab == "library" || tab == "installed") {
SortButton(s, a)
ViewButton(s, a)
}
SmallTextButton(stringResource(R.string.stores_refresh)) { StoresState.open(ctx, store, force = true) }
val name = StoresState.accounts[store] ?: ""
SignOutButton(store, name)
}
}
}
if (sizeSortPending) item(key = "size-sort-progress", span = { GridItemSpan(maxLineSpan) }) {
Row(
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp),
modifier = Modifier.fillMaxWidth().padding(bottom = 8.dp),
) {
androidx.compose.material3.LinearProgressIndicator(Modifier.weight(1f).height(3.dp))
Text(stringResource(R.string.store_section_loading), fontSize = 11.sp, color = MaterialTheme.colorScheme.onSurfaceVariant)
}
}
StoresState.status[store]?.let { line -> item(key = "sync", span = { GridItemSpan(maxLineSpan) }) { Rise(3) { SyncBar(line) } } }
StoresState.problems[store]?.let { line -> item(key = "problem", span = { GridItemSpan(maxLineSpan) }) { Rise(3) { Box(Modifier.padding(bottom = 8.dp)) { Note(line) } } } }
when (tab) {
@@ -838,6 +929,14 @@ private fun Storefront(
}
}
private suspend fun <T> CompletableFuture<T>.await(): T =
suspendCancellableCoroutine { continuation ->
whenComplete { value, error ->
if (error == null) continuation.resume(value)
else continuation.resumeWithException(error)
}
}
@Composable
internal fun ModeHeader(title: String, query: String, onQuery: (String) -> Unit, placeholder: String, trailing: @Composable () -> Unit) {
val colors = MaterialTheme.colorScheme
@@ -927,6 +1026,126 @@ private fun SmallTextButton(text: String, key: String = text, onClick: () -> Uni
)
}
@Composable
private fun HeaderIconButton(description: String, icon: androidx.compose.ui.graphics.vector.ImageVector, key: String, onClick: () -> Unit) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
val src = remember { MutableInteractionSource() }
val hot = rememberHot(src)
Box(
contentAlignment = Alignment.Center,
modifier = Modifier.paneItem("btn:$key").size(32.dp).clip(CircleShape).background(if (hot) pal.signal.copy(alpha = 0.14f) else Color.Transparent)
.glideBorder(hot, CircleShape, pal.signal)
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, role = Role.Button, onClick = onClick)
.controllerConfirm(onClick = onClick),
) { Icon(icon, description, tint = if (hot) pal.signal else colors.onSurfaceVariant, modifier = Modifier.size(18.dp)) }
}
@Composable
private fun SortButton(s: FrontEndState, a: FrontEndActions) {
val pal = LocalPalette.current
val title = stringResource(R.string.stores_sort)
var at by remember { mutableStateOf<Rect?>(null) }
Box(Modifier.onGloballyPositioned { at = it.boundsInRoot() }) {
HeaderIconButton(title, Icons.Filled.Sort, "sort") {
val from = at ?: return@HeaderIconButton
StoresMotion.ask(StepAsk(
anchor = from, side = StepSide.Left, accent = pal.signal, pillCorner = 8.dp, items = SessionPrefs.STORES_SORTS.size,
onDismiss = {},
handle = { Text(title, fontSize = 12.sp, fontWeight = FontWeight.SemiBold, color = pal.signal, maxLines = 1, overflow = TextOverflow.Ellipsis) },
) {
StepTitle(title)
StepList {
SessionPrefs.STORES_SORTS.forEachIndexed { i, sort ->
val label = when (sort) {
"lastPlayed" -> stringResource(R.string.stores_sort_last_played)
"recentlyInstalled" -> stringResource(R.string.stores_sort_recently_installed)
"titleAsc" -> stringResource(R.string.stores_sort_title_asc)
"titleDesc" -> stringResource(R.string.stores_sort_title_desc)
"sizeDesc" -> stringResource(R.string.stores_sort_size_desc)
"sizeAsc" -> stringResource(R.string.stores_sort_size_asc)
else -> stringResource(R.string.stores_sort_release_date)
}
StepChoice(
label, selected = sort == s.storesSort, enabled = open,
modifier = Modifier.fillMaxWidth().stepItem(i)
.then(if (sort == s.storesSort) Modifier.focusRequester(first) else Modifier),
) {
a.onStoresSort(sort)
StoresMotion.fold()
}
}
}
})
}
}
}
@Composable
private fun ViewButton(s: FrontEndState, a: FrontEndActions) {
val list = s.storesView == "list"
HeaderIconButton(
if (list) stringResource(R.string.stores_view_cards) else stringResource(R.string.stores_view_list),
if (list) Icons.Filled.GridView else Icons.Filled.ViewList,
"view",
) { a.onStoresView(if (list) "cards" else "list") }
}
@Composable
private fun GameListRow(
item: CatalogItem, store: Store, installedKeys: Set<String>, onOpen: (String) -> Unit,
first: Boolean = false, navigation: Modifier = Modifier,
) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
val src = remember { MutableInteractionSource() }
val hot = rememberHot(src)
val installed = item.id in installedKeys
val download = StoresState.download("${store.id}:${item.id}")?.takeIf { it.isActive }
if (installed) {
val ctx = LocalContext.current
val game = StoresState.installedGame(store, item.id)
if (game != null) androidx.compose.runtime.LaunchedEffect(item.key) { com.droiddeck.launcher.stores.StoreSizes.requestDisk(ctx, item.key, game) }
}
val placed = remember { arrayOfNulls<androidx.compose.ui.layout.LayoutCoordinates>(1) }
val corner = with(androidx.compose.ui.platform.LocalDensity.current) { 10.dp.toPx() }
val open = {
placed[0]?.takeIf { it.isAttached }?.let { StoresMotion.markCard(CardMark(item.key, it.boundsInRoot(), corner, item.imageUrl ?: item.tallImageUrl)) }
onOpen(item.key)
}
val meta = listOfNotNull(
item.developer.takeIf { it.isNotBlank() },
item.releaseDate.take(4).takeIf { it.length == 4 },
when {
installed -> {
val bytes = com.droiddeck.launcher.stores.StoreSizes.onDisk[item.key]
?: com.droiddeck.launcher.stores.StoreSizes.size(item).takeIf { it > 0 } ?: 0L
formatBytes(bytes).takeIf { it.isNotEmpty() }
}
item.isFree -> stringResource(R.string.stores_free)
item.isDiscounted -> "-${item.discountPercent}%"
item.hasPrice -> item.finalPrice.takeIf { it.isNotBlank() }
else -> null
},
)
Row(
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp),
modifier = Modifier.fillMaxWidth().heightIn(min = 64.dp).then(navigation).paneItem("card:${item.key}")
.then(if (first) Modifier.firstTile() else Modifier)
.clip(RoundedCornerShape(10.dp)).glideBorder(hot, RoundedCornerShape(10.dp), pal.signal, pal.line)
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, onClick = open).controllerConfirm(onClick = open)
.padding(horizontal = 10.dp, vertical = 8.dp),
) {
CardArt(item, Modifier.width(96.dp).height(54.dp).clip(RoundedCornerShape(8.dp)))
Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) {
Text(item.title, fontSize = 14.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis)
Text(meta.joinToString(" · "), fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis)
}
if (installed) Icon(Icons.Filled.Check, stringResource(R.string.stores_installed_chip), tint = pal.good, modifier = Modifier.size(16.dp))
else if (download != null) Text("${download.percent}%", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = pal.signal, maxLines = 1)
}
}
@Composable
private fun SignOutButton(store: Store, name: String) {
val ctx = LocalContext.current
@@ -7,6 +7,7 @@ import com.droiddeck.launcher.session.SessionState
object CompositorHost {
@Volatile
private var started = false
@Volatile
private var vsyncRunning = false
private val vsync = object : Choreographer.FrameCallback {
@@ -71,6 +72,14 @@ object CompositorHost {
private var attached: Surface? = null
@Synchronized
fun attachXr() {
check(started) { "DroidDeck compositor is not running" }
pauseVsync()
attached = null
WaylandCompositor.nativeSetSurface(null)
}
@Synchronized
fun detach(surface: Surface?) {
if (!started) return
@@ -148,6 +148,7 @@ public final class WaylandCompositor {
String nativeLibDir);
public static native void nativeSetSurface(Surface surface);
public static native boolean nativeWaitSurface(int timeoutMs);
public static native void nativeSendPointer(int action, int x, int y);
@@ -197,6 +198,8 @@ public final class WaylandCompositor {
public static native void nativeSetOutputSize(int width, int height);
public static native boolean nativeGamePictureRect(float[] out);
public static native void nativeResizeOutput(int width, int height);
public static native void nativeResetFirstFrame();
+12 -2
View File
@@ -917,8 +917,8 @@
<string name="wadb_turn_off">إيقاف الحد</string>
<string name="wadb_other_ways">طرق أخرى لتغييره</string>
<string name="wadb_dev_try_first">1 · خيارات المطوّرين (جرّب هذا أولًا)</string>
<string name="wadb_restrict_on">فعِّل «تقييد العمليات الفرعية».</string>
<string name="wadb_restrict_off">عطِّل «تقييد العمليات الفرعية».</string>
<string name="wadb_restrict_on">عطِّل «إيقاف القيود المفروضة على العمليات الثانوية».</string>
<string name="wadb_restrict_off">فعِّل «إيقاف القيود المفروضة على العمليات الثانوية».</string>
<string name="wadb_computer_last">3 · ADB من كمبيوتر (كخيار أخير)</string>
<string name="wadb_only_if">فقط إذا كان تصحيح الأخطاء اللاسلكي غير متاح.</string>
<string name="wadb_computer_group">3 · ADB من كمبيوتر (كخيار أخير)</string>
@@ -2003,6 +2003,16 @@
<string name="stores_free">مجاني</string>
<string name="stores_resume">استئناف</string>
<string name="stores_refresh">تحديث</string>
<string name="stores_sort">ترتيب</string>
<string name="stores_sort_last_played">لُعب مؤخرًا</string>
<string name="stores_sort_recently_installed">ثُبت مؤخرًا</string>
<string name="stores_sort_title_asc">العنوان أ–ي</string>
<string name="stores_sort_title_desc">العنوان ي–أ</string>
<string name="stores_sort_size_desc">الحجم: الأكبر</string>
<string name="stores_sort_size_asc">الحجم: الأصغر</string>
<string name="stores_sort_release_date">تاريخ الإصدار</string>
<string name="stores_view_list">عرض القائمة</string>
<string name="stores_view_cards">عرض البطاقات</string>
<string name="stores_show_mature">إظهار المحتوى للبالغين</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -893,8 +893,8 @@
<string name="wadb_turn_off">Изключване на ограничението</string>
<string name="wadb_other_ways">Други начини за промяна</string>
<string name="wadb_dev_try_first">1 · Опции за програмисти (пробвайте първо)</string>
<string name="wadb_restrict_on">Включете „Restrict child processes“.</string>
<string name="wadb_restrict_off">Изключете „Restrict child processes“.</string>
<string name="wadb_restrict_on">Изключете „Деактивиране на ограниченията за дъщерните процеси“.</string>
<string name="wadb_restrict_off">Включете „Деактивиране на ограниченията за дъщерните процеси“.</string>
<string name="wadb_computer_last">3 · ADB от компютър (последна възможност)</string>
<string name="wadb_only_if">Само ако безжичното отстраняване на грешки не е достъпно.</string>
<string name="wadb_computer_group">3 · ADB от компютър (последна възможност)</string>
@@ -1919,6 +1919,16 @@
<string name="stores_free">Безплатна</string>
<string name="stores_resume">Продължи</string>
<string name="stores_refresh">Обнови</string>
<string name="stores_sort">Сортиране</string>
<string name="stores_sort_last_played">Играни наскоро</string>
<string name="stores_sort_recently_installed">Инсталирани наскоро</string>
<string name="stores_sort_title_asc">Заглавие А–Я</string>
<string name="stores_sort_title_desc">Заглавие Я–А</string>
<string name="stores_sort_size_desc">Размер: най-голям</string>
<string name="stores_sort_size_asc">Размер: най-малък</string>
<string name="stores_sort_release_date">Дата на издаване</string>
<string name="stores_view_list">Изглед на списък</string>
<string name="stores_view_cards">Изглед с карти</string>
<string name="stores_show_mature">Показвай съдържание за възрастни</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -905,8 +905,8 @@
<string name="wadb_turn_off">Vypnout omezení</string>
<string name="wadb_other_ways">Jiné způsoby změny</string>
<string name="wadb_dev_try_first">1 · Možnosti pro vývojáře (zkusit nejdřív)</string>
<string name="wadb_restrict_on">Zapněte „Restrict child processes“.</string>
<string name="wadb_restrict_off">Vypněte „Restrict child processes“.</string>
<string name="wadb_restrict_on">Vypněte „Deaktivace omezení podřízených procesů“.</string>
<string name="wadb_restrict_off">Zapněte „Deaktivace omezení podřízených procesů“.</string>
<string name="wadb_computer_last">3 · ADB z počítače (poslední možnost)</string>
<string name="wadb_only_if">Jen pokud Bezdrátové ladění není k dispozici.</string>
<string name="wadb_computer_group">3 · ADB z počítače (poslední možnost)</string>
@@ -1961,6 +1961,16 @@
<string name="stores_free">Zdarma</string>
<string name="stores_resume">Pokračovat</string>
<string name="stores_refresh">Obnovit</string>
<string name="stores_sort">Řazení</string>
<string name="stores_sort_last_played">Nedávno hrané</string>
<string name="stores_sort_recently_installed">Nedávno nainstalované</string>
<string name="stores_sort_title_asc">Název A–Z</string>
<string name="stores_sort_title_desc">Název Z–A</string>
<string name="stores_sort_size_desc">Velikost: největší</string>
<string name="stores_sort_size_asc">Velikost: nejmenší</string>
<string name="stores_sort_release_date">Datum vydání</string>
<string name="stores_view_list">Zobrazení seznamu</string>
<string name="stores_view_cards">Zobrazení karet</string>
<string name="stores_show_mature">Zobrazovat obsah pro dospělé</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -893,8 +893,8 @@
<string name="wadb_turn_off">Slå grænsen fra</string>
<string name="wadb_other_ways">Andre måder at ændre det</string>
<string name="wadb_dev_try_first">1 · Udviklerindstillinger (prøv først)</string>
<string name="wadb_restrict_on">Slå “Begræns underprocesser” til.</string>
<string name="wadb_restrict_off">Slå “Begræns underprocesser” fra.</string>
<string name="wadb_restrict_on">Slå “Deaktiver begrænsningerne for underprocesser” fra.</string>
<string name="wadb_restrict_off">Slå “Deaktiver begrænsningerne for underprocesser” til.</string>
<string name="wadb_computer_last">3 · Computer-ADB (sidste udvej)</string>
<string name="wadb_only_if">Kun hvis Trådløs fejlretning ikke er tilgængelig.</string>
<string name="wadb_computer_group">3 · Computer-ADB (sidste udvej)</string>
@@ -1919,6 +1919,16 @@
<string name="stores_free">Gratis</string>
<string name="stores_resume">Genoptag</string>
<string name="stores_refresh">Opdater</string>
<string name="stores_sort">Sortér</string>
<string name="stores_sort_last_played">Senest spillet</string>
<string name="stores_sort_recently_installed">Senest installeret</string>
<string name="stores_sort_title_asc">Titel A–Å</string>
<string name="stores_sort_title_desc">Titel Å–A</string>
<string name="stores_sort_size_desc">Størrelse: størst</string>
<string name="stores_sort_size_asc">Størrelse: mindst</string>
<string name="stores_sort_release_date">Udgivelsesdato</string>
<string name="stores_view_list">Listevisning</string>
<string name="stores_view_cards">Kortvisning</string>
<string name="stores_show_mature">Vis indhold for voksne</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+26 -2
View File
@@ -893,8 +893,8 @@
<string name="wadb_turn_off">Limit deaktivieren</string>
<string name="wadb_other_ways">Andere Wege, es zu ändern</string>
<string name="wadb_dev_try_first">1 · Entwickleroptionen (zuerst versuchen)</string>
<string name="wadb_restrict_on">Schalte „Untergeordnete Prozesse einschränken“ ein.</string>
<string name="wadb_restrict_off">Schalte „Untergeordnete Prozesse einschränken“ aus.</string>
<string name="wadb_restrict_on">Schalte „Beschränkungen für Unterprozesse deaktivieren“ aus.</string>
<string name="wadb_restrict_off">Schalte „Beschränkungen für Unterprozesse deaktivieren“ ein.</string>
<string name="wadb_computer_last">3 · ADB am Computer (letzter Ausweg)</string>
<string name="wadb_only_if">Nur wenn „Debugging über WLAN“ nicht verfügbar ist.</string>
<string name="wadb_computer_group">3 · ADB am Computer (letzter Ausweg)</string>
@@ -1919,6 +1919,16 @@
<string name="stores_free">Kostenlos</string>
<string name="stores_resume">Fortsetzen</string>
<string name="stores_refresh">Aktualisieren</string>
<string name="stores_sort">Sortieren</string>
<string name="stores_sort_last_played">Zuletzt gespielt</string>
<string name="stores_sort_recently_installed">Zuletzt installiert</string>
<string name="stores_sort_title_asc">Titel A–Z</string>
<string name="stores_sort_title_desc">Titel Z–A</string>
<string name="stores_sort_size_desc">Größe: größte</string>
<string name="stores_sort_size_asc">Größe: kleinste</string>
<string name="stores_sort_release_date">Erscheinungsdatum</string>
<string name="stores_view_list">Listenansicht</string>
<string name="stores_view_cards">Kartenansicht</string>
<string name="stores_show_mature">Inhalte für Erwachsene anzeigen</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -2232,4 +2242,18 @@
<string name="stores_hltb_completionist">Komplettierer</string>
<string name="stores_hltb_hours">%1$s Std.</string>
<string name="stores_hltb_minutes">%1$d Min.</string>
<string name="mode_zram">zRAM-Komprimierung</string>
<string name="mode_zram_hint">Während ein Spiel läuft, wird der Arbeitsspeicher des Steam-Clients in das zram des Geräts komprimiert, sodass mehr RAM für das Spiel bleibt. Wird beim nächsten Start von Steam angewendet.</string>
<string name="mode_zram_unsupported">Nicht verfügbar: Dieses Gerät hat kein zram oder keinen Swap, oder sein Kernel ist älter als 5.4.</string>
<string name="setup_reset_settings">Alle Einstellungen zurücksetzen</string>
<string name="setup_reset_settings_title">Alle Einstellungen zurücksetzen?</string>
<string name="setup_reset_settings_body">Anzeige-, Leistungs-, Controller-, Design-, Sprach- und Launcher-Einstellungen werden auf ihre Standardwerte zurückgesetzt. Deine Spiele, die Steam-Anmeldung, Shop-Konten, heruntergeladene Treiber und Speicherordner bleiben erhalten.</string>
<string name="setup_reset_settings_button">Zurücksetzen</string>
<string name="setup_reset_settings_hint">Setzt jede Einstellung auf den Standardwert zurück</string>
<string name="setup_reset_settings_partial">Die Einstellungen wurden zurückgesetzt, aber einige Teile konnten nicht zurückgesetzt werden. Details stehen in den Protokollen.</string>
<string name="setup_reset_settings_profiles">Auch Spielprofile zurücksetzen (Proton, FEX, Komponenten und Umgebung jedes Spiels sowie die Umgebung des Standardprofils)</string>
<string name="setup_reset_settings_session_running">Beende die Sitzung, bevor du die Einstellungen zurücksetzt.</string>
<string name="stores_storage_insufficient">Nicht genug freier Speicher: %1$s benötigt, nur %2$s frei</string>
<string name="stores_storage_low">Zu wenig Speicher (%1$s frei, %2$s benötigt)</string>
<string name="stores_target_free_unknown">Freier Speicher unbekannt</string>
</resources>
+12 -2
View File
@@ -893,8 +893,8 @@
<string name="wadb_turn_off">Απενεργοποίηση ορίου</string>
<string name="wadb_other_ways">Άλλοι τρόποι αλλαγής</string>
<string name="wadb_dev_try_first">1 · Επιλογές προγραμματιστή (δοκιμάστε πρώτα)</string>
<string name="wadb_restrict_on">Ενεργοποιήστε «Περιορισμός θυγατρικών διαδικασιών».</string>
<string name="wadb_restrict_off">Απενεργοποιήστε «Περιορισμός θυγατρικών διαδικασιών».</string>
<string name="wadb_restrict_on">Απενεργοποιήστε «Απενεργοπ. περιορισμών σε θυγατρικές διεργασίες».</string>
<string name="wadb_restrict_off">Ενεργοποιήστε «Απενεργοπ. περιορισμών σε θυγατρικές διεργασίες».</string>
<string name="wadb_computer_last">3 · ADB υπολογιστή (τελευταία λύση)</string>
<string name="wadb_only_if">Μόνο αν ο Ασύρματος εντοπισμός σφαλμάτων δεν είναι διαθέσιμος.</string>
<string name="wadb_computer_group">3 · ADB υπολογιστή (τελευταία λύση)</string>
@@ -1919,6 +1919,16 @@
<string name="stores_free">Δωρεάν</string>
<string name="stores_resume">Συνέχιση</string>
<string name="stores_refresh">Ανανέωση</string>
<string name="stores_sort">Ταξινόμηση</string>
<string name="stores_sort_last_played">Παίχτηκαν πρόσφατα</string>
<string name="stores_sort_recently_installed">Εγκαταστήθηκαν πρόσφατα</string>
<string name="stores_sort_title_asc">Τίτλος Α–Ω</string>
<string name="stores_sort_title_desc">Τίτλος Ω–Α</string>
<string name="stores_sort_size_desc">Μέγεθος: μεγαλύτερο</string>
<string name="stores_sort_size_asc">Μέγεθος: μικρότερο</string>
<string name="stores_sort_release_date">Ημερομηνία κυκλοφορίας</string>
<string name="stores_view_list">Προβολή λίστας</string>
<string name="stores_view_cards">Προβολή καρτών</string>
<string name="stores_show_mature">Εμφάνιση περιεχομένου για ενήλικες</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+22 -6
View File
@@ -306,8 +306,8 @@
<string name="mode_sgdb_key">Clave API de SteamGridDB</string>
<string name="mode_sgdb_key_yours">Tu clave</string>
<string name="mode_sgdb_edit">Editar…</string>
<string name="mode_added_art_hint">Completa las imágenes que faltan según el nombre de la carpeta. Tus propios cover.jpg, hero.jpg, logo.png o icon.png en la carpeta del juego tienen prioridad.</string>
<string name="summary_remove_game">Remove %1$s</string>
<string name="mode_added_art_hint">Completa las imágenes que faltan desde Steam y, después, desde SteamGridDB. Tus propios cover.jpg, hero.jpg, logo.png o icon.png en la carpeta del juego tienen prioridad.</string>
<string name="summary_remove_game">Quitar %1$s</string>
<string name="mode_added_remove_confirm">¿Quitar?</string>
<string name="games_add">Añadir juego</string>
<string name="games_add_title">Añadir un juego:</string>
@@ -346,10 +346,10 @@
<string name="wincomp_active">Instalados para este juego (%1$d)</string>
<string name="wincomp_all">Todos los componentes (%1$d)</string>
<string name="wincomp_installers">Necesitan un instalador de Windows (%1$d)</string>
<string name="wincomp_installers_note">Estos ejecutan un instalador real dentro del prefijo (.NET, PhysX, XNA, los instaladores completos de Visual C++…). DroidDeck aún no puede hacerlo; es lo siguiente.</string>
<string name="wincomp_installers_note">Son programas de instalación independientes, sin ningún paquete que extraer, y todavía no hay un registro de lo que instalan. La mayoría son runtimes antiguos que el Mono incluido en Proton ya sustituye; los registros se añaden a medida que se crean.</string>
<string name="wincomp_show">Mostrar</string>
<string name="wincomp_hide">Ocultar</string>
<string name="wincomp_needs_installer">Necesita un instalador de Windows (próximamente)</string>
<string name="wincomp_needs_installer">Ejecuta su propio programa de instalación (aún sin registro)</string>
<string name="wincomp_unsupported">Aún no compatible aquí</string>
<string name="wincomp_loading">Cargando los componentes…</string>
<string name="wincomp_failed">No se pudo instalar: %1$s</string>
@@ -907,8 +907,8 @@
<string name="wadb_turn_off">Desactivar límite</string>
<string name="wadb_other_ways">Otras formas de cambiarlo</string>
<string name="wadb_dev_try_first">1 · Opciones de desarrollador (pruébalo primero)</string>
<string name="wadb_restrict_on">Activa “Restringir procesos secundarios”.</string>
<string name="wadb_restrict_off">Desactiva “Restringir procesos secundarios”.</string>
<string name="wadb_restrict_on">Desactiva “Inhabilitar restricciones de procesos secundarios”.</string>
<string name="wadb_restrict_off">Activa “Inhabilitar restricciones de procesos secundarios”.</string>
<string name="wadb_computer_last">3 · ADB desde ordenador (último recurso)</string>
<string name="wadb_only_if">Solo si la Depuración inalámbrica no está disponible.</string>
<string name="wadb_computer_group">3 · ADB desde ordenador (último recurso)</string>
@@ -1948,6 +1948,16 @@
<string name="stores_free">Gratis</string>
<string name="stores_resume">Reanudar</string>
<string name="stores_refresh">Actualizar</string>
<string name="stores_sort">Ordenar</string>
<string name="stores_sort_last_played">Jugados recientemente</string>
<string name="stores_sort_recently_installed">Instalados recientemente</string>
<string name="stores_sort_title_asc">Título A–Z</string>
<string name="stores_sort_title_desc">Título Z–A</string>
<string name="stores_sort_size_desc">Tamaño: mayor</string>
<string name="stores_sort_size_asc">Tamaño: menor</string>
<string name="stores_sort_release_date">Fecha de lanzamiento</string>
<string name="stores_view_list">Vista de lista</string>
<string name="stores_view_cards">Vista de tarjetas</string>
<string name="stores_show_mature">Mostrar contenido para adultos</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -2265,4 +2275,10 @@
<string name="drawer_component_downloads">Descargar componentes</string>
<string name="drawer_component_downloads_hint">Las descargas se comparten con la página Componentes. Elige arriba una versión descargada para usarla al iniciar el próximo juego.</string>
<string name="drawer_component_choose_download">Elige una versión para descargar</string>
<string name="mode_zram">Compresión zRAM</string>
<string name="mode_zram_hint">Mientras se ejecuta un juego, la memoria del cliente de Steam se comprime en la zram del dispositivo, lo que deja más RAM para el juego. Se aplica la próxima vez que se inicie Steam.</string>
<string name="mode_zram_unsupported">No disponible: este dispositivo no tiene swap activo, o su kernel es anterior a la 5.4.</string>
<string name="stores_storage_insufficient">No hay suficiente espacio libre: se necesitan %1$s y solo hay %2$s libres</string>
<string name="stores_storage_low">Espacio insuficiente (%1$s libres, se necesitan %2$s)</string>
<string name="stores_target_free_unknown">Espacio libre desconocido</string>
</resources>
+12 -2
View File
@@ -893,8 +893,8 @@
<string name="wadb_turn_off">Kytke raja pois päältä</string>
<string name="wadb_other_ways">Muita tapoja muuttaa sitä</string>
<string name="wadb_dev_try_first">1 · Kehittäjäasetukset (kokeile ensin)</string>
<string name="wadb_restrict_on">Aseta ”Restrict child processes” päälle.</string>
<string name="wadb_restrict_off">Aseta ”Restrict child processes” pois päältä.</string>
<string name="wadb_restrict_on">Aseta ”Poista käytöstä alatason prosessirajoitukset” pois päältä.</string>
<string name="wadb_restrict_off">Aseta ”Poista käytöstä alatason prosessirajoitukset” päälle.</string>
<string name="wadb_computer_last">3 · Tietokoneen ADB (viimeinen keino)</string>
<string name="wadb_only_if">Vain jos Langaton virheenkorjaus ei ole käytettävissä.</string>
<string name="wadb_computer_group">3 · Tietokoneen ADB (viimeinen keino)</string>
@@ -1919,6 +1919,16 @@
<string name="stores_free">Ilmainen</string>
<string name="stores_resume">Jatka</string>
<string name="stores_refresh">Päivitä</string>
<string name="stores_sort">Järjestä</string>
<string name="stores_sort_last_played">Viimeksi pelatut</string>
<string name="stores_sort_recently_installed">Viimeksi asennetut</string>
<string name="stores_sort_title_asc">Nimi A–Ö</string>
<string name="stores_sort_title_desc">Nimi Ö–A</string>
<string name="stores_sort_size_desc">Koko: suurin</string>
<string name="stores_sort_size_asc">Koko: pienin</string>
<string name="stores_sort_release_date">Julkaisupäivä</string>
<string name="stores_view_list">Luettelonäkymä</string>
<string name="stores_view_cards">Korttinäkymä</string>
<string name="stores_show_mature">Näytä aikuisille tarkoitettu sisältö</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+20 -4
View File
@@ -306,8 +306,8 @@
<string name="mode_sgdb_key">Clé API SteamGridDB</string>
<string name="mode_sgdb_key_yours">Votre clé</string>
<string name="mode_sgdb_edit">Modifier…</string>
<string name="mode_added_art_hint">Complète les images manquantes selon le nom du dossier. Les fichiers cover.jpg, hero.jpg, logo.png ou icon.png dans le dossier du jeu sont prioritaires.</string>
<string name="summary_remove_game">Remove %1$s</string>
<string name="mode_added_art_hint">Complète les images manquantes depuis Steam, puis SteamGridDB. Les fichiers cover.jpg, hero.jpg, logo.png ou icon.png que vous placez dans le dossier du jeu sont prioritaires.</string>
<string name="summary_remove_game">Retirer %1$s</string>
<string name="mode_added_remove_confirm">Retirer ?</string>
<string name="games_add">Ajouter un jeu</string>
<string name="games_add_title">Ajouter un jeu :</string>
@@ -907,8 +907,8 @@
<string name="wadb_turn_off">Désactiver la limite</string>
<string name="wadb_other_ways">Autres méthodes de modification</string>
<string name="wadb_dev_try_first">1 · Options pour les développeurs (à essayer en premier)</string>
<string name="wadb_restrict_on">Activez « Limiter les processus enfants ».</string>
<string name="wadb_restrict_off">Désactivez « Limiter les processus enfants ».</string>
<string name="wadb_restrict_on">Désactivez «Désactiver les limites pour les processus enfant».</string>
<string name="wadb_restrict_off">Activez «Désactiver les limites pour les processus enfant».</string>
<string name="wadb_computer_last">3 · ADB sur PC (en dernier recours)</string>
<string name="wadb_only_if">À utiliser uniquement si le débogage sans fil n\'est pas disponible.</string>
<string name="wadb_computer_group">3 · ADB sur PC (en dernier recours)</string>
@@ -1948,6 +1948,16 @@
<string name="stores_free">Gratuit</string>
<string name="stores_resume">Reprendre</string>
<string name="stores_refresh">Actualiser</string>
<string name="stores_sort">Trier</string>
<string name="stores_sort_last_played">Joués récemment</string>
<string name="stores_sort_recently_installed">Installés récemment</string>
<string name="stores_sort_title_asc">Titre A–Z</string>
<string name="stores_sort_title_desc">Titre Z–A</string>
<string name="stores_sort_size_desc">Taille : plus grand</string>
<string name="stores_sort_size_asc">Taille : plus petit</string>
<string name="stores_sort_release_date">Date de sortie</string>
<string name="stores_view_list">Vue liste</string>
<string name="stores_view_cards">Vue cartes</string>
<string name="stores_show_mature">Afficher le contenu pour adultes</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -2265,4 +2275,10 @@
<string name="drawer_component_downloads">Télécharger des composants</string>
<string name="drawer_component_downloads_hint">Les téléchargements sont partagés avec la page « Composants ». Choisissez une version téléchargée ci-dessus pour l\'utiliser au prochain lancement du jeu.</string>
<string name="drawer_component_choose_download">Choisissez une version à télécharger</string>
<string name="mode_zram">Compression zRAM</string>
<string name="mode_zram_hint">Pendant qu\'un jeu tourne, la mémoire du client Steam est compressée dans la zram de l\'appareil, ce qui laisse plus de RAM au jeu. S\'applique au prochain démarrage de Steam.</string>
<string name="mode_zram_unsupported">Indisponible : cet appareil n\'a pas de swap actif, ou son noyau est antérieur à la version 5.4.</string>
<string name="stores_storage_insufficient">Espace libre insuffisant : %1$s nécessaires, seulement %2$s libres</string>
<string name="stores_storage_low">Espace insuffisant (%1$s libres, %2$s nécessaires)</string>
<string name="stores_target_free_unknown">Espace libre inconnu</string>
</resources>
+12 -2
View File
@@ -893,8 +893,8 @@
<string name="wadb_turn_off">सीमा बंद करें</string>
<string name="wadb_other_ways">इसे बदलने के अन्य तरीके</string>
<string name="wadb_dev_try_first">1 · डेवलपर विकल्प (पहले आज़माएं)</string>
<string name="wadb_restrict_on">“Restrict child processes” चालू करें।</string>
<string name="wadb_restrict_off">“Restrict child processes” बंद करें।</string>
<string name="wadb_restrict_on">“चाइल्ड प्रोसेस से जुड़ी पाबंदियां हटाएं” बंद करें।</string>
<string name="wadb_restrict_off">“चाइल्ड प्रोसेस से जुड़ी पाबंदियां हटाएं” चालू करें।</string>
<string name="wadb_computer_last">3 · कंप्यूटर ADB (आख़िरी विकल्प)</string>
<string name="wadb_only_if">सिर्फ़ तब जब वायरलेस डीबगिंग उपलब्ध न हो।</string>
<string name="wadb_computer_group">3 · कंप्यूटर ADB (आख़िरी विकल्प)</string>
@@ -1919,6 +1919,16 @@
<string name="stores_free">फ़्री</string>
<string name="stores_resume">फिर से शुरू करें</string>
<string name="stores_refresh">रीफ़्रेश करें</string>
<string name="stores_sort">क्रमबद्ध करें</string>
<string name="stores_sort_last_played">हाल में खेले गए</string>
<string name="stores_sort_recently_installed">हाल में इंस्टॉल किए गए</string>
<string name="stores_sort_title_asc">शीर्षक A–Z</string>
<string name="stores_sort_title_desc">शीर्षक Z–A</string>
<string name="stores_sort_size_desc">आकार: सबसे बड़ा</string>
<string name="stores_sort_size_asc">आकार: सबसे छोटा</string>
<string name="stores_sort_release_date">रिलीज़ तिथि</string>
<string name="stores_view_list">सूची दृश्य</string>
<string name="stores_view_cards">कार्ड दृश्य</string>
<string name="stores_show_mature">वयस्क कंटेंट दिखाएं</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -893,8 +893,8 @@
<string name="wadb_turn_off">Korlát kikapcsolása</string>
<string name="wadb_other_ways">Egyéb módok a módosítására</string>
<string name="wadb_dev_try_first">1 · Fejlesztői beállítások (próbálja ezt először)</string>
<string name="wadb_restrict_on">Kapcsolja be a „Gyermekfolyamatok korlátozása” lehetőséget.</string>
<string name="wadb_restrict_off">Kapcsolja ki a „Gyermekfolyamatok korlátozása” lehetőséget.</string>
<string name="wadb_restrict_on">Kapcsolja ki az „Alárendelt folyamatok korlátozásának kikapcsolása” lehetőséget.</string>
<string name="wadb_restrict_off">Kapcsolja be az „Alárendelt folyamatok korlátozásának kikapcsolása” lehetőséget.</string>
<string name="wadb_computer_last">3 · Számítógépes ADB (végső megoldás)</string>
<string name="wadb_only_if">Csak ha a vezeték nélküli hibakeresés nem elérhető.</string>
<string name="wadb_computer_group">3 · Számítógépes ADB (végső megoldás)</string>
@@ -1919,6 +1919,16 @@
<string name="stores_free">Ingyenes</string>
<string name="stores_resume">Folytatás</string>
<string name="stores_refresh">Frissítés</string>
<string name="stores_sort">Rendezés</string>
<string name="stores_sort_last_played">Nemrég játszott</string>
<string name="stores_sort_recently_installed">Nemrég telepített</string>
<string name="stores_sort_title_asc">Cím A–Z</string>
<string name="stores_sort_title_desc">Cím Z–A</string>
<string name="stores_sort_size_desc">Méret: legnagyobb</string>
<string name="stores_sort_size_asc">Méret: legkisebb</string>
<string name="stores_sort_release_date">Megjelenés dátuma</string>
<string name="stores_view_list">Listanézet</string>
<string name="stores_view_cards">Kártyanézet</string>
<string name="stores_show_mature">Felnőtt tartalom megjelenítése</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -887,8 +887,8 @@
<string name="wadb_turn_off">Nonaktifkan batas</string>
<string name="wadb_other_ways">Cara lain untuk mengubahnya</string>
<string name="wadb_dev_try_first">1 · Opsi pengembang (coba dahulu)</string>
<string name="wadb_restrict_on">Aktifkan “Restrict child processes”.</string>
<string name="wadb_restrict_off">Nonaktifkan “Restrict child processes”.</string>
<string name="wadb_restrict_on">Nonaktifkan “Nonaktifkan batasan proses turunan”.</string>
<string name="wadb_restrict_off">Aktifkan “Nonaktifkan batasan proses turunan”.</string>
<string name="wadb_computer_last">3 · ADB komputer (upaya terakhir)</string>
<string name="wadb_only_if">Hanya jika Debugging nirkabel tidak tersedia.</string>
<string name="wadb_computer_group">3 · ADB komputer (upaya terakhir)</string>
@@ -1898,6 +1898,16 @@
<string name="stores_free">Gratis</string>
<string name="stores_resume">Lanjutkan</string>
<string name="stores_refresh">Segarkan</string>
<string name="stores_sort">Urutkan</string>
<string name="stores_sort_last_played">Baru dimainkan</string>
<string name="stores_sort_recently_installed">Baru dipasang</string>
<string name="stores_sort_title_asc">Judul A–Z</string>
<string name="stores_sort_title_desc">Judul Z–A</string>
<string name="stores_sort_size_desc">Ukuran: terbesar</string>
<string name="stores_sort_size_asc">Ukuran: terkecil</string>
<string name="stores_sort_release_date">Tanggal rilis</string>
<string name="stores_view_list">Tampilan daftar</string>
<string name="stores_view_cards">Tampilan kartu</string>
<string name="stores_show_mature">Tampilkan konten dewasa</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+26 -2
View File
@@ -899,8 +899,8 @@
<string name="wadb_turn_off">Disattiva il limite</string>
<string name="wadb_other_ways">Altri modi per cambiarlo</string>
<string name="wadb_dev_try_first">1 · Opzioni sviluppatore (da provare prima)</string>
<string name="wadb_restrict_on">Attiva “Limita processi figlio”.</string>
<string name="wadb_restrict_off">Disattiva “Limita processi figlio”.</string>
<string name="wadb_restrict_on">Disattiva “Disattiva limitazioni per i processi secondari”.</string>
<string name="wadb_restrict_off">Attiva “Disattiva limitazioni per i processi secondari”.</string>
<string name="wadb_computer_last">3 · ADB da computer (ultima risorsa)</string>
<string name="wadb_only_if">Solo se il Debug wireless non è disponibile.</string>
<string name="wadb_computer_group">3 · ADB da computer (ultima risorsa)</string>
@@ -1940,6 +1940,16 @@
<string name="stores_free">Gratis</string>
<string name="stores_resume">Riprendi</string>
<string name="stores_refresh">Aggiorna</string>
<string name="stores_sort">Ordina</string>
<string name="stores_sort_last_played">Giocate di recente</string>
<string name="stores_sort_recently_installed">Installate di recente</string>
<string name="stores_sort_title_asc">Titolo A–Z</string>
<string name="stores_sort_title_desc">Titolo Z–A</string>
<string name="stores_sort_size_desc">Dimensione: maggiore</string>
<string name="stores_sort_size_asc">Dimensione: minore</string>
<string name="stores_sort_release_date">Data di uscita</string>
<string name="stores_view_list">Visualizzazione elenco</string>
<string name="stores_view_cards">Visualizzazione schede</string>
<string name="stores_show_mature">Mostra contenuti per adulti</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -2257,4 +2267,18 @@
<string name="stores_hltb_completionist">Completista</string>
<string name="stores_hltb_hours">%1$s h</string>
<string name="stores_hltb_minutes">%1$d min</string>
<string name="mode_zram">Compressione zRAM</string>
<string name="mode_zram_hint">Mentre un gioco è in esecuzione, la memoria del client Steam viene compressa nella zram del dispositivo, lasciando più RAM al gioco. Si applica al prossimo avvio di Steam.</string>
<string name="mode_zram_unsupported">Non disponibile: questo dispositivo non ha zram o swap, oppure il suo kernel è precedente alla 5.4.</string>
<string name="setup_reset_settings">Ripristina tutte le impostazioni</string>
<string name="setup_reset_settings_title">Ripristinare tutte le impostazioni?</string>
<string name="setup_reset_settings_body">Le impostazioni di schermo, prestazioni, controller, tema, lingua e launcher tornano ai valori predefiniti. Giochi, accesso a Steam, account degli store, driver scaricati e cartelle di archiviazione vengono mantenuti.</string>
<string name="setup_reset_settings_button">Ripristina</string>
<string name="setup_reset_settings_hint">Riporta ogni impostazione al valore predefinito</string>
<string name="setup_reset_settings_partial">Le impostazioni sono state ripristinate, ma alcune parti no. I dettagli sono nei log.</string>
<string name="setup_reset_settings_profiles">Ripristina anche i profili dei giochi (Proton, FEX, componenti e ambiente di ogni gioco e l\'ambiente del profilo predefinito)</string>
<string name="setup_reset_settings_session_running">Termina la sessione prima di ripristinare le impostazioni.</string>
<string name="stores_storage_insufficient">Spazio libero insufficiente: servono %1$s, ne sono liberi solo %2$s</string>
<string name="stores_storage_low">Spazio insufficiente (%1$s liberi, ne servono %2$s)</string>
<string name="stores_target_free_unknown">Spazio libero sconosciuto</string>
</resources>
+36 -26
View File
@@ -205,7 +205,7 @@
<string name="add_app_folder_copied">このフォルダにはLinuxプログラムが含まれており、共有ストレージでは実行できないため、DroidDeckにコピーされます(%1$s)。</string>
<string name="add_app_confirm">追加</string>
<string name="add_app_cancel">キャンセル</string>
<string name="add_app_runtime_required">先に「設定」からLinux実行環境をインストールしてください。</string>
<string name="add_app_runtime_required">先に「セットアップ」からLinux実行環境をインストールしてください。</string>
<string name="add_app_busy">%1$sが完了するまでお待ちください。</string>
<string name="steam_compat_label">互換</string>
<string name="proton_compatible_note">Steamの互換性メニューで「%1$s」と表示されたビルドには、DroidDeckのプレフィックス修正が含まれており、ここでゲームを起動できます。デフォルトはProton Experimental ARM64(%1$s)で、より新しいProton 11.0 ARM64(%1$s)がインストールされている場合はそちらになります。この表示のないValve純正のProtonでは、このデバイスでゲームを起動できません。</string>
@@ -219,7 +219,7 @@
<string name="common_update">更新</string>
<string name="common_checking">確認中…</string>
<string name="common_working">処理中…</string>
<string name="common_forget">忘れる</string>
<string name="common_forget">解除</string>
<string name="common_add_ellipsis">追加…</string>
<string name="common_use">使用</string>
<string name="common_applies_next_session">次回のセッションで有効になります。</string>
@@ -289,12 +289,12 @@
<string name="mode_decky_installed">インストール済み · %1$s</string>
<string name="mode_decky_update">アップデートあり · %1$s</string>
<string name="mode_decky_current">最新です · %1$s</string>
<string name="mode_decky_loader">Loader</string>
<string name="mode_decky_loader">ローダー</string>
<string name="mode_decky_install_latest">最新バージョンをインストール</string>
<string name="mode_decky_on">Steamと共に起動します。有効にすると、このデバイス上の他のアプリがSteamを制御できる場合があります。</string>
<string name="mode_decky_off">オフ。Steamのリモートデバッグポートは閉じたままになります。</string>
<string name="mode_decky_remove_title">Decky Loaderをアンインストールしますか?</string>
<string name="mode_decky_remove_text">Loaderを削除します。プラグインと設定は保持されます。</string>
<string name="mode_decky_remove_text">ローダーを削除します。プラグインと設定は保持されます。</string>
<string name="mode_client">クライアント</string>
<string name="mode_mangoapp">パフォーマンスオーバーレイ</string>
<string name="mode_mangoapp_hint">Deckモードでゲームがクラッシュしたり画面が真っ暗になる場合は、これをオフにしてください。次回のセッションで有効になります。</string>
@@ -306,8 +306,8 @@
<string name="mode_sgdb_key">SteamGridDB API キー</string>
<string name="mode_sgdb_key_yours">自分のキー</string>
<string name="mode_sgdb_edit">編集…</string>
<string name="mode_added_art_hint">フォルダ名に基づいて不足している画像を補完します。ゲームフォルダ内のcover.jpg、hero.jpg、logo.png、またはicon.pngが優先的に使用されます。</string>
<string name="summary_remove_game">Remove %1$s</string>
<string name="mode_added_art_hint">不足しているアートワークをSteamから、次にSteamGridDBから補完します。ゲームフォルダ内のcover.jpg、hero.jpg、logo.png、icon.pngが優先されます。</string>
<string name="summary_remove_game">%1$sを削除</string>
<string name="mode_added_remove_confirm">削除?</string>
<string name="games_add">ゲームを追加</string>
<string name="games_add_title">ゲームを追加:</string>
@@ -340,14 +340,14 @@
<string name="wincomp_found_bundled">ゲームに%1$sが同梱されています</string>
<string name="wincomp_found_shipped">ゲームに%1$sがあります(そのままで動くことが多いです)</string>
<string name="wincomp_already_here">このゲームに導入済み</string>
<string name="wincomp_no_recommendation">ゲームのフォルダーには、必要なコンポーネントを示すものがありません。</string>
<string name="wincomp_no_recommendation">ゲームのフォルダには、必要なコンポーネントを示すものがありません。</string>
<string name="wincomp_active">このゲームにインストール済み(%1$d)</string>
<string name="wincomp_all">すべてのコンポーネント(%1$d)</string>
<string name="wincomp_installers">Windowsインストーラーが必要(%1$d)</string>
<string name="wincomp_installers_note">これらはプレフィックス内で実際のインストーラーを実行します(.NET、PhysX、XNA、Visual C++のフルインストーラーなど)。DroidDeckはまだ対応していませんが、次に対応予定です。</string>
<string name="wincomp_installers_note">これらはそれぞれ独自のセットアッププログラムで、中に取り出せるパッケージはなく、何をインストールするかの記録もまだありません。多くはProton内蔵のMonoで代用できる古いランタイムで、記録は作成次第追加されます。</string>
<string name="wincomp_show">表示</string>
<string name="wincomp_hide">非表示</string>
<string name="wincomp_needs_installer">Windowsインストーラーが必要(対応予定)</string>
<string name="wincomp_needs_installer">独自のセットアッププログラムを実行します(記録はまだありません)</string>
<string name="wincomp_unsupported">ここではまだ未対応</string>
<string name="wincomp_loading">コンポーネントを読み込み中…</string>
<string name="wincomp_failed">インストールできませんでした: %1$s</string>
@@ -467,7 +467,7 @@
<string name="comp_applies_next_game">次回のゲーム起動時に有効になります</string>
<string name="comp_import_zip">.zipをインポート</string>
<string name="comp_reading">Protonを読み込み中…</string>
<string name="comp_no_proton">Protonがインストールされていません。一度Steamを起動してARM64 Protonをダウンロードするか、「設定」からGE-ProtonまたはCachyOSを追加してください。</string>
<string name="comp_no_proton">Protonがインストールされていません。一度Steamを起動してARM64 Protonをダウンロードするか、「セットアップ」からGE-ProtonまたはCachyOSを追加してください。</string>
<string name="comp_original">元 · %1$s</string>
<string name="comp_this_build">%1$s · 現在のビルド</string>
<string name="comp_earlier_build">%1$s · 以前のビルド</string>
@@ -533,7 +533,7 @@
<string name="perf_fastpath">prootファストパス</string>
<string name="perf_fastpath_needs_seccomp">prootのseccompフィルターが必要です。</string>
<string name="perf_fastpath_hint">ファイル検索が速くなり、スタッターが減ります。プログラムがファイルを見つけられない場合は、これをオフにしてください。</string>
<string name="perf_identity">セッションID</string>
<string name="perf_identity">セッションの識別情報</string>
<string name="perf_hostname">ホスト名</string>
<string name="perf_hostname_hint">Steamがこのデバイスを認識する名前。空にすると%1$sに戻ります。</string>
<string name="perf_hostname_invalid">英数字と中間のハイフンのみ使用でき、最大63文字です。</string>
@@ -639,7 +639,7 @@
<string name="setup_tab_controller">コントローラー</string>
<string name="setup_tab_session">セッション</string>
<string name="setup_tab_launcher">ランチャー</string>
<string name="setup_title">設定</string>
<string name="setup_title">セットアップ</string>
<string name="setup_all_set">● すべて準備完了</string>
<string name="setup_n_ready">%1$d/%2$d 準備完了</string>
<string name="setup_system_check">システムチェック</string>
@@ -733,7 +733,7 @@
<string name="store_title">ストア</string>
<string name="store_chip_flathub">Flathub · ARM64</string>
<string name="store_chip_ready">● Flatpakの準備完了</string>
<string name="store_needs_runtime">先に「設定」からLinux実行環境をインストールしてください。</string>
<string name="store_needs_runtime">先に「セットアップ」からLinux実行環境をインストールしてください。</string>
<string name="store_setup_title">Flatpakをセットアップ</string>
<string name="store_setup_text">Flatpakを追加し、Flathubに接続します(約20MB)。最初のアプリは実行環境もダウンロードします。</string>
<string name="store_setting_up">セットアップ中…</string>
@@ -895,8 +895,8 @@
<string name="wadb_turn_off">制限をオフにする</string>
<string name="wadb_other_ways">その他の変更方法</string>
<string name="wadb_dev_try_first">1 · 開発者向けオプション(最初に試す)</string>
<string name="wadb_restrict_on">「子プロセスを制限」をオンにします。</string>
<string name="wadb_restrict_off">「子プロセスを制限」をオフにします。</string>
<string name="wadb_restrict_on">「子プロセスの制限を無効化」をオフにします。</string>
<string name="wadb_restrict_off">「子プロセスの制限を無効化」をオンにします。</string>
<string name="wadb_computer_last">3 · PC ADB(最終手段)</string>
<string name="wadb_only_if">ワイヤレスデバッグが利用できない場合にのみ使用してください。</string>
<string name="wadb_computer_group">3 · PC ADB(最終手段)</string>
@@ -952,7 +952,7 @@
<string name="content_runtime_required">実行環境が必要です</string>
<string name="content_loading_details">インストール詳細を読み込み中…</string>
<string name="content_details_unavailable">インストール詳細は利用できません。後でもう一度お試しください。</string>
<string name="content_needs_runtime">先に「設定」からLinux実行環境をインストールしてください。</string>
<string name="content_needs_runtime">先に「セットアップ」からLinux実行環境をインストールしてください。</string>
<string name="content_stop_first">実行中のセッションを停止してからデスクトップアプリをインストールしてください。</string>
<string name="content_install_into">%1$sをLinuxデスクトップにインストールします。</string>
<string name="store_busy_percent_short">%1$s · %2$d%%</string>
@@ -990,8 +990,8 @@
<string name="games_export_winlator">Winlatorアーカイブとしてエクスポート…</string>
<string name="games_open_save_folder">セーブフォルダを開く</string>
<string name="games_never_played">未プレイ</string>
<string name="games_runtime_busy_percent">実行環境がビジー · %1$d%%</string>
<string name="games_runtime_busy">実行環境がビジー</string>
<string name="games_runtime_busy_percent">実行環境は使用中 · %1$d%%</string>
<string name="games_runtime_busy">実行環境は使用中</string>
<string name="games_runtime_first_play">初回実行時に実行環境を導入</string>
<string name="games_runtime_update">実行環境にアップデートがあります</string>
<string name="games_runtime_ready">● 実行環境の準備完了</string>
@@ -1067,7 +1067,7 @@
<string name="rail_store">ストア</string>
<string name="rail_components">コンポーネント</string>
<string name="rail_apps">アプリ</string>
<string name="rail_setup">設定</string>
<string name="rail_setup">セットアップ</string>
<string name="rail_updates">アップデート</string>
<string name="rail_percent">%1$d%%</string>
<string name="rail_resume_named">%1$sを再開</string>
@@ -1196,7 +1196,7 @@
<string name="drivers_pick_any">ドライバーzipまたはAndroid + Linuxバンドルを選択</string>
<string name="main_pkg_problem">%1$s:%2$s</string>
<string name="main_removing_named">%1$sを削除中…</string>
<string name="main_forgetting_named">%1$sを登録解除中…</string>
<string name="main_forgetting_named">%1$sを解除中…</string>
<string name="main_pick_game_storage">ゲームの保存先フォルダを選択</string>
<string name="main_pick_decky_zip">Deckyプラグインのzipを選択</string>
<string name="main_storage_not_usable">使用できません:%1$s</string>
@@ -1554,7 +1554,7 @@
<string name="flatpakmgr_ref_graphics_drivers">グラフィックドライバー</string>
<string name="flatpakmgr_ref_media_codecs">メディアコーデック</string>
<string name="flatpakmgr_ref_runtime">%1$sランタイム</string>
<string name="flatpakmgr_ref_runtime_branch">%1$sランタイム %2$s</string>
<string name="flatpakmgr_ref_runtime_branch">%1$s実行環境 %2$s</string>
<string name="appimg_too_small">ファイルが小さすぎるため、AppImageではありません</string>
<string name="appimg_unreadable">ファイルを読み取れません:%1$s</string>
@@ -1855,7 +1855,7 @@
<string name="source_steam">Steam</string>
<string name="source_added">カスタム</string>
<string name="setup_stores">ストア</string>
<string name="setup_stores_open_on">ストアの初期表示</string>
<string name="setup_stores_open_on">ストアページを開くときの初期タブ</string>
<string name="setup_stores_speed">ダウンロード速度レベル</string>
<string name="setup_stores_engine">ストアエンジン</string>
<string name="setup_stores_engine_chip_ready">● エンジン準備完了</string>
@@ -1906,6 +1906,16 @@
<string name="stores_free">無料</string>
<string name="stores_resume">再開</string>
<string name="stores_refresh">更新</string>
<string name="stores_sort">並べ替え</string>
<string name="stores_sort_last_played">最近プレイ</string>
<string name="stores_sort_recently_installed">最近インストール</string>
<string name="stores_sort_title_asc">タイトル A–Z</string>
<string name="stores_sort_title_desc">タイトル Z–A</string>
<string name="stores_sort_size_desc">サイズ: 大きい順</string>
<string name="stores_sort_size_asc">サイズ: 小さい順</string>
<string name="stores_sort_release_date">リリース日</string>
<string name="stores_view_list">リスト表示</string>
<string name="stores_view_cards">カード表示</string>
<string name="stores_show_mature">成人向けコンテンツを表示</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -2033,11 +2043,11 @@
<string name="common_close">閉じる</string>
<string name="common_back">戻る</string>
<string name="common_edit">編集</string>
<string name="games_add_all">このフォルダーのゲームをすべて追加</string>
<string name="games_added_none">このフォルダーに新しいゲームはありません</string>
<string name="games_add_all">このフォルダのゲームをすべて追加</string>
<string name="games_added_none">このフォルダに新しいゲームはありません</string>
<string name="edit_name">名前</string>
<string name="edit_target">ターゲット</string>
<string name="edit_start_in">開始フォルダー</string>
<string name="edit_start_in">開始フォルダ</string>
<string name="edit_launch_options">起動オプション</string>
<string name="edit_artwork">アートワーク</string>
<string name="edit_other_exe">別の exe…</string>
@@ -2046,7 +2056,7 @@
<string name="art_background">背景</string>
<string name="art_logo">ロゴ</string>
<string name="art_icon">アイコン</string>
<string name="art_src_folder">ゲームフォルダー</string>
<string name="art_src_folder">ゲームフォルダ</string>
<string name="art_src_steam">Steam</string>
<string name="art_src_sgdb">SteamGridDB</string>
<string name="art_src_file">自分のファイル</string>
+16 -6
View File
@@ -306,8 +306,8 @@
<string name="mode_sgdb_key">SteamGridDB API 키</string>
<string name="mode_sgdb_key_yours">내 키</string>
<string name="mode_sgdb_edit">편집…</string>
<string name="mode_added_art_hint">폴더 이름을 기준으로 누락된 이미지를 채웁니다. 게임 폴더의 cover.jpg, hero.jpg, logo.png 또는 icon.png가 우선적으로 사용됩니다.</string>
<string name="summary_remove_game">Remove %1$s</string>
<string name="mode_added_art_hint">누락된 이미지를 Steam, 그다음 SteamGridDB에서 채웁니다. 게임 폴더의 cover.jpg, hero.jpg, logo.png 또는 icon.png가 우선적으로 사용됩니다.</string>
<string name="summary_remove_game">%1$s 제거</string>
<string name="mode_added_remove_confirm">제거?</string>
<string name="games_add">게임 추가</string>
<string name="games_add_title">게임 추가:</string>
@@ -344,10 +344,10 @@
<string name="wincomp_active">이 게임에 설치됨 (%1$d)</string>
<string name="wincomp_all">모든 구성 요소 (%1$d)</string>
<string name="wincomp_installers">Windows 설치 프로그램 필요 (%1$d)</string>
<string name="wincomp_installers_note">이 항목들은 프리픽스 안에서 실제 설치 프로그램을 실행합니다(.NET, PhysX, XNA, 전체 Visual C++ 설치 프로그램 등). DroidDeck은 아직 지원하지 않으며 다음에 지원할 예정입니다.</string>
<string name="wincomp_installers_note">이 항목들은 내부에 풀어낼 패키지가 없는 자체 설치 프로그램이며, 설치하는 내용은 아직 기록되지 않았습니다. 대부분 Proton에 포함된 Mono가 이미 대신하는 오래된 런타임이며, 기록은 만들어지는 대로 추가됩니다.</string>
<string name="wincomp_show">표시</string>
<string name="wincomp_hide">숨기기</string>
<string name="wincomp_needs_installer">Windows 설치 프로그램 필요 (예정)</string>
<string name="wincomp_needs_installer">자체 설치 프로그램을 실행합니다 (아직 기록 없음)</string>
<string name="wincomp_unsupported">아직 여기서 지원되지 않음</string>
<string name="wincomp_loading">구성 요소를 불러오는 중…</string>
<string name="wincomp_failed">설치할 수 없습니다: %1$s</string>
@@ -895,8 +895,8 @@
<string name="wadb_turn_off">제한 끄기</string>
<string name="wadb_other_ways">기타 변경 방법</string>
<string name="wadb_dev_try_first">1 · 개발자 옵션(먼저 시도)</string>
<string name="wadb_restrict_on">\"하위 프로세스 제한\"을 켭니다.</string>
<string name="wadb_restrict_off">\"하위 프로세스 제한\"을 끕니다.</string>
<string name="wadb_restrict_on">\"하위 프로세스 제한 사용 중지\"를 끕니다.</string>
<string name="wadb_restrict_off">\"하위 프로세스 제한 사용 중지\"를 켭니다.</string>
<string name="wadb_computer_last">3 · PC ADB(최후의 수단)</string>
<string name="wadb_only_if">무선 디버깅을 사용할 수 없을 때만 사용하세요.</string>
<string name="wadb_computer_group">3 · PC ADB(최후의 수단)</string>
@@ -1906,6 +1906,16 @@
<string name="stores_free">무료</string>
<string name="stores_resume">재개</string>
<string name="stores_refresh">새로 고침</string>
<string name="stores_sort">정렬</string>
<string name="stores_sort_last_played">최근 플레이</string>
<string name="stores_sort_recently_installed">최근 설치</string>
<string name="stores_sort_title_asc">제목 A–Z</string>
<string name="stores_sort_title_desc">제목 Z–A</string>
<string name="stores_sort_size_desc">크기: 큰순</string>
<string name="stores_sort_size_asc">크기: 작은순</string>
<string name="stores_sort_release_date">출시일</string>
<string name="stores_view_list">목록 보기</string>
<string name="stores_view_cards">카드 보기</string>
<string name="stores_show_mature">성인용 콘텐츠 표시</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -887,8 +887,8 @@
<string name="wadb_turn_off">Matikan had</string>
<string name="wadb_other_ways">Cara lain untuk menukarnya</string>
<string name="wadb_dev_try_first">1 · Pilihan pembangun (cuba dahulu)</string>
<string name="wadb_restrict_on">Tetapkan “Sekat proses anak” hidup.</string>
<string name="wadb_restrict_off">Tetapkan “Sekat proses anak” mati.</string>
<string name="wadb_restrict_on">Tetapkan “Lumpuhkan sekatan proses anak” mati.</string>
<string name="wadb_restrict_off">Tetapkan “Lumpuhkan sekatan proses anak” hidup.</string>
<string name="wadb_computer_last">3 · ADB komputer (pilihan akhir)</string>
<string name="wadb_only_if">Hanya jika Debugging Wayarles tidak tersedia.</string>
<string name="wadb_computer_group">3 · ADB komputer (pilihan akhir)</string>
@@ -1898,6 +1898,16 @@
<string name="stores_free">Percuma</string>
<string name="stores_resume">Sambung</string>
<string name="stores_refresh">Segar semula</string>
<string name="stores_sort">Isih</string>
<string name="stores_sort_last_played">Baru dimainkan</string>
<string name="stores_sort_recently_installed">Baru dipasang</string>
<string name="stores_sort_title_asc">Tajuk A–Z</string>
<string name="stores_sort_title_desc">Tajuk Z–A</string>
<string name="stores_sort_size_desc">Saiz: terbesar</string>
<string name="stores_sort_size_asc">Saiz: terkecil</string>
<string name="stores_sort_release_date">Tarikh keluaran</string>
<string name="stores_view_list">Paparan senarai</string>
<string name="stores_view_cards">Paparan kad</string>
<string name="stores_show_mature">Papar kandungan matang</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -893,8 +893,8 @@
<string name="wadb_turn_off">Slå av grensen</string>
<string name="wadb_other_ways">Andre måter å endre det</string>
<string name="wadb_dev_try_first">1 · Utvikleralternativer (prøv først)</string>
<string name="wadb_restrict_on">Slå på «Restrict child processes».</string>
<string name="wadb_restrict_off">Slå av «Restrict child processes».</string>
<string name="wadb_restrict_on">Slå av «Slå av begrensninger for underordnede prosesser».</string>
<string name="wadb_restrict_off">Slå på «Slå av begrensninger for underordnede prosesser».</string>
<string name="wadb_computer_last">3 · ADB fra datamaskin (siste utvei)</string>
<string name="wadb_only_if">Bare hvis trådløs feilsøking ikke er tilgjengelig.</string>
<string name="wadb_computer_group">3 · ADB fra datamaskin (siste utvei)</string>
@@ -1919,6 +1919,16 @@
<string name="stores_free">Gratis</string>
<string name="stores_resume">Gjenoppta</string>
<string name="stores_refresh">Oppdater</string>
<string name="stores_sort">Sorter</string>
<string name="stores_sort_last_played">Nylig spilt</string>
<string name="stores_sort_recently_installed">Nylig installert</string>
<string name="stores_sort_title_asc">Tittel A–Å</string>
<string name="stores_sort_title_desc">Tittel Å–A</string>
<string name="stores_sort_size_desc">Størrelse: størst</string>
<string name="stores_sort_size_asc">Størrelse: minst</string>
<string name="stores_sort_release_date">Utgivelsesdato</string>
<string name="stores_view_list">Listevisning</string>
<string name="stores_view_cards">Kortvisning</string>
<string name="stores_show_mature">Vis innhold for voksne</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -893,8 +893,8 @@
<string name="wadb_turn_off">Limiet uitschakelen</string>
<string name="wadb_other_ways">Andere manieren om dit te wijzigen</string>
<string name="wadb_dev_try_first">1 · Opties voor ontwikkelaars (probeer dit eerst)</string>
<string name="wadb_restrict_on">Zet “Subprocessen beperken” aan.</string>
<string name="wadb_restrict_off">Zet “Subprocessen beperken” uit.</string>
<string name="wadb_restrict_on">Zet “Beperkingen voor onderliggende processen uitzetten” uit.</string>
<string name="wadb_restrict_off">Zet “Beperkingen voor onderliggende processen uitzetten” aan.</string>
<string name="wadb_computer_last">3 · Computer-ADB (laatste redmiddel)</string>
<string name="wadb_only_if">Alleen als Draadloos debuggen niet beschikbaar is.</string>
<string name="wadb_computer_group">3 · Computer-ADB (laatste redmiddel)</string>
@@ -1919,6 +1919,16 @@
<string name="stores_free">Gratis</string>
<string name="stores_resume">Hervatten</string>
<string name="stores_refresh">Vernieuwen</string>
<string name="stores_sort">Sorteren</string>
<string name="stores_sort_last_played">Onlangs gespeeld</string>
<string name="stores_sort_recently_installed">Onlangs geïnstalleerd</string>
<string name="stores_sort_title_asc">Titel A–Z</string>
<string name="stores_sort_title_desc">Titel Z–A</string>
<string name="stores_sort_size_desc">Grootte: grootste</string>
<string name="stores_sort_size_asc">Grootte: kleinste</string>
<string name="stores_sort_release_date">Releasedatum</string>
<string name="stores_view_list">Lijstweergave</string>
<string name="stores_view_cards">Kaartweergave</string>
<string name="stores_show_mature">Inhoud voor volwassenen tonen</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -905,8 +905,8 @@
<string name="wadb_turn_off">Wyłącz limit</string>
<string name="wadb_other_ways">Inne sposoby na zmianę tego</string>
<string name="wadb_dev_try_first">1 · Opcje programisty (spróbuj najpierw)</string>
<string name="wadb_restrict_on">Ustaw „Ogranicz procesy podrzędne” na włączone.</string>
<string name="wadb_restrict_off">Ustaw „Ogranicz procesy podrzędne” na wyłączone.</string>
<string name="wadb_restrict_on">Ustaw „Wyłącz ograniczenia procesów podrzędnych aplikacji” na wyłączone.</string>
<string name="wadb_restrict_off">Ustaw „Wyłącz ograniczenia procesów podrzędnych aplikacji” na włączone.</string>
<string name="wadb_computer_last">3 · Komputer z ADB (ostatnia opcja)</string>
<string name="wadb_only_if">Tylko jeśli debugowanie bezprzewodowe jest niedostępne.</string>
<string name="wadb_computer_group">3 · Komputer z ADB (ostatnia opcja)</string>
@@ -1961,6 +1961,16 @@
<string name="stores_free">Bezpłatna</string>
<string name="stores_resume">Wznów</string>
<string name="stores_refresh">Odśwież</string>
<string name="stores_sort">Sortuj</string>
<string name="stores_sort_last_played">Ostatnio grane</string>
<string name="stores_sort_recently_installed">Ostatnio zainstalowane</string>
<string name="stores_sort_title_asc">Tytuł A–Z</string>
<string name="stores_sort_title_desc">Tytuł Z–A</string>
<string name="stores_sort_size_desc">Rozmiar: największy</string>
<string name="stores_sort_size_asc">Rozmiar: najmniejszy</string>
<string name="stores_sort_release_date">Data wydania</string>
<string name="stores_view_list">Widok listy</string>
<string name="stores_view_cards">Widok kart</string>
<string name="stores_show_mature">Pokaż treści dla dorosłych</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -899,8 +899,8 @@
<string name="wadb_turn_off">Desativar limite</string>
<string name="wadb_other_ways">Outras formas de o alterar</string>
<string name="wadb_dev_try_first">1 · Opções de programador (tente primeiro)</string>
<string name="wadb_restrict_on">Ative “Restringir processos secundários”.</string>
<string name="wadb_restrict_off">Desative “Restringir processos secundários”.</string>
<string name="wadb_restrict_on">Desative “Desativar restrições de processos secundários”.</string>
<string name="wadb_restrict_off">Ative “Desativar restrições de processos secundários”.</string>
<string name="wadb_computer_last">3 · ADB num computador (último recurso)</string>
<string name="wadb_only_if">Apenas se a Depuração sem fios não estiver disponível.</string>
<string name="wadb_computer_group">3 · ADB num computador (último recurso)</string>
@@ -1940,6 +1940,16 @@
<string name="stores_free">Grátis</string>
<string name="stores_resume">Retomar</string>
<string name="stores_refresh">Atualizar</string>
<string name="stores_sort">Ordenar</string>
<string name="stores_sort_last_played">Jogados recentemente</string>
<string name="stores_sort_recently_installed">Instalados recentemente</string>
<string name="stores_sort_title_asc">Título A–Z</string>
<string name="stores_sort_title_desc">Título Z–A</string>
<string name="stores_sort_size_desc">Tamanho: maior</string>
<string name="stores_sort_size_asc">Tamanho: menor</string>
<string name="stores_sort_release_date">Data de lançamento</string>
<string name="stores_view_list">Vista de lista</string>
<string name="stores_view_cards">Vista de cartões</string>
<string name="stores_show_mature">Mostrar conteúdo para adultos</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+26 -2
View File
@@ -899,8 +899,8 @@
<string name="wadb_turn_off">Desativar o limite</string>
<string name="wadb_other_ways">Outras formas de alterar</string>
<string name="wadb_dev_try_first">1 · Opções do desenvolvedor (tente primeiro)</string>
<string name="wadb_restrict_on">Ative “Restringir processos filhos”.</string>
<string name="wadb_restrict_off">Desative “Restringir processos filhos”.</string>
<string name="wadb_restrict_on">Desative “Desativar restrições de processos filhos”.</string>
<string name="wadb_restrict_off">Ative “Desativar restrições de processos filhos”.</string>
<string name="wadb_computer_last">3 · ADB pelo computador (último recurso)</string>
<string name="wadb_only_if">Só se a Depuração por Wi-Fi não estiver disponível.</string>
<string name="wadb_computer_group">3 · ADB pelo computador (último recurso)</string>
@@ -1940,6 +1940,16 @@
<string name="stores_free">Grátis</string>
<string name="stores_resume">Retomar</string>
<string name="stores_refresh">Atualizar</string>
<string name="stores_sort">Ordenar</string>
<string name="stores_sort_last_played">Jogados recentemente</string>
<string name="stores_sort_recently_installed">Instalados recentemente</string>
<string name="stores_sort_title_asc">Título A–Z</string>
<string name="stores_sort_title_desc">Título Z–A</string>
<string name="stores_sort_size_desc">Tamanho: maior</string>
<string name="stores_sort_size_asc">Tamanho: menor</string>
<string name="stores_sort_release_date">Data de lançamento</string>
<string name="stores_view_list">Vista de lista</string>
<string name="stores_view_cards">Vista de cartões</string>
<string name="stores_show_mature">Mostrar conteúdo adulto</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -2257,4 +2267,18 @@
<string name="stores_hltb_completionist">Completista</string>
<string name="stores_hltb_hours">%1$s h</string>
<string name="stores_hltb_minutes">%1$d min</string>
<string name="mode_zram">Compressão zRAM</string>
<string name="mode_zram_hint">Enquanto um jogo roda, a memória do cliente Steam é comprimida na zram do dispositivo, deixando mais RAM para o jogo. Vale a partir da próxima vez que a Steam iniciar.</string>
<string name="mode_zram_unsupported">Indisponível: este dispositivo não tem swap ativo, ou o kernel é anterior à versão 5.4.</string>
<string name="setup_reset_settings">Redefinir todas as configurações</string>
<string name="setup_reset_settings_title">Redefinir todas as configurações?</string>
<string name="setup_reset_settings_body">As configurações de tela, desempenho, controle, tema, idioma e inicializador voltam ao padrão. Seus jogos, o login da Steam, as contas das lojas, os drivers baixados e as pastas de armazenamento são mantidos.</string>
<string name="setup_reset_settings_button">Redefinir</string>
<string name="setup_reset_settings_hint">Volta todas as configurações ao padrão</string>
<string name="setup_reset_settings_partial">As configurações foram redefinidas, mas algumas partes não puderam ser. Os detalhes estão nos registros.</string>
<string name="setup_reset_settings_profiles">Redefinir também os perfis de jogo (Proton, FEX, componentes e ambiente de cada jogo e o ambiente do perfil Padrão)</string>
<string name="setup_reset_settings_session_running">Encerre a sessão antes de redefinir as configurações.</string>
<string name="stores_storage_insufficient">Espaço livre insuficiente: são necessários %1$s, só há %2$s livres</string>
<string name="stores_storage_low">Espaço insuficiente (%1$s livres, são necessários %2$s)</string>
<string name="stores_target_free_unknown">Espaço livre desconhecido</string>
</resources>
+12 -2
View File
@@ -899,8 +899,8 @@
<string name="wadb_turn_off">Dezactivează limita</string>
<string name="wadb_other_ways">Alte moduri de a o schimba</string>
<string name="wadb_dev_try_first">1 · Opțiuni pentru dezvoltatori (încearcă mai întâi)</string>
<string name="wadb_restrict_on">Activează „Restricționează procesele-copil”.</string>
<string name="wadb_restrict_off">Dezactivează „Restricționează procesele-copil”.</string>
<string name="wadb_restrict_on">Dezactivează „Dezactivează restricțiile pentru procese secundare”.</string>
<string name="wadb_restrict_off">Activează „Dezactivează restricțiile pentru procese secundare”.</string>
<string name="wadb_computer_last">3 · ADB pe computer (ultima soluție)</string>
<string name="wadb_only_if">Doar dacă Depanarea wireless nu este disponibilă.</string>
<string name="wadb_computer_group">3 · ADB pe computer (ultima soluție)</string>
@@ -1940,6 +1940,16 @@
<string name="stores_free">Gratuit</string>
<string name="stores_resume">Reluare</string>
<string name="stores_refresh">Reîmprospătează</string>
<string name="stores_sort">Sortează</string>
<string name="stores_sort_last_played">Jucate recent</string>
<string name="stores_sort_recently_installed">Instalate recent</string>
<string name="stores_sort_title_asc">Titlu A–Z</string>
<string name="stores_sort_title_desc">Titlu Z–A</string>
<string name="stores_sort_size_desc">Dimensiune: cea mai mare</string>
<string name="stores_sort_size_asc">Dimensiune: cea mai mică</string>
<string name="stores_sort_release_date">Data lansării</string>
<string name="stores_view_list">Vizualizare listă</string>
<string name="stores_view_cards">Vizualizare carduri</string>
<string name="stores_show_mature">Arată conținutul pentru adulți</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+20 -4
View File
@@ -306,8 +306,8 @@
<string name="mode_sgdb_key">API-ключ SteamGridDB</string>
<string name="mode_sgdb_key_yours">Ваш ключ</string>
<string name="mode_sgdb_edit">Изменить…</string>
<string name="mode_added_art_hint">Дополняет отсутствующие изображения по имени папки. Файлы cover.jpg, hero.jpg, logo.png или icon.png в папке с игрой имеют приоритет.</string>
<string name="summary_remove_game">Remove %1$s</string>
<string name="mode_added_art_hint">Дополняет отсутствующие изображения из Steam, затем из SteamGridDB. Файлы cover.jpg, hero.jpg, logo.png или icon.png в папке с игрой имеют приоритет.</string>
<string name="summary_remove_game">Убрать %1$s</string>
<string name="mode_added_remove_confirm">Убрать?</string>
<string name="games_add">Добавить игру</string>
<string name="games_add_title">Добавить игру:</string>
@@ -913,8 +913,8 @@
<string name="wadb_turn_off">Отключить ограничение</string>
<string name="wadb_other_ways">Другие способы изменения</string>
<string name="wadb_dev_try_first">1 · Для разработчиков (сначала попробуйте это)</string>
<string name="wadb_restrict_on">Включите «Ограничение дочерних процессов».</string>
<string name="wadb_restrict_off">Отключите «Ограничение дочерних процессов».</string>
<string name="wadb_restrict_on">Отключите «Отключить ограничения для дочерних процессов».</string>
<string name="wadb_restrict_off">Включите «Отключить ограничения для дочерних процессов».</string>
<string name="wadb_computer_last">3 · ADB на ПК (крайняя мера)</string>
<string name="wadb_only_if">Используйте только если отладка по Wi-Fi недоступна.</string>
<string name="wadb_computer_group">3 · ADB на ПК (крайняя мера)</string>
@@ -1969,6 +1969,16 @@
<string name="stores_free">Бесплатно</string>
<string name="stores_resume">Продолжить</string>
<string name="stores_refresh">Обновить</string>
<string name="stores_sort">Сортировка</string>
<string name="stores_sort_last_played">Недавно запущенные</string>
<string name="stores_sort_recently_installed">Недавно установленные</string>
<string name="stores_sort_title_asc">Название А–Я</string>
<string name="stores_sort_title_desc">Название Я–А</string>
<string name="stores_sort_size_desc">Размер: по убыванию</string>
<string name="stores_sort_size_asc">Размер: по возрастанию</string>
<string name="stores_sort_release_date">Дата выхода</string>
<string name="stores_view_list">Вид списком</string>
<string name="stores_view_cards">Вид карточками</string>
<string name="stores_show_mature">Показывать контент для взрослых</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -2290,4 +2300,10 @@
<string name="drawer_component_downloads">Скачать компоненты</string>
<string name="drawer_component_downloads_hint">Загрузки общие со страницей «Компоненты». Выберите выше скачанную версию, чтобы использовать её при следующем запуске игры.</string>
<string name="drawer_component_choose_download">Выберите версию для скачивания</string>
<string name="mode_zram">Сжатие zRAM</string>
<string name="mode_zram_hint">Пока идёт игра, память клиента Steam сжимается в zram устройства, и игре остаётся больше ОЗУ. Применяется при следующем запуске Steam.</string>
<string name="mode_zram_unsupported">Недоступно: на устройстве нет zram или swap, либо его ядро старше 5.4.</string>
<string name="stores_storage_insufficient">Недостаточно свободного места: нужно %1$s, свободно только %2$s</string>
<string name="stores_storage_low">Недостаточно места (свободно %1$s, нужно %2$s)</string>
<string name="stores_target_free_unknown">Свободное место неизвестно</string>
</resources>
+12 -2
View File
@@ -893,8 +893,8 @@
<string name="wadb_turn_off">Stäng av gränsen</string>
<string name="wadb_other_ways">Andra sätt att ändra det</string>
<string name="wadb_dev_try_first">1 · Utvecklaralternativ (prova först)</string>
<string name="wadb_restrict_on">Slå på ”Begränsa underprocesser”.</string>
<string name="wadb_restrict_off">Slå av ”Begränsa underprocesser”.</string>
<string name="wadb_restrict_on">Slå av ”Inaktivera begränsningar på underordnade processer”.</string>
<string name="wadb_restrict_off">Slå på ”Inaktivera begränsningar på underordnade processer”.</string>
<string name="wadb_computer_last">3 · Dator-ADB (sista utväg)</string>
<string name="wadb_only_if">Bara om Trådlös felsökning inte är tillgänglig.</string>
<string name="wadb_computer_group">3 · Dator-ADB (sista utväg)</string>
@@ -1919,6 +1919,16 @@
<string name="stores_free">Gratis</string>
<string name="stores_resume">Återuppta</string>
<string name="stores_refresh">Uppdatera</string>
<string name="stores_sort">Sortera</string>
<string name="stores_sort_last_played">Senast spelade</string>
<string name="stores_sort_recently_installed">Senast installerade</string>
<string name="stores_sort_title_asc">Titel A–Ö</string>
<string name="stores_sort_title_desc">Titel Ö–A</string>
<string name="stores_sort_size_desc">Storlek: störst</string>
<string name="stores_sort_size_asc">Storlek: minst</string>
<string name="stores_sort_release_date">Utgivningsdatum</string>
<string name="stores_view_list">Listvy</string>
<string name="stores_view_cards">Kortvy</string>
<string name="stores_show_mature">Visa innehåll för vuxna</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -887,8 +887,8 @@
<string name="wadb_turn_off">ปิดขีดจำกัด</string>
<string name="wadb_other_ways">วิธีอื่นในการเปลี่ยนค่านี้</string>
<string name="wadb_dev_try_first">1 · ตัวเลือกสำหรับนักพัฒนา (ลองก่อน)</string>
<string name="wadb_restrict_on">เปิด “Restrict child processes”</string>
<string name="wadb_restrict_off">ปิด “Restrict child processes”</string>
<string name="wadb_restrict_on">ปิด “ปิดการจำกัดการประมวลผลข้อมูลย่อย”</string>
<string name="wadb_restrict_off">เปิด “ปิดการจำกัดการประมวลผลข้อมูลย่อย”</string>
<string name="wadb_computer_last">3 · ADB จากคอมพิวเตอร์ (ทางเลือกสุดท้าย)</string>
<string name="wadb_only_if">ใช้เฉพาะเมื่อ Wireless debugging ใช้งานไม่ได้</string>
<string name="wadb_computer_group">3 · ADB จากคอมพิวเตอร์ (ทางเลือกสุดท้าย)</string>
@@ -1898,6 +1898,16 @@
<string name="stores_free">ฟรี</string>
<string name="stores_resume">ดำเนินการต่อ</string>
<string name="stores_refresh">รีเฟรช</string>
<string name="stores_sort">จัดเรียง</string>
<string name="stores_sort_last_played">เล่นล่าสุด</string>
<string name="stores_sort_recently_installed">เพิ่งติดตั้ง</string>
<string name="stores_sort_title_asc">ชื่อ A–Z</string>
<string name="stores_sort_title_desc">ชื่อ Z–A</string>
<string name="stores_sort_size_desc">ขนาด: ใหญ่สุด</string>
<string name="stores_sort_size_asc">ขนาด: เล็กสุด</string>
<string name="stores_sort_release_date">วันวางจำหน่าย</string>
<string name="stores_view_list">มุมมองรายการ</string>
<string name="stores_view_cards">มุมมองการ์ด</string>
<string name="stores_show_mature">แสดงเนื้อหาสำหรับผู้ใหญ่</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+26 -2
View File
@@ -893,8 +893,8 @@
<string name="wadb_turn_off">Sınırı kapat</string>
<string name="wadb_other_ways">Değiştirmenin diğer yolları</string>
<string name="wadb_dev_try_first">1 · Geliştirici seçenekleri (önce bunu deneyin)</string>
<string name="wadb_restrict_on">“Alt süreçleri kısıtla” seçeneğini açık olarak ayarlayın.</string>
<string name="wadb_restrict_off">“Alt süreçleri kısıtla” seçeneğini kapalı olarak ayarlayın.</string>
<string name="wadb_restrict_on">“Alt işlem kısıtlamalarını devre dışı bırak” seçeneğini kapalı olarak ayarlayın.</string>
<string name="wadb_restrict_off">“Alt işlem kısıtlamalarını devre dışı bırak” seçeneğini açık olarak ayarlayın.</string>
<string name="wadb_computer_last">3 · Bilgisayardan ADB (son yöntem)</string>
<string name="wadb_only_if">Yalnızca Kablosuz hata ayıklama kullanılamıyorsa.</string>
<string name="wadb_computer_group">3 · Bilgisayardan ADB (son yöntem)</string>
@@ -1919,6 +1919,16 @@
<string name="stores_free">Ücretsiz</string>
<string name="stores_resume">Sürdür</string>
<string name="stores_refresh">Yenile</string>
<string name="stores_sort">Sırala</string>
<string name="stores_sort_last_played">Son oynanan</string>
<string name="stores_sort_recently_installed">Son yüklenen</string>
<string name="stores_sort_title_asc">Başlık A–Z</string>
<string name="stores_sort_title_desc">Başlık Z–A</string>
<string name="stores_sort_size_desc">Boyut: en büyük</string>
<string name="stores_sort_size_asc">Boyut: en küçük</string>
<string name="stores_sort_release_date">Çıkış tarihi</string>
<string name="stores_view_list">Liste görünümü</string>
<string name="stores_view_cards">Kart görünümü</string>
<string name="stores_show_mature">Yetişkin içeriği göster</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -2232,4 +2242,18 @@
<string name="stores_hltb_completionist">Tamamlayıcı</string>
<string name="stores_hltb_hours">%1$s sa</string>
<string name="stores_hltb_minutes">%1$d dk</string>
<string name="mode_zram">zRAM sıkıştırma</string>
<string name="mode_zram_hint">Bir oyun çalışırken Steam istemcisinin belleği cihazın zram\'ına sıkıştırılır ve oyuna daha fazla RAM kalır. Steam\'in bir sonraki başlatılışında uygulanır.</string>
<string name="mode_zram_unsupported">Kullanılamıyor: bu cihazda zram veya swap yok ya da çekirdeği 5.4\'ten eski.</string>
<string name="setup_reset_settings">Tüm ayarları sıfırla</string>
<string name="setup_reset_settings_title">Tüm ayarlar sıfırlansın mı?</string>
<string name="setup_reset_settings_body">Ekran, performans, denetleyici, tema, dil ve başlatıcı ayarları varsayılanlarına döner. Oyunlarınız, Steam oturum bilgileriniz, mağaza hesaplarınız, indirilen sürücüler ve depolama klasörleriniz korunur.</string>
<string name="setup_reset_settings_button">Sıfırla</string>
<string name="setup_reset_settings_hint">Her ayarı varsayılanına döndürür</string>
<string name="setup_reset_settings_partial">Ayarlar sıfırlandı, ancak bazı bölümler sıfırlanamadı. Ayrıntılar günlüklerde.</string>
<string name="setup_reset_settings_profiles">Oyun profillerini de sıfırla (her oyunun Proton, FEX, bileşenleri ve ortamı ile Varsayılan profilin ortamı)</string>
<string name="setup_reset_settings_session_running">Ayarları sıfırlamadan önce oturumu durdurun.</string>
<string name="stores_storage_insufficient">Yeterli boş alan yok: %1$s gerekli, yalnızca %2$s boş</string>
<string name="stores_storage_low">Yetersiz alan (%1$s boş, %2$s gerekli)</string>
<string name="stores_target_free_unknown">Boş alan bilinmiyor</string>
</resources>
+12 -2
View File
@@ -905,8 +905,8 @@
<string name="wadb_turn_off">Вимкнути обмеження</string>
<string name="wadb_other_ways">Інші способи змінити це</string>
<string name="wadb_dev_try_first">1 · Параметри розробника (спробуйте спершу)</string>
<string name="wadb_restrict_on">Увімкніть «Обмежити дочірні процеси».</string>
<string name="wadb_restrict_off">Вимкніть «Обмежити дочірні процеси».</string>
<string name="wadb_restrict_on">Вимкніть «Вимкнути обмеження для дочірніх процесів».</string>
<string name="wadb_restrict_off">Увімкніть «Вимкнути обмеження для дочірніх процесів».</string>
<string name="wadb_computer_last">3 · ADB з комп’ютера (останній варіант)</string>
<string name="wadb_only_if">Лише якщо бездротове налагодження недоступне.</string>
<string name="wadb_computer_group">3 · ADB з комп’ютера (останній варіант)</string>
@@ -1961,6 +1961,16 @@
<string name="stores_free">Безкоштовно</string>
<string name="stores_resume">Продовжити</string>
<string name="stores_refresh">Оновити</string>
<string name="stores_sort">Сортувати</string>
<string name="stores_sort_last_played">Нещодавно запущені</string>
<string name="stores_sort_recently_installed">Нещодавно встановлені</string>
<string name="stores_sort_title_asc">Назва А–Я</string>
<string name="stores_sort_title_desc">Назва Я–А</string>
<string name="stores_sort_size_desc">Розмір: найбільший</string>
<string name="stores_sort_size_asc">Розмір: найменший</string>
<string name="stores_sort_release_date">Дата виходу</string>
<string name="stores_view_list">Вигляд списком</string>
<string name="stores_view_cards">Вигляд картками</string>
<string name="stores_show_mature">Показувати контент для дорослих</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+12 -2
View File
@@ -887,8 +887,8 @@
<string name="wadb_turn_off">Tắt giới hạn</string>
<string name="wadb_other_ways">Cách khác để đổi nó</string>
<string name="wadb_dev_try_first">1 · Tùy chọn cho nhà phát triển (thử trước)</string>
<string name="wadb_restrict_on">Đặt “Restrict child processes” thành bật.</string>
<string name="wadb_restrict_off">Đặt “Restrict child processes” thành tắt.</string>
<string name="wadb_restrict_on">Đặt “Tắt các mục hạn chế đối với tiến trình con” thành tắt.</string>
<string name="wadb_restrict_off">Đặt “Tắt các mục hạn chế đối với tiến trình con” thành bật.</string>
<string name="wadb_computer_last">3 · ADB từ máy tính (phương án cuối)</string>
<string name="wadb_only_if">Chỉ khi Gỡ lỗi qua mạng không dây không khả dụng.</string>
<string name="wadb_computer_group">3 · ADB từ máy tính (phương án cuối)</string>
@@ -1898,6 +1898,16 @@
<string name="stores_free">Miễn phí</string>
<string name="stores_resume">Tiếp tục</string>
<string name="stores_refresh">Làm mới</string>
<string name="stores_sort">Sắp xếp</string>
<string name="stores_sort_last_played">Chơi gần đây</string>
<string name="stores_sort_recently_installed">Cài gần đây</string>
<string name="stores_sort_title_asc">Tên A–Z</string>
<string name="stores_sort_title_desc">Tên Z–A</string>
<string name="stores_sort_size_desc">Kích thước: lớn nhất</string>
<string name="stores_sort_size_asc">Kích thước: nhỏ nhất</string>
<string name="stores_sort_release_date">Ngày phát hành</string>
<string name="stores_view_list">Chế độ danh sách</string>
<string name="stores_view_cards">Chế độ thẻ</string>
<string name="stores_show_mature">Hiện nội dung người lớn</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
+25 -11
View File
@@ -219,7 +219,7 @@
<string name="common_update">更新</string>
<string name="common_checking">检查中…</string>
<string name="common_working">处理中…</string>
<string name="common_forget">移除</string>
<string name="common_forget">清除</string>
<string name="common_add_ellipsis">添加…</string>
<string name="common_use">使用</string>
<string name="common_applies_next_session">将在下次会话生效。</string>
@@ -306,8 +306,8 @@
<string name="mode_sgdb_key">SteamGridDB API 密钥</string>
<string name="mode_sgdb_key_yours">你的密钥</string>
<string name="mode_sgdb_edit">编辑…</string>
<string name="mode_added_art_hint">按文件夹名补齐缺失的美术图。游戏文件夹中你自己的 cover.jpg、hero.jpg、logo.png 或 icon.png 优先。</string>
<string name="summary_remove_game">Remove %1$s</string>
<string name="mode_added_art_hint">自动从 Steam、其次从 SteamGridDB 补齐缺失的美术图。游戏文件夹中你自己的 cover.jpg、hero.jpg、logo.png 或 icon.png 优先。</string>
<string name="summary_remove_game">移除 %1$s</string>
<string name="mode_added_remove_confirm">移除?</string>
<string name="games_add">添加游戏</string>
<string name="games_add_title">添加游戏:</string>
@@ -344,10 +344,10 @@
<string name="wincomp_active">已为此游戏安装(%1$d)</string>
<string name="wincomp_all">全部组件(%1$d)</string>
<string name="wincomp_installers">需要 Windows 安装程序(%1$d)</string>
<string name="wincomp_installers_note">这些组件需要在前缀中运行真正的安装程序(.NET、PhysX、XNA、完整的 Visual C++ 安装程序等)。DroidDeck 暂时无法做到,接下来会支持。</string>
<string name="wincomp_installers_note">这些是各自的安装程序,内部没有可拆出的软件包,目前也还没有记录它们会安装什么。其中多数是 Proton 内置 Mono 已能替代的旧运行时;安装记录会陆续补充。</string>
<string name="wincomp_show">显示</string>
<string name="wincomp_hide">隐藏</string>
<string name="wincomp_needs_installer">需要 Windows 安装程序(即将支持)</string>
<string name="wincomp_needs_installer">会执行自己的安装程序(暂无安装记录)</string>
<string name="wincomp_unsupported">此处暂不支持</string>
<string name="wincomp_loading">正在加载组件…</string>
<string name="wincomp_failed">无法安装:%1$s</string>
@@ -460,7 +460,7 @@
<string name="comp_esync_wanted">%1$s · 尚无 droiddeck-esync 包</string>
<string name="comp_esync_builtin">%1$s · 内置 esync,无需包</string>
<string name="comp_gpu_drivers">GPU 驱动</string>
<string name="comp_reapplied">%1$s · 于启动 %2$s 时重新应用</string>
<string name="comp_reapplied">%1$s · 于 %2$s 启动时重新应用</string>
<string name="comp_next_queued">下一个:%1$s · 在游戏关闭后</string>
<string name="comp_in_use">正在使用 %1$s:%2$s</string>
<string name="comp_waits">等待游戏关闭</string>
@@ -626,7 +626,7 @@
</plurals>
<string name="drawer_no_proton">尚未安装 Proton。</string>
<string name="drawer_game_running">游戏运行中</string>
<string name="drawer_reapplied">于启动 %1$s 时重新应用</string>
<string name="drawer_reapplied">于 %1$s 启动时重新应用</string>
<string name="drawer_original">原件</string>
<string name="drawer_components_note">在“组件”页面导入和删除。</string>
<string name="setup_check_done">完成</string>
@@ -895,8 +895,8 @@
<string name="wadb_turn_off">关闭限制</string>
<string name="wadb_other_ways">其他修改方式</string>
<string name="wadb_dev_try_first">1 · 开发者选项(优先尝试)</string>
<string name="wadb_restrict_on">把“限制子进程”设为开。</string>
<string name="wadb_restrict_off">把“限制子进程”设为关。</string>
<string name="wadb_restrict_on">把“停止限制子进程”设为关。</string>
<string name="wadb_restrict_off">把“停止限制子进程”设为开。</string>
<string name="wadb_computer_last">3 · 电脑 ADB(最后手段)</string>
<string name="wadb_only_if">仅在无线调试不可用时使用。</string>
<string name="wadb_computer_group">3 · 电脑 ADB(最后手段)</string>
@@ -1159,7 +1159,7 @@
<item quantity="other">已将 %1$d 个文件导出为 %2$s:%3$s</item>
</plurals>
<string name="main_saves_pick_folder">选择 %1$s 的保存位置(%2$s)</string>
<string name="main_action_failed">%1$s失败:%2$s</string>
<string name="main_action_failed">%1$s 失败:%2$s</string>
<string name="main_no_logs_yet">还没有会话日志:请先运行一次会话。</string>
<string name="main_no_logs_to_clear">没有可清除的会话日志。</string>
<plurals name="main_logs_cleared">
@@ -1196,7 +1196,7 @@
<string name="drivers_pick_any">选择驱动 zip 包或 Android + Linux 组合包</string>
<string name="main_pkg_problem">%1$s:%2$s</string>
<string name="main_removing_named">正在移除 %1$s…</string>
<string name="main_forgetting_named">正在移除 %1$s…</string>
<string name="main_forgetting_named">正在清除 %1$s…</string>
<string name="main_pick_game_storage">选择游戏存储文件夹</string>
<string name="main_pick_decky_zip">选择 Decky 插件 ZIP 包</string>
<string name="main_storage_not_usable">无法使用:%1$s</string>
@@ -1906,6 +1906,16 @@
<string name="stores_free">免费</string>
<string name="stores_resume">继续</string>
<string name="stores_refresh">刷新</string>
<string name="stores_sort">排序</string>
<string name="stores_sort_last_played">最近游玩</string>
<string name="stores_sort_recently_installed">最近安装</string>
<string name="stores_sort_title_asc">标题 A–Z</string>
<string name="stores_sort_title_desc">标题 Z–A</string>
<string name="stores_sort_size_desc">大小: 从大到小</string>
<string name="stores_sort_size_asc">大小: 从小到大</string>
<string name="stores_sort_release_date">发行日期</string>
<string name="stores_view_list">列表视图</string>
<string name="stores_view_cards">卡片视图</string>
<string name="stores_show_mature">显示成人内容</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -2215,4 +2225,8 @@
<string name="drawer_component_downloads">下载组件</string>
<string name="drawer_component_downloads_hint">下载内容与“组件”页面共享。在上方选择已下载的版本,即可在下次启动游戏时使用。</string>
<string name="drawer_component_choose_download">选择要下载的版本</string>
<string name="display_picture_position">画面位置</string>
<string name="display_position_top">置顶</string>
<string name="display_position_bottom">置底</string>
<string name="display_position_center">居中(默认)</string>
</resources>
+52 -38
View File
@@ -38,7 +38,7 @@
<string name="lsfg_import_invalid">此檔案不是 Lossless Scaling 的 Lossless.dll</string>
<string name="lsfg_import_failed">無法從此 Lossless.dll 準備 LSFG</string>
<string name="lsfg_problem_missing">LSFG 需要 Steam 上的 Lossless Scaling 或已匯入的 Lossless.dll</string>
<string name="lsfg_problem_failed">LSFG 無法從 Lossless.dll 準備着色器</string>
<string name="lsfg_problem_failed">LSFG 無法從 Lossless.dll 準備著色器</string>
<string name="hud_fg_unsupported">%1$s:不支援</string>
<string name="hud_fg_failed">%1$s:引擎故障</string>
<string name="hud_fg_needs_lossless">%1$s:需要 Lossless Scaling</string>
@@ -68,9 +68,9 @@
<string name="game_env_unused">標準 Proton 運行環境不會讀取此變數。</string>
<string name="game_env_loading">正在載入…</string>
<string name="game_env_feature">D3D12 功能級別覆寫。12_2 會回報 DirectX 12 Ultimate 功能;不支援的功能可能會出錯。不設定則自動偵測。</string>
<string name="game_env_shader">D3D12 着色器模型覆寫。6_9 需要夠新的 VKD3D 及相應的 GPU 功能。不設定則自動偵測。</string>
<string name="game_env_cache">保持啟用 Mesa 着色器快取,以減少重複編譯。設為 false 即啟用快取。</string>
<string name="game_env_cache_size">Mesa 着色器快取的大小上限,例如 1G。快取越大,佔用的儲存空間越多。</string>
<string name="game_env_shader">D3D12 著色器模型覆寫。6_9 需要夠新的 VKD3D 及相應的 GPU 功能。不設定則自動偵測。</string>
<string name="game_env_cache">保持啟用 Mesa 著色器快取,以減少重複編譯。設為 false 即啟用快取。</string>
<string name="game_env_cache_size">Mesa 著色器快取的大小上限,例如 1G。快取越大,佔用的儲存空間越多。</string>
<string name="game_env_vkd3d_config">D3D12 的 VKD3D 選項。nodxr 會停用光線追蹤;只在個別遊戲需要時使用。</string>
<string name="game_env_proton_log">設為 1 以產生 Proton 診斷記錄。記錄可能會降低效能並佔用儲存空間。</string>
<string name="game_env_wined3d">設為 1 以改用基於 OpenGL 的 WineD3D 代替 DXVK,用於 D3D9–11 兼容性測試。</string>
@@ -92,7 +92,7 @@
<string name="fex_preset_title">FEX 預設</string>
<string name="fex_next_launch">下次啟動遊戲時生效。</string>
<string name="game_settings_title">遊戲</string>
<string name="fex_default_label">FEX 預設</string>
<string name="fex_default_label">FEX 預設值</string>
<string name="fex_default_detail">使用 FEX 預設設定。</string>
<string name="fex_stability_label">穩定</string>
<string name="fex_stability_detail">最安全但最慢的設定。</string>
@@ -205,7 +205,7 @@
<string name="add_app_folder_copied">該資料夾包含 Linux 程式,而共用儲存空間無法執行這些程式,因此會複製到 DroidDeck(%1$s)。</string>
<string name="add_app_confirm">新增</string>
<string name="add_app_cancel">取消</string>
<string name="add_app_runtime_required">請先在「設定」中安裝 Linux 運行環境。</string>
<string name="add_app_runtime_required">請先在「初始設定」中安裝 Linux 運行環境。</string>
<string name="add_app_busy">請等待 %1$s 完成。</string>
<string name="steam_compat_label">兼容</string>
<string name="proton_compatible_note">在 Steam「兼容性」選單中標示為「%1$s」的版本已包含 DroidDeck 的前綴修正,可在此啟動遊戲。預設為 Proton Experimental ARM64(%1$s);安裝較新的 Proton 11.0 ARM64(%1$s)後則改用該版本。Valve 本身沒有此標示的 Proton 項目無法在此裝置上啟動遊戲。</string>
@@ -219,7 +219,7 @@
<string name="common_update">更新</string>
<string name="common_checking">正在檢查…</string>
<string name="common_working">處理中…</string>
<string name="common_forget">忘記</string>
<string name="common_forget">清除</string>
<string name="common_add_ellipsis">新增…</string>
<string name="common_use">使用</string>
<string name="common_applies_next_session">下次會話生效。</string>
@@ -246,7 +246,7 @@
<string name="mode_hdr_restart">重新啟動應用程式後生效。</string>
<string name="mode_drivers">驅動程式</string>
<string name="mode_gpu_drivers">GPU 驅動程式</string>
<string name="mode_gpu_drivers_hint">Steam 和桌面共用,請在「元件」頁面設定。</string>
<string name="mode_gpu_drivers_hint">Steam 和桌面共用,請在「組件」頁面設定。</string>
<string name="mode_touch_controls">觸控與控制</string>
<string name="mode_touch">觸控</string>
<string name="mode_touch_touchpad">觸控板</string>
@@ -306,13 +306,13 @@
<string name="mode_sgdb_key">SteamGridDB API 密鑰</string>
<string name="mode_sgdb_key_yours">你的密鑰</string>
<string name="mode_sgdb_edit">編輯…</string>
<string name="mode_added_art_hint">按資料夾名稱補上缺少的圖片。遊戲資料夾中你自己的 cover.jpg、hero.jpg、logo.png 或 icon.png 會優先使用。</string>
<string name="summary_remove_game">Remove %1$s</string>
<string name="mode_added_art_hint">自動從 Steam、其次從 SteamGridDB 補上缺少的圖片。遊戲資料夾中你自己的 cover.jpg、hero.jpg、logo.png 或 icon.png 優先使用。</string>
<string name="summary_remove_game">移除 %1$s</string>
<string name="mode_added_remove_confirm">移除?</string>
<string name="games_add">加入遊戲</string>
<string name="games_add_title">加入遊戲:</string>
<string name="games_pick_exe_title">選擇 exe:</string>
<string name="games_add_unreachable">工作階段無法存取此位置</string>
<string name="games_add_unreachable">會話無法存取此位置</string>
<string name="mode_added_exe_check">請檢查此 exe</string>
<string name="wincomp_title">Windows 組件</string>
<string name="wincomp_pad_hint">按 LB / RB 在各部分之間切換。</string>
@@ -344,10 +344,10 @@
<string name="wincomp_active">已為這款遊戲安裝(%1$d)</string>
<string name="wincomp_all">所有組件(%1$d)</string>
<string name="wincomp_installers">需要 Windows 安裝程式(%1$d)</string>
<string name="wincomp_installers_note">這些組件需要在前綴內執行真正的安裝程式(.NET、PhysX、XNA、完整的 Visual C++ 安裝程式等)。DroidDeck 暫時未能做到,下一步就會支援。</string>
<string name="wincomp_installers_note">這些是各自的安裝程式,內部沒有可拆出的軟件包,目前也還沒有記錄它們會安裝什麼。其中多數是 Proton 內建 Mono 已能取代的舊運行環境;安裝記錄會陸續補充。</string>
<string name="wincomp_show">顯示</string>
<string name="wincomp_hide">隱藏</string>
<string name="wincomp_needs_installer">需要 Windows 安裝程式(即將支援)</string>
<string name="wincomp_needs_installer">會執行自己的安裝程式(暫無安裝記錄)</string>
<string name="wincomp_unsupported">這裏暫不支援</string>
<string name="wincomp_loading">正在載入組件…</string>
<string name="wincomp_failed">無法安裝:%1$s</string>
@@ -404,9 +404,9 @@
<string name="comp_display_driver_hint">在兩種模式下負責將畫面繪製到螢幕。重新啟動應用程式後生效。</string>
<string name="comp_import_adrenotools">匯入 AdrenoTools zip…</string>
<string name="comp_never">從未</string>
<string name="comp_nightlies_checked">已於 %1$s 檢查 Nightlies</string>
<string name="comp_title">元件</string>
<string name="comp_about">關於元件</string>
<string name="comp_nightlies_checked">Nightlies 檢查時間:%1$s</string>
<string name="comp_title">組件</string>
<string name="comp_about">關於組件</string>
<string name="comp_check_drivers">檢查新驅動程式</string>
<string name="comp_check_nightlies">在 Nightlies 檢查新軟件包</string>
<string name="comp_proton">Proton</string>
@@ -549,7 +549,7 @@
<string name="drawer_page_display">顯示</string>
<string name="drawer_page_effects">效果</string>
<string name="drawer_page_controls">控制</string>
<string name="drawer_page_components">元件</string>
<string name="drawer_page_components">組件</string>
<string name="drawer_page_controller">控制器</string>
<string name="drawer_page_settings">設定</string>
<string name="drawer_page_desc">%1$s頁面</string>
@@ -565,7 +565,7 @@
<string name="drawer_scaling_sharpness">縮放銳利度</string>
<string name="drawer_effects">畫面效果</string>
<string name="drawer_effects_hint">即時生效。開啟任何效果都會略為佔用 GPU 時間。</string>
<string name="drawer_look">預設</string>
<string name="drawer_look">預設集</string>
<string name="drawer_look_custom">自訂</string>
<string name="drawer_effects_advanced">進階</string>
<string name="widgets_expanded">已展開</string>
@@ -722,7 +722,7 @@
<string name="setup_tool_performance_hint">CPU 核心分配</string>
<string name="setup_tool_roms">ROM 資料夾</string>
<string name="setup_tool_roms_hint">模擬器遊戲的存放位置</string>
<string name="setup_card_components">元件</string>
<string name="setup_card_components">組件</string>
<string name="setup_card_components_hint">FEX、DXVK、VKD3D</string>
<string name="setup_card_controls">控制</string>
<string name="setup_card_controls_hint">按鍵對應</string>
@@ -733,7 +733,7 @@
<string name="store_title">商店</string>
<string name="store_chip_flathub">Flathub · ARM64</string>
<string name="store_chip_ready">● Flatpak 已就緒</string>
<string name="store_needs_runtime">請先在「設定」中安裝 Linux 運行環境。</string>
<string name="store_needs_runtime">請先在「初始設定」中安裝 Linux 運行環境。</string>
<string name="store_setup_title">設定 Flatpak</string>
<string name="store_setup_text">新增 Flatpak 並連接到 Flathub(約 20 MB)。安裝第一個應用程式時亦會下載其運行環境。</string>
<string name="store_setting_up">正在設定…</string>
@@ -843,7 +843,7 @@
</plurals>
<string name="gate_title">需要更改一項 Android 設定</string>
<string name="gate_eyebrow">Steam</string>
<string name="gate_lede">Android 會停止啟動大量背景程序的應用程式,而 Steam 會啟動數十個。更改此設定前,遊戲會在沒有任何錯誤訊息的情況下關閉。</string>
<string name="gate_lede">Android 會停止啟動大量背景程序的應用程式,而 Steam 會啟動數十個。在變更此設定前,遊戲會在沒有任何錯誤訊息的情況下關閉。</string>
<string name="gate_fix_for_me">幫我修復</string>
<string name="gate_toggle_steps">開啟「停用子進程限制」,然後返回。請保持開發人員選項開啟,否則此開關會再次關閉。</string>
<string name="gate_open_dev">開啟開發人員選項</string>
@@ -851,13 +851,13 @@
<string name="gate_needs_wifi">無線偵錯需要 Wi-Fi。任何網絡都可以,無需連接互聯網。</string>
<string name="gate_needs_notifications">配對碼需在通知中輸入。請允許 DroidDeck 發出通知,或使用「其他方式」。</string>
<string name="gate_allow_notifications">允許通知</string>
<string name="gate_step1">開啟「設定」→「開發人員選項」→「無線偵錯」,並將其開啟</string>
<string name="gate_step1">開啟「系統設定」→「開發人員選項」→「無線偵錯」,並將其開啟</string>
<string name="gate_step2">輕按「使用配對碼配對裝置」</string>
<string name="gate_step3">在 DroidDeck 通知中輸入配對碼</string>
<string name="gate_waiting">正在等待配對彈出式視窗…</string>
<string name="gate_code_needed">已找到彈出式視窗,請在通知中輸入其中的配對碼。</string>
<string name="gate_status">狀態</string>
<string name="gate_polling">每 2 秒檢查一次。關閉後此頁面會自動關閉。</string>
<string name="gate_polling">每 2 秒檢查一次。關閉此開關後,本頁面會自動關閉。</string>
<string name="gate_other_ways">其他方式</string>
<string name="gate_other_toggle">無線偵錯、手動輸入位址、電腦 ADB</string>
<string name="gate_other_no_toggle">手動輸入位址、電腦 ADB、開發人員選項</string>
@@ -870,7 +870,7 @@
<string name="gate_choose_display">選擇要在哪個螢幕開啟 Android 設定。</string>
<string name="gate_main_screen">主螢幕</string>
<string name="wadb_finding_port">已配對,正在尋找無線偵錯連接埠…</string>
<string name="wadb_enter_port">已配對,請輸入「設定」中顯示的連接埠。</string>
<string name="wadb_enter_port">已配對,請輸入「系統設定」中顯示的連接埠。</string>
<string name="wadb_applying">已找到裝置,正在套用設定…</string>
<string name="wadb_apply_failed">無法自動套用。請檢查下方的位址,然後重試。%1$s</string>
<string name="wadb_title_wireless">無線偵錯</string>
@@ -895,8 +895,8 @@
<string name="wadb_turn_off">關閉限制</string>
<string name="wadb_other_ways">其他更改方式</string>
<string name="wadb_dev_try_first">1 · 開發人員選項(請先嘗試)</string>
<string name="wadb_restrict_on">開啟「限制子進程」。</string>
<string name="wadb_restrict_off">關閉「限制子進程」。</string>
<string name="wadb_restrict_on">關閉「停用對子處理過程的限制」。</string>
<string name="wadb_restrict_off">開啟「停用對子處理過程的限制」。</string>
<string name="wadb_computer_last">3 · 電腦 ADB(最後手段)</string>
<string name="wadb_only_if">只在無法使用無線偵錯時使用。</string>
<string name="wadb_computer_group">3 · 電腦 ADB(最後手段)</string>
@@ -952,7 +952,7 @@
<string name="content_runtime_required">需要運行環境</string>
<string name="content_loading_details">正在載入安裝詳情…</string>
<string name="content_details_unavailable">無法取得安裝詳情,請稍後再試。</string>
<string name="content_needs_runtime">請先在「設定」中安裝 Linux 運行環境。</string>
<string name="content_needs_runtime">請先在「初始設定」中安裝 Linux 運行環境。</string>
<string name="content_stop_first">請先停止正在執行的會話,再安裝桌面應用程式。</string>
<string name="content_install_into">將 %1$s 安裝到 Linux 桌面。</string>
<string name="store_busy_percent_short">%1$s · %2$d%%</string>
@@ -1065,7 +1065,7 @@
<string name="rail_games">遊戲</string>
<string name="rail_desktop">桌面</string>
<string name="rail_store">商店</string>
<string name="rail_components">元件</string>
<string name="rail_components">組件</string>
<string name="rail_apps">應用程式</string>
<string name="rail_setup">設定</string>
<string name="rail_updates">更新</string>
@@ -1187,7 +1187,7 @@
<string name="comp_cannot_read">無法讀取檔案</string>
<string name="comp_imported">已匯入 %1$s</string>
<string name="comp_swap_cancelled">已取消等待中的替換。</string>
<string name="comp_pick_wcp">選擇元件套件(-linux .wcp)</string>
<string name="comp_pick_wcp">選擇組件套件(-linux .wcp)</string>
<string name="comp_nightlies_unreachable">無法連接 Nightlies</string>
<string name="comp_stored">已儲存 %1$s</string>
<string name="comp_download_failed">下載失敗:%1$s</string>
@@ -1196,14 +1196,14 @@
<string name="drivers_pick_any">選擇驅動程式 zip 或 Android + Linux 組合包</string>
<string name="main_pkg_problem">%1$s:%2$s</string>
<string name="main_removing_named">正在移除 %1$s…</string>
<string name="main_forgetting_named">正在忘記 %1$s…</string>
<string name="main_forgetting_named">正在清除 %1$s…</string>
<string name="main_pick_game_storage">選擇遊戲儲存資料夾</string>
<string name="main_pick_decky_zip">選擇 Decky 插件 ZIP</string>
<string name="main_storage_not_usable">無法使用:%1$s</string>
<string name="main_running_program">程式</string>
<string name="main_removing_runtime">正在移除 Linux 運行環境</string>
<string name="main_settings_main_screen">無法在下方螢幕開啟「設定」,已改為在主螢幕開啟。</string>
<string name="main_open_dev_options">在「設定」中開啟開發人員選項</string>
<string name="main_open_dev_options">在「系統設定」中開啟開發人員選項</string>
<string name="upd_unknown_apps_failed">無法開啟 Android 的「安裝不明應用程式」設定</string>
<string name="upd_couldnt_check">無法檢查:%1$s</string>
@@ -1637,12 +1637,12 @@
<string name="adbpair_applying">正在套用設定…</string>
<string name="adbpair_command_failed">無線偵錯指令失敗</string>
<string name="adbpair_channel_name">無線偵錯設定</string>
<string name="adbpair_channel_description">在「設定」開啟時要求輸入無線偵錯配對碼</string>
<string name="adbpair_channel_description">在「系統設定」開啟時要求輸入無線偵錯配對碼</string>
<string name="adbpair_title_pair">配對無線偵錯</string>
<string name="adbpair_waiting_text">開啟無線偵錯,然後輕按「使用配對碼配對裝置」。</string>
<string name="adbpair_waiting_long">開啟無線偵錯,然後輕按「使用配對碼配對裝置」。請留在「設定」中:配對碼需在此通知中輸入。</string>
<string name="adbpair_code_label">6 位數配對碼</string>
<string name="adbpair_code_hint">輕按「輸入配對碼」,然後輸入「設定」中顯示的 6 位數字。</string>
<string name="adbpair_code_hint">輕按「輸入配對碼」,然後輸入「系統設定」中顯示的 6 位數字。</string>
<string name="adbpair_title_code">輸入 Wi-Fi 配對碼</string>
<string name="adbpair_title_retry">請再次輸入配對碼</string>
<string name="adbpair_enter_code">輸入配對碼</string>
@@ -1876,7 +1876,7 @@
<string name="stores_signin">登入</string>
<string name="stores_signout_named">%1$s · 登出</string>
<string name="stores_signout_title">登出 %1$s?</string>
<string name="stores_signout_note">已安裝的遊戲會保留。重新登入時會再次取得收藏庫。</string>
<string name="stores_signout_note">已安裝的遊戲會保留。重新登入後會再次取得你的收藏庫。</string>
<string name="stores_signout_stay">保持登入</string>
<string name="stores_signout_go">登出</string>
<string name="stores_search_catalog">搜尋 %1$s 目錄…</string>
@@ -1893,7 +1893,7 @@
<string name="stores_shelf_free">免費遊戲</string>
<string name="stores_shelf_trending">趨勢</string>
<string name="stores_shelf_library">你的收藏庫</string>
<string name="stores_play">開始遊戲</string>
<string name="stores_play">開啟遊戲</string>
<string name="stores_install">安裝</string>
<string name="stores_resume_install">繼續安裝</string>
<string name="stores_dl_interrupted">已中斷</string>
@@ -1902,10 +1902,20 @@
<string name="stores_view_on">在 %1$s 查看</string>
<string name="stores_buy_price">購買 · %1$s</string>
<string name="stores_installed_chip">已安裝</string>
<string name="stores_in_library">已在收藏庫</string>
<string name="stores_in_library">已在收藏庫中</string>
<string name="stores_free">免費</string>
<string name="stores_resume">繼續</string>
<string name="stores_refresh">重新整理</string>
<string name="stores_sort">排序</string>
<string name="stores_sort_last_played">最近遊玩</string>
<string name="stores_sort_recently_installed">最近安裝</string>
<string name="stores_sort_title_asc">標題 A–Z</string>
<string name="stores_sort_title_desc">標題 Z–A</string>
<string name="stores_sort_size_desc">大小: 由大到小</string>
<string name="stores_sort_size_asc">大小: 由小到大</string>
<string name="stores_sort_release_date">發行日期</string>
<string name="stores_view_list">列表檢視</string>
<string name="stores_view_cards">卡片檢視</string>
<string name="stores_show_mature">顯示成人內容</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -1963,7 +1973,7 @@
<string name="stores_card_engine_java">%1$s · 內置</string>
<string name="stores_how_it_runs">運行方式</string>
<string name="stores_kv_fetched">取自</string>
<string name="stores_kv_fetched_value">%1$s(使用你的帳戶)</string>
<string name="stores_kv_fetched_value">%1$s,使用你的帳戶</string>
<string name="stores_kv_installed_to">安裝位置</string>
<string name="stores_kv_installed_to_value">遊戲儲存位置(Games/%1$s/%2$s)</string>
<string name="stores_kv_launched_by">啟動方式</string>
@@ -2019,7 +2029,7 @@
<string name="stores_notification_delete">刪除</string>
<string name="stores_notification_keep">保留</string>
<string name="stores_login_title">登入 %1$s</string>
<string name="stores_login_provider_title">透過你的帳戶提供者登入</string>
<string name="stores_login_provider_title">使用你的服務商帳戶登入</string>
<string name="stores_login_reload">重新載入</string>
<string name="stores_login_close">關閉</string>
<string name="stores_login_retry">再試一次</string>
@@ -2215,4 +2225,8 @@
<string name="drawer_component_downloads">下載元件</string>
<string name="drawer_component_downloads_hint">下載內容與「元件」頁面共用。在上方選擇已下載的版本,即可在下次啟動遊戲時使用。</string>
<string name="drawer_component_choose_download">選擇要下載的版本</string>
<string name="display_picture_position">畫面位置</string>
<string name="display_position_top">置頂</string>
<string name="display_position_bottom">置底</string>
<string name="display_position_center">置中(預設)</string>
</resources>
+38 -24
View File
@@ -92,7 +92,7 @@
<string name="fex_preset_title">FEX 預設</string>
<string name="fex_next_launch">下次啟動遊戲時生效。</string>
<string name="game_settings_title">遊戲</string>
<string name="fex_default_label">FEX 預設</string>
<string name="fex_default_label">FEX 預設值</string>
<string name="fex_default_detail">使用 FEX 預設設定。</string>
<string name="fex_stability_label">穩定</string>
<string name="fex_stability_detail">最安全、最慢的設定。</string>
@@ -205,7 +205,7 @@
<string name="add_app_folder_copied">該資料夾包含 Linux 程式,共用儲存空間無法執行這些程式,因此會將其複製到 DroidDeck(%1$s)。</string>
<string name="add_app_confirm">新增</string>
<string name="add_app_cancel">取消</string>
<string name="add_app_runtime_required">請先從「設定」中安裝 Linux 執行環境。</string>
<string name="add_app_runtime_required">請先從「初始設定」中安裝 Linux 執行環境。</string>
<string name="add_app_busy">請等待 %1$s 完成。</string>
<string name="steam_compat_label">相容</string>
<string name="proton_compatible_note">在 Steam 的「相容性」選單中標示「%1$s」的組建版本包含 DroidDeck 的 前綴修正,可在此啟動遊戲。預設為 Proton Experimental ARM64(%1$s);安裝較新的 Proton 11.0 ARM64(%1$s)後則改用該版本。Valve 自己未帶此標示的 Proton 項目無法在這部裝置上啟動遊戲。</string>
@@ -219,7 +219,7 @@
<string name="common_update">更新</string>
<string name="common_checking">正在檢查…</string>
<string name="common_working">處理中…</string>
<string name="common_forget">忘記</string>
<string name="common_forget">清除</string>
<string name="common_add_ellipsis">新增…</string>
<string name="common_use">使用</string>
<string name="common_applies_next_session">下次工作階段生效。</string>
@@ -306,8 +306,8 @@
<string name="mode_sgdb_key">SteamGridDB API 金鑰</string>
<string name="mode_sgdb_key_yours">你的金鑰</string>
<string name="mode_sgdb_edit">編輯…</string>
<string name="mode_added_art_hint">按資料夾名稱補全缺少的圖片。遊戲資料夾中的 cover.jpg、hero.jpg、logo.png 或 icon.png 優先使用。</string>
<string name="summary_remove_game">Remove %1$s</string>
<string name="mode_added_art_hint">自動從 Steam、其次從 SteamGridDB 補齊缺少的圖片。遊戲資料夾中你自己的 cover.jpg、hero.jpg、logo.png 或 icon.png 優先使用。</string>
<string name="summary_remove_game">移除 %1$s</string>
<string name="mode_added_remove_confirm">移除?</string>
<string name="games_add">新增遊戲</string>
<string name="games_add_title">新增遊戲:</string>
@@ -344,10 +344,10 @@
<string name="wincomp_active">已為這款遊戲安裝(%1$d)</string>
<string name="wincomp_all">所有元件(%1$d)</string>
<string name="wincomp_installers">需要 Windows 安裝程式(%1$d)</string>
<string name="wincomp_installers_note">這些元件需要在前綴中執行真正的安裝程式(.NET、PhysX、XNA、完整的 Visual C++ 安裝程式等)。DroidDeck 目前還做不到,接下來就會支援。</string>
<string name="wincomp_installers_note">這些是各自的安裝程式,內部沒有可拆出的軟體包,目前也還沒有記錄它們會安裝什麼。其中多數是 Proton 內建 Mono 已能取代的舊執行環境;安裝記錄會陸續補充。</string>
<string name="wincomp_show">顯示</string>
<string name="wincomp_hide">隱藏</string>
<string name="wincomp_needs_installer">需要 Windows 安裝程式(即將支援)</string>
<string name="wincomp_needs_installer">會執行自己的安裝程式(暫無安裝記錄)</string>
<string name="wincomp_unsupported">這裡尚不支援</string>
<string name="wincomp_loading">正在載入元件…</string>
<string name="wincomp_failed">無法安裝:%1$s</string>
@@ -404,7 +404,7 @@
<string name="comp_display_driver_hint">在兩種模式下都負責將畫面輸出到螢幕。重新啟動應用程式後生效。</string>
<string name="comp_import_adrenotools">匯入 AdrenoTools zip…</string>
<string name="comp_never">從未</string>
<string name="comp_nightlies_checked">已於 %1$s 檢查 Nightlies</string>
<string name="comp_nightlies_checked">Nightlies 檢查時間:%1$s</string>
<string name="comp_title">元件</string>
<string name="comp_about">關於元件</string>
<string name="comp_check_drivers">檢查新驅動程式</string>
@@ -460,7 +460,7 @@
<string name="comp_esync_wanted">%1$s · 尚無 droiddeck-esync 套件</string>
<string name="comp_esync_builtin">%1$s · 內建 esync,不需要套件</string>
<string name="comp_gpu_drivers">GPU 驅動程式</string>
<string name="comp_reapplied">%1$s · 已在啟動 %2$s 時重新套用</string>
<string name="comp_reapplied">%1$s · 已於 %2$s 啟動時重新套用</string>
<string name="comp_next_queued">下一項:%1$s · 遊戲關閉後</string>
<string name="comp_in_use">正在使用 %1$s:%2$s</string>
<string name="comp_waits">等待遊戲關閉</string>
@@ -626,7 +626,7 @@
</plurals>
<string name="drawer_no_proton">尚未安裝 Proton。</string>
<string name="drawer_game_running">遊戲執行中</string>
<string name="drawer_reapplied">已在啟動 %1$s 時重新套用</string>
<string name="drawer_reapplied">已於 %1$s 啟動時重新套用</string>
<string name="drawer_original">原始</string>
<string name="drawer_components_note">請在「元件」頁面匯入和刪除。</string>
<string name="setup_check_done">完成</string>
@@ -733,7 +733,7 @@
<string name="store_title">商店</string>
<string name="store_chip_flathub">Flathub · ARM64</string>
<string name="store_chip_ready">● Flatpak 已就緒</string>
<string name="store_needs_runtime">請先從「設定」中安裝 Linux 執行環境。</string>
<string name="store_needs_runtime">請先從「初始設定」中安裝 Linux 執行環境。</string>
<string name="store_setup_title">設定 Flatpak</string>
<string name="store_setup_text">新增 Flatpak 並連線到 Flathub(約 20 MB)。第一個應用程式還會下載其執行環境。</string>
<string name="store_setting_up">正在設定…</string>
@@ -851,7 +851,7 @@
<string name="gate_needs_wifi">無線偵錯需要 Wi-Fi。任何網路都可以,不需要網際網路。</string>
<string name="gate_needs_notifications">配對碼會顯示在通知中。請允許 DroidDeck 傳送通知,或使用「其他方式」。</string>
<string name="gate_allow_notifications">允許通知</string>
<string name="gate_step1">開啟設定 → 開發人員選項 → 無線偵錯,並將其開啟</string>
<string name="gate_step1">開啟「Android 設定」→「開發人員選項」→「無線偵錯」,並將其開啟</string>
<string name="gate_step2">點擊「使用配對碼配對裝置」</string>
<string name="gate_step3">將配對碼輸入 DroidDeck 通知中</string>
<string name="gate_waiting">正在等待配對彈出視窗…</string>
@@ -895,8 +895,8 @@
<string name="wadb_turn_off">關閉限制</string>
<string name="wadb_other_ways">其他變更方式</string>
<string name="wadb_dev_try_first">1 · 開發人員選項(優先嘗試)</string>
<string name="wadb_restrict_on">開啟「限制子處理程序」。</string>
<string name="wadb_restrict_off">關閉「限制子處理程序」。</string>
<string name="wadb_restrict_on">關閉「停止限制子程序」。</string>
<string name="wadb_restrict_off">開啟「停止限制子程序」。</string>
<string name="wadb_computer_last">3 · 電腦 ADB(最後手段)</string>
<string name="wadb_only_if">僅在無線偵錯無法使用時使用。</string>
<string name="wadb_computer_group">3 · 電腦 ADB(最後手段)</string>
@@ -952,7 +952,7 @@
<string name="content_runtime_required">需要執行環境</string>
<string name="content_loading_details">正在載入安裝詳細資料…</string>
<string name="content_details_unavailable">安裝詳細資料無法使用。請稍後重試。</string>
<string name="content_needs_runtime">請先從「設定」中安裝 Linux 執行環境。</string>
<string name="content_needs_runtime">請先從「初始設定」中安裝 Linux 執行環境。</string>
<string name="content_stop_first">請停止正在執行的工作階段後再安裝桌面應用程式。</string>
<string name="content_install_into">將 %1$s 安裝到 Linux 桌面。</string>
<string name="store_busy_percent_short">%1$s · %2$d%%</string>
@@ -1159,7 +1159,7 @@
<item quantity="other">已將 %1$d 個檔案匯出為 %2$s:%3$s</item>
</plurals>
<string name="main_saves_pick_folder">選擇 %1$s 的儲存位置(%2$s)</string>
<string name="main_action_failed">失敗(%1$s):%2$s</string>
<string name="main_action_failed">%1$s 失敗:%2$s</string>
<string name="main_no_logs_yet">還沒有工作階段日誌:請先執行一次工作階段。</string>
<string name="main_no_logs_to_clear">沒有可清除的工作階段日誌。</string>
<plurals name="main_logs_cleared">
@@ -1196,14 +1196,14 @@
<string name="drivers_pick_any">選擇驅動程式 zip 或 Android + Linux 套件組合</string>
<string name="main_pkg_problem">%1$s:%2$s</string>
<string name="main_removing_named">正在移除 %1$s…</string>
<string name="main_forgetting_named">正在忘記 %1$s…</string>
<string name="main_forgetting_named">正在清除 %1$s…</string>
<string name="main_pick_game_storage">選擇遊戲儲存資料夾</string>
<string name="main_pick_decky_zip">選擇 Decky 外掛程式 ZIP</string>
<string name="main_storage_not_usable">無法使用:%1$s</string>
<string name="main_running_program">程式</string>
<string name="main_removing_runtime">正在移除 Linux 執行環境</string>
<string name="main_settings_main_screen">無法在底部螢幕開啟「設定」,已改在主螢幕上開啟。</string>
<string name="main_open_dev_options">在「設定」中開啟開發人員選項</string>
<string name="main_open_dev_options">在「Android 設定」中開啟開發人員選項</string>
<string name="upd_unknown_apps_failed">無法開啟 Android 的「安裝不明應用程式」設定</string>
<string name="upd_couldnt_check">無法檢查:%1$s</string>
@@ -1637,12 +1637,12 @@
<string name="adbpair_applying">正在套用設定…</string>
<string name="adbpair_command_failed">無線偵錯指令失敗</string>
<string name="adbpair_channel_name">無線偵錯設定</string>
<string name="adbpair_channel_description">在「設定」開啟時要求輸入無線偵錯配對碼</string>
<string name="adbpair_channel_description">在「Android 設定」開啟時要求輸入無線偵錯配對碼</string>
<string name="adbpair_title_pair">配對無線偵錯</string>
<string name="adbpair_waiting_text">開啟無線偵錯,然後點擊「使用配對碼配對裝置」。</string>
<string name="adbpair_waiting_long">開啟無線偵錯,然後點擊「使用配對碼配對裝置」。請留在「設定」中:配對碼要輸入在這則通知裡。</string>
<string name="adbpair_code_label">6 位數配對碼</string>
<string name="adbpair_code_hint">點擊「輸入配對碼」,然後輸入「設定」中顯示的 6 位數字。</string>
<string name="adbpair_code_hint">點擊「輸入配對碼」,然後輸入「Android 設定」中顯示的 6 位數字。</string>
<string name="adbpair_title_code">輸入 Wi-Fi 配對碼</string>
<string name="adbpair_title_retry">請再次輸入配對碼</string>
<string name="adbpair_enter_code">輸入配對碼</string>
@@ -1876,7 +1876,7 @@
<string name="stores_signin">登入</string>
<string name="stores_signout_named">%1$s · 登出</string>
<string name="stores_signout_title">要登出 %1$s 嗎?</string>
<string name="stores_signout_note">已安裝的遊戲會保留。重新登入時會再次取得收藏庫。</string>
<string name="stores_signout_note">已安裝的遊戲會保留。重新登入後會再次取得你的收藏庫。</string>
<string name="stores_signout_stay">保持登入</string>
<string name="stores_signout_go">登出</string>
<string name="stores_search_catalog">搜尋 %1$s 目錄…</string>
@@ -1891,9 +1891,9 @@
<string name="stores_shelf_new">最新上架</string>
<string name="stores_shelf_deals">特惠</string>
<string name="stores_shelf_free">免費遊戲</string>
<string name="stores_shelf_trending">熱門趨勢</string>
<string name="stores_shelf_trending">趨勢</string>
<string name="stores_shelf_library">你的收藏庫</string>
<string name="stores_play">開始遊戲</string>
<string name="stores_play">執行</string>
<string name="stores_install">安裝</string>
<string name="stores_resume_install">繼續安裝</string>
<string name="stores_dl_interrupted">已中斷</string>
@@ -1906,6 +1906,16 @@
<string name="stores_free">免費</string>
<string name="stores_resume">繼續</string>
<string name="stores_refresh">重新整理</string>
<string name="stores_sort">排序</string>
<string name="stores_sort_last_played">最近遊玩</string>
<string name="stores_sort_recently_installed">最近安裝</string>
<string name="stores_sort_title_asc">標題 A–Z</string>
<string name="stores_sort_title_desc">標題 Z–A</string>
<string name="stores_sort_size_desc">大小: 由大到小</string>
<string name="stores_sort_size_asc">大小: 由小到大</string>
<string name="stores_sort_release_date">發行日期</string>
<string name="stores_view_list">列表檢視</string>
<string name="stores_view_cards">卡片檢視</string>
<string name="stores_show_mature">顯示成人內容</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -2019,7 +2029,7 @@
<string name="stores_notification_delete">刪除</string>
<string name="stores_notification_keep">保留</string>
<string name="stores_login_title">登入 %1$s</string>
<string name="stores_login_provider_title">透過你的帳號提供者登入</string>
<string name="stores_login_provider_title">使用你的服務商帳號登入</string>
<string name="stores_login_reload">重新載入</string>
<string name="stores_login_close">關閉</string>
<string name="stores_login_retry">再試一次</string>
@@ -2215,4 +2225,8 @@
<string name="drawer_component_downloads">下載元件</string>
<string name="drawer_component_downloads_hint">下載內容與「元件」頁面共用。在上方選擇已下載的版本,即可在下次啟動遊戲時使用。</string>
<string name="drawer_component_choose_download">選擇要下載的版本</string>
<string name="display_picture_position">畫面位置</string>
<string name="display_position_top">置頂</string>
<string name="display_position_bottom">置底</string>
<string name="display_position_center">置中(預設)</string>
</resources>
+39 -2
View File
@@ -595,6 +595,10 @@
<string name="cardboard_no_sensor">This device has no rotation sensor.</string>
<string name="cardboard_recenter">Recenter view</string>
<string name="cardboard_recenter_button">Recenter</string>
<string name="steamvr_title">SteamVR</string>
<string name="steamvr_enter">Enter SteamVR</string>
<string name="steamvr_quest_ready_hint">Enter immersive VR with headset tracking and Touch controllers.</string>
<string name="steamvr_checking">Checking SteamVR…</string>
<string name="cardboard_steamvr">SteamVR (experimental)</string>
<string name="cardboard_steamvr_install">Install</string>
<string name="cardboard_steamvr_install_hint">Downloads Valve\'s ARM64 SteamVR (571 MB).</string>
@@ -622,6 +626,11 @@
<string name="drawer_texture_sharpness_note">A negative mip bias: sharper textures, some shimmer. Auto matches how far the session is enlarged to the screen.</string>
<string name="drawer_touch_auto">Auto (%1$s)</string>
<string name="drawer_keyboard">Keyboard</string>
<string name="drawer_latency">Latency</string>
<string name="drawer_low_latency_controller">Low-latency controller</string>
<string name="drawer_low_latency_controller_hint">Pad reports at 1000 Hz instead of 250 Hz. Slightly more CPU.</string>
<string name="drawer_low_latency_touch">Low-latency touch</string>
<string name="drawer_low_latency_touch_hint">Touches skip frame batching; Steam touch controls at 1000 Hz. Slightly more CPU.</string>
<string name="drawer_pc_keyboard">PC keyboard</string>
<string name="drawer_android_keyboard">Android</string>
<string name="drawer_second_screen">Second screen</string>
@@ -934,8 +943,8 @@
<string name="wadb_turn_off">Turn limit off</string>
<string name="wadb_other_ways">Other ways to change it</string>
<string name="wadb_dev_try_first">1 · Developer options (try first)</string>
<string name="wadb_restrict_on">Set “Restrict child processes” on.</string>
<string name="wadb_restrict_off">Set “Restrict child processes” off.</string>
<string name="wadb_restrict_on">Turn off “Disable child process restrictions”.</string>
<string name="wadb_restrict_off">Turn on “Disable child process restrictions”.</string>
<string name="wadb_computer_last">3 · Computer ADB (last resort)</string>
<string name="wadb_only_if">Only if Wireless debugging is unavailable.</string>
<string name="wadb_computer_group">3 · Computer ADB (last resort)</string>
@@ -1284,6 +1293,8 @@
<string name="drivers_switched_to_restart">Switched to %1$s %2$s. The display driver applies after DroidDeck restarts.</string>
<string name="drivers_using">Using %1$s %2$s.</string>
<string name="drivers_using_restart">Using %1$s %2$s. The display driver applies after DroidDeck restarts.</string>
<string name="drivers_using_quest">Using the bundled Quest display driver and runtime default.</string>
<string name="drivers_using_quest_restart">Using the bundled Quest display driver and runtime default. The display driver applies after DroidDeck restarts.</string>
<string name="drivers_not_a_driver">Not a driver zip: neither an AdrenoTools driver, a -Linux Turnip nor an Android + Linux bundle</string>
<string name="drivers_import_failed">Import failed: %1$s</string>
<string name="drivers_imported_unnamed">Imported driver</string>
@@ -1972,6 +1983,16 @@
<string name="stores_free">Free</string>
<string name="stores_resume">Resume</string>
<string name="stores_refresh">Refresh</string>
<string name="stores_sort">Sort</string>
<string name="stores_sort_last_played">Recently played</string>
<string name="stores_sort_recently_installed">Recently installed</string>
<string name="stores_sort_title_asc">Title A–Z</string>
<string name="stores_sort_title_desc">Title Z–A</string>
<string name="stores_sort_size_desc">Size: largest</string>
<string name="stores_sort_size_asc">Size: smallest</string>
<string name="stores_sort_release_date">Release date</string>
<string name="stores_view_list">List view</string>
<string name="stores_view_cards">Card view</string>
<string name="stores_show_mature">Show mature content</string>
<string name="epic_card_title">Epic</string>
<string name="epic_card_eos">EOS</string>
@@ -2134,6 +2155,18 @@
<string name="art_pick_image">Pick image…</string>
<string name="art_pick_title">Pick an image: %1$s</string>
<string name="art_reset">Reset to automatic</string>
<string name="art_search_sgdb">Search SteamGridDB…</string>
<string name="art_sgdb_title">SteamGridDB: %1$s</string>
<string name="art_sgdb_search_label">Search for a game</string>
<string name="art_sgdb_more">Show more</string>
<string name="art_sgdb_other_games">Other matches</string>
<string name="art_sgdb_none">Nothing found.</string>
<string name="art_sgdb_no_key">SteamGridDB needs an API key. Add yours in Setup › Launcher.</string>
<string name="art_sgdb_bad_key">SteamGridDB did not accept the API key. Check it in Setup › Launcher.</string>
<string name="art_sgdb_limit">SteamGridDB is limiting requests right now. Try again in a minute.</string>
<string name="art_sgdb_offline">SteamGridDB could not be reached. Check the connection.</string>
<string name="art_sgdb_server">SteamGridDB had a problem. Try again later.</string>
<string name="art_sgdb_no_game">SteamGridDB has no match for this game. Try a search.</string>
<plurals name="games_added_n">
<item quantity="one">%1$d game added</item>
<item quantity="other">%1$d games added</item>
@@ -2260,4 +2293,8 @@
<string name="stores_sync_gog_unreachable">Couldn\'t reach GOG</string>
<string name="stores_sync_gog_unreadable">Could not read your GOG library</string>
<string name="stores_registering">Registering with Steam…</string>
<string name="display_picture_position">Picture position</string>
<string name="display_position_top">Top</string>
<string name="display_position_bottom">Bottom</string>
<string name="display_position_center">Center (default)</string>
</resources>
+1 -1
View File
@@ -155,7 +155,7 @@ synchronous on the calling thread (network calls block: call them off the main t
| `build.info` | `accessToken`, `namespace`, `catalogItemId`, `appName` | `info`: the opaque build description (`manifest`, `buildVersion`, `deploymentId`, `cdns[]` of `base`/`dir`/`auth`) |
| `build.cdns` | `info` | `cdns[]` |
| `build.prereq` | `info` | `name`, `path`, `read` (downloads and parses the manifest) |
| `shop.shelves` | `country` | `new`, `deals`, `free`, `trending`: arrays in the `store_featured` item shape plus `allTags` |
| `shop.shelves` | `country` | `new`, `deals`, `free`, `trending`: arrays in the `store_featured` item shape plus `allTags`; `art`: cover URLs from every promotion, for the signed-out wall |
| `achievements` | `accessToken`, `namespace`, `accountId`, `locale` | `list[]` of `id`, `name`, `description`, `hidden`, `unlocked`, `unlockedAt` (s), `icon`, `iconLocked` |
| `cloud.list` | `accessToken`, `accountId`, `appName` | `files[]` of `name`, `modified` (ms, -1 unknown), `hash`, `readLink` |
| `cloud.writeLinks` | `accessToken`, `accountId`, `appName`, `names[]` | `links`: name → write link |
+39 -2
View File
@@ -232,6 +232,28 @@ fn unique(items: impl IntoIterator<Item = Value>) -> Vec<Value> {
items.into_iter().filter(|i| seen.insert(net::str_of(i, "id").to_string())).collect()
}
const MATURE_TAGS: [&str; 8] = ["mature", "nsfw", "adult", "adult only", "adults only", "nudity", "sexual content", "sexual-content"];
fn mature_tags(item: &Value) -> bool {
item["allTags"].as_array().is_some_and(|tags| {
tags.iter().filter_map(|t| t.as_str()).any(|t| MATURE_TAGS.contains(&t.trim().to_lowercase().as_str()))
})
}
pub fn wall_art(promotion_list: &[Value]) -> Vec<String> {
let mut seen = HashSet::new();
promotion_list
.iter()
.filter_map(item_of)
.filter(|i| !mature_tags(i))
.map(|i| {
let tall = net::str_of(&i, "tall");
if tall.is_empty() { net::str_of(&i, "image").to_string() } else { tall.to_string() }
})
.filter(|u| !u.is_empty() && seen.insert(u.clone()))
.collect()
}
pub fn shelves(country: &str) -> Value {
let country = country_code(country);
let now = now_stamp();
@@ -240,10 +262,12 @@ pub fn shelves(country: &str) -> Value {
};
let new = unique(shelf(Shelf::New));
let deals = unique(shelf(Shelf::Deals).into_iter().filter(|i| i["disc"].as_i64().unwrap_or(0) > 0));
let promos: Vec<Value> = promotions(&country).iter().filter_map(free_now).collect();
let promotion_list = promotions(&country);
let art = wall_art(&promotion_list);
let promos: Vec<Value> = promotion_list.iter().filter_map(free_now).collect();
let free = unique(promos.into_iter().chain(shelf(Shelf::Free)));
let trending = unique(shelf(Shelf::Trending));
json!({ "new": new, "deals": deals, "free": free, "trending": trending })
json!({ "new": new, "deals": deals, "free": free, "trending": trending, "art": art })
}
#[cfg(test)]
@@ -304,6 +328,19 @@ mod tests {
assert!(free_now(&el).is_none());
}
#[test]
fn wall_art_takes_every_promotion_once_and_skips_mature() {
let mut clean = element();
clean["tags"] = json!([{"name": "Action"}]);
let mut wide_only = clean.clone();
wide_only["id"] = json!("offer2");
wide_only["keyImages"] = json!([{"type": "OfferImageWide", "url": "w2"}]);
let mut mature = element();
mature["id"] = json!("offer3");
mature["keyImages"] = json!([{"type": "DieselStoreFrontTall", "url": "m"}]);
assert_eq!(wall_art(&[clean.clone(), clean, wide_only, mature]), vec!["tl", "w2"]);
}
#[test]
fn query_and_dates() {
assert_eq!(country_code("de"), "DE");
@@ -0,0 +1,56 @@
package com.droiddeck.launcher
import android.app.Activity
import android.content.Context
import android.os.Handler
import android.os.Looper
import com.droiddeck.launcher.session.QuestExperimental
import com.droiddeck.launcher.session.SessionPrefs
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNull
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config
import org.robolectric.shadows.ShadowBuild
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [28], manifest = Config.NONE)
class DriverMenusAutoTest {
@Before fun reset() {
RuntimeEnvironment.getApplication().getSharedPreferences("session", Context.MODE_PRIVATE)
.edit().clear().commit()
ShadowBuild.setModel("Quest 3")
ShadowBuild.setDevice("eureka")
}
@Test fun selectingAutoUsesTheQuestPairWithoutStartingADownload() {
val activity = Robolectric.buildActivity(Activity::class.java).setup().get()
SessionPrefs.setGpuDriverMode(activity, SessionPrefs.GPU_DRIVERS_MANUAL)
SessionPrefs.setAndroidDriver(activity, "chosen-display")
SessionPrefs.setLinuxDriver(activity, "chosen-linux")
val menus = DriverMenus(activity, Handler(Looper.getMainLooper()))
menus.setMode(true)
assertEquals(QuestExperimental.DRIVER, SessionPrefs.androidDriver(activity))
assertEquals("", SessionPrefs.linuxDriver(activity))
assertEquals(activity.getString(R.string.drivers_using_quest), menus.autoStatus)
assertFalse(menus.releaseChecking)
assertNull(menus.pairBusy)
menus.ensureAuto(force = true)
assertFalse(menus.releaseChecking)
}
@Test fun openingManualDriverSettingsRetainsTheSelectedPair() {
val activity = Robolectric.buildActivity(Activity::class.java).setup().get()
SessionPrefs.setGpuDriverMode(activity, SessionPrefs.GPU_DRIVERS_MANUAL)
SessionPrefs.setAndroidDriver(activity, "chosen-display")
SessionPrefs.setLinuxDriver(activity, "chosen-linux")
DriverMenus(activity, Handler(Looper.getMainLooper())).ensureAuto(force = true)
assertEquals("chosen-display", SessionPrefs.androidDriver(activity))
assertEquals("chosen-linux", SessionPrefs.linuxDriver(activity))
}
}
Loaded 100 of 197 files, more files were not shown because too many files have changed in this diff. Show more