mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-26 00:06:02 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c390e0b444 | ||
|
|
b07eca3c06 | ||
|
|
6eef0721c9 | ||
|
|
e3c3471d2f | ||
|
|
a81d1a4d4e | ||
|
|
28067b3bbe | ||
|
|
8088e47d14 | ||
|
|
6673a892e2 |
No files matched your search
@@ -7,80 +7,148 @@
|
||||
|
||||
DroidDeck brings the SteamOS experience to Android: Valve's Steam client in Big Picture on your Adreno handheld, with Windows games through Valve's ARM64 Proton.
|
||||
|
||||
<p align="center"><a href="https://discord.gg/JRGAvawjsm"><img src="https://img.shields.io/badge/Discord-Join%20the%20community-5865F2?logo=discord&logoColor=white" alt="Join the DroidDeck Discord"></a></p>
|
||||
<p align="center"><b>100% open source. No ads. No telemetry. No source withheld.</b></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.star-history.com/droid-deck/droiddeck"><img src="https://api.star-history.com/badge?repo=Droid-Deck/DroidDeck&type=rank&theme=dark" alt="Star History Rank" /></a>
|
||||
<a href="https://github.com/Droid-Deck/DroidDeck/releases/download/0.6.7/DroidDeck-0.6.7.apk"><img src="https://img.shields.io/badge/Download-DroidDeck%200.6.7%20APK-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Download DroidDeck 0.6.7"></a>
|
||||
<a href="https://discord.gg/JRGAvawjsm"><img src="https://img.shields.io/badge/Discord-Join%20us-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Join the DroidDeck Discord"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://trendshift.io/repositories/267852?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-267852" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/267852/daily?language=C" alt="Droid-Deck%2FDroidDeck | Trendshift" width="250" height="55"/></a>
|
||||
<a href="https://trendshift.io/repositories/267852?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-267852" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/267852/daily?language=Kotlin" alt="Droid-Deck%2FDroidDeck | Trendshift" width="250" height="55"/></a>
|
||||
<a href="https://www.star-history.com/droid-deck/droiddeck"><img src="https://api.star-history.com/badge?repo=Droid-Deck/DroidDeck&type=rank&theme=dark" alt="Star History Rank"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://trendshift.io/repositories/267852?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-267852" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/267852/weekly?language=C" alt="Droid-Deck%2FDroidDeck | Trendshift" width="250" height="55"/></a>
|
||||
<a href="https://trendshift.io/repositories/267852?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-267852" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/267852/weekly?language=Kotlin" alt="Droid-Deck%2FDroidDeck | Trendshift" width="250" height="55"/></a>
|
||||
<a href="https://trendshift.io/repositories/267852"><img src="https://trendshift.io/api/badge/trendshift/repositories/267852/daily?language=C" alt="Droid-Deck%2FDroidDeck | Trendshift" width="250" height="55"></a>
|
||||
<a href="https://trendshift.io/repositories/267852"><img src="https://trendshift.io/api/badge/trendshift/repositories/267852/daily?language=Kotlin" alt="Droid-Deck%2FDroidDeck | Trendshift" width="250" height="55"></a>
|
||||
</p>
|
||||
|
||||
<p align="center"><img src="docs/releases/media/0.2.0/launch-into-steam.gif" width="80%" alt="Tapping DroidDeck on the Android home screen and landing in Steam Big Picture"></p>
|
||||
<p align="center"><img src="docs/media/steam-to-desktop.gif" width="100%" alt="On a Retroid Pocket Duo: Play Steam from the DroidDeck launcher, open Pac-Man in Steam Big Picture and play it, exit the game, then Switch to Desktop from the Power menu"></p>
|
||||
|
||||
> Note: DroidDeck does not have a stand-alone website. Do not click on any download links from websites claiming to be the DroidDeck team.
|
||||
> DroidDeck has no website. Only download it from this repository's [Releases](https://github.com/Droid-Deck/DroidDeck/releases).
|
||||
|
||||
## Requirements and install
|
||||
<p align="center">
|
||||
<img src="docs/releases/media/0.6.7/library.gif" width="49%" alt="The Library switching source chips, changing the card size and opening the Filter menu">
|
||||
<img src="docs/releases/media/0.3.0/in-game.gif" width="49%" alt="A Windows game running through Proton with the on-screen controls">
|
||||
<img src="docs/releases/media/0.4.0/multi-controller.gif" width="49%" alt="Two controllers playing split screen on one handheld">
|
||||
<img src="docs/releases/media/0.6.7/ubuntu-desktop-discover.jpg" width="49%" alt="The Kubuntu desktop with Discover open">
|
||||
</p>
|
||||
|
||||
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 and downloads games into the Games storage. Epic keeps its direct API install path. Opening Epic Stores prepares Epic’s official Linux launcher preview. When installed, Epic games launched from DroidDeck use that client, and games installed in the client are imported into DroidDeck’s library and shortcuts. The x86-64 client runs through FEX on ARM and DroidDeck retains its Proton hooks; this preview and ARM setup are outside Epic’s listed Linux support. The cog on a store’s chip row sets its opening tab and download speed tier.
|
||||
## Install
|
||||
|
||||
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.
|
||||
1. Android 9 or newer on Adreno 730 or newer, or any 8xx. Adreno 6xx is experimental. Mali, Xclipse, PowerVR and Adreno 710 are unsupported. No root needed.
|
||||
2. About 3 GB free for the runtime, plus 1.1 GB for the desktop and emulators.
|
||||
3. Install the [APK](https://github.com/Droid-Deck/DroidDeck/releases/download/0.6.7/DroidDeck-0.6.7.apk), install the Linux runtime, press **Play** and sign in to Steam.
|
||||
4. On Android 14 and newer, turn on **Disable child process restrictions** in Developer options. On Android 12 and 13, Steam's first launch shows a **Fix it for me** button that walks you through it.
|
||||
|
||||
## Physical button shortcuts
|
||||
Smart glasses setup is in the [support matrix](docs/smart-glasses-support.md). Release notes are in [docs/releases](docs/releases).
|
||||
|
||||
Open the launcher's **Controls** settings, **Setup → Controller → Button mapping**, or the session drawer's **Controller** page. Each menu action has one row showing **Custom** or **Default**. Select the current value beside **Steam menu**, **Open Quick Access Menu**, or **DroidDeck menu**, then press and release a physical button. The assignment saves automatically on release; confirmation is only required if the button already opens another menu. Assignments are stored per controller; each action has one assigned button per controller. A mapped button performs the shortcut instead of sending its normal input to the game. Steam shortcuts only apply in Steam sessions, and shortcuts are inactive while loading, suspended, or using the on-screen keyboard or other input dialogs.
|
||||
|
||||
Unassigned buttons keep their existing behavior, including the Back button's single/double-press setting and Select-to-Steam option. While the session drawer is open, A selects the focused item even if it has a shortcut assignment. Select an action's current value and use **Reset** beside an assignment to restore that behavior without changing touch layouts or other controller settings. **Close** exits capture without changing an assignment; it does not undo an assignment already applied. The touchscreen remains available for configuration and recovery.
|
||||
|
||||
Extra buttons such as M1/M2 work only if Android exposes distinct key events to the app. Android Home, volume and other reserved system keys cannot be assigned; making DroidDeck the default launcher retains its existing Home-to-Steam behavior. Firmware that intercepts a button or makes it duplicate another button cannot be overridden here. During capture, the detected device and button name are shown. If a controller disconnects before release, use **Try another button** to restart capture; **Reset** remains available for existing assignments. Capture and shortcut-action diagnostics, including key and scan codes, are included in session logs when capture runs inside a session. If a button is not detected, record its physical label, firmware/controller mode, and whether it leaves the app, then share the session logs.
|
||||
|
||||
## Smart glasses
|
||||
|
||||
Use **Setup → Smart glasses** for app-wide virtual-screen settings across DroidDeck menus, launchers, desktop sessions, and games. Supported VITURE, RayNeo, XREAL, and Rokid connections provide 3DoF; Luma Ultra adds optional experimental 6DoF and stereo-assisted hand/Joy-Con tracking. Model support and SDK requirements differ: see the [smart-glasses support matrix](docs/smart-glasses-support.md) for supported devices, controls, setup, and limitations.
|
||||
|
||||
## Community
|
||||
|
||||
Join the [DroidDeck Discord](https://discord.gg/JRGAvawjsm) for help, Preview builds, and device reports. Bug reports go in its **#bug-reports** forum; attach the zip from **Share logs** (Setup, or the session drawer) so the logs come with it.
|
||||
Help, Preview builds and device reports are on [Discord](https://discord.gg/JRGAvawjsm). For bugs, post in **#bug-reports** with the zip from **Share logs**.
|
||||
|
||||
## Build
|
||||
|
||||
Run `tools/build_local.sh` with Docker, Java 17, the Android SDK/NDK, Rust through rustup, GitHub CLI, Python 3, and `zstd` installed. It prepares the same native libraries, pinned components and audio sinks as CI, then checks the APK's assets, JNI exports and dependencies. The APK is at `app/build/outputs/apk/release/app-release.apk`. Set `DROIDDECK_PA13_SOURCE_DIR` to an existing PulseAudio 13.0 source directory to skip downloading it. Set `DROIDDECK_SIGNING_ENV` to a signing environment file to install over a release build; relative keystore paths resolve beside that file. To install on an attached device, run `tools/deploy_local.sh`.
|
||||
Needs Docker, Java 17, the Android SDK and NDK, Rust via rustup, GitHub CLI, Python 3 and `zstd`.
|
||||
|
||||
After preparation, ordinary `./gradlew :app:assembleRelease` builds can reuse the verified inputs. If native sources, component pins or staged files change, packaging stops with instructions to rerun the helper. Generated audio stays under `app/build/`; the tracked base bundle is never modified. `./gradlew -PskipRust=true :app:testDebugUnitTest` needs no native preparation. For an APK without store engines, use `DROIDDECK_SKIP_RUST=1 tools/build_local.sh`; it omits cached engine libraries too.
|
||||
```bash
|
||||
tools/build_local.sh
|
||||
```
|
||||
|
||||
For the prepared Windows checkout, run `./tools/run_windows.ps1` (optionally with `-Serial <adb-serial>`), or select **DroidDeck XR** in Android Studio and run the **app** module on the connected phone. Machine-specific options live in the ignored `local.properties`: `droiddeck.python` selects a Python executable, `droiddeck.skipRust=true` omits the optional store download engines, and `droiddeck.debugApplicationIdSuffix=.xr` installs **DroidDeck XR Dev** alongside the signed release. The development app has its own runtime and Steam login. The local Java selection is in `.gradle/config.properties`.
|
||||
The APK lands in `app/build/outputs/apk/release/`. Install it with `tools/deploy_local.sh`. After the first run, `./gradlew :app:assembleRelease` reuses the prepared inputs. Unit tests run with `./gradlew -PskipRust=true :app:testDebugUnitTest`, and the helper and preload suite with `bash tools/test_local.sh`.
|
||||
|
||||
`python tools/prepare_windows_runtime.py` restores this checkout's audited runtime inputs from the pinned CI APK, three locally rebuilt preload libraries, and the checksum-pinned Gamescope archive in `build/windows-setup/`. Start Docker Desktop's Linux engine first: preparation now rebuilds DroidDeck's ARM64 VR driver and Vulkan layer from current source and runs their native regression tests. The compiler image is built automatically on first use. Vulkan headers come from the NDK beside `--llvm-strip`, or from an explicit `--vk-include <NDK-sysroot-include>` directory.
|
||||
|
||||
To reuse that build, pass `--rebuilt-vr build/windows-setup/vr`. Preparation verifies its `vr-build.json` against the current Git revision, source files, Vulkan headers, output checksums, and ARM64 architecture; missing or stale builds fail instead of falling back to the donor's VR libraries. The script checks the actual donor CI merge tree, still rejects unrelated unaudited runtime changes, and records component provenance in `app/build/windows-runtime-provenance.json`. Preserve these ignored preparation files when rebuilding locally; `clean` removes the prepared assets and their verification manifest.
|
||||
|
||||
Run the helper and preload regression suite with `bash tools/test_local.sh`. On macOS it runs in Linux through Docker, matching the helpers' runtime and CI instead of compiling Linux preloads against macOS headers.
|
||||
On Windows, see `tools/run_windows.ps1` and `tools/prepare_windows_runtime.py`.
|
||||
|
||||
## Limits
|
||||
|
||||
Compatibility and performance vary by device; hardware validation is limited. Desktop compositing uses software rendering. Firefox sandboxing is reduced under proot. Logs are kept app-private (`files/logs/`, the last 30 sessions); **Share logs** packs the newest session, with the stores and tool logs, into one scrubbed zip.
|
||||
Compatibility and performance vary by device. Desktop compositing is software rendered, and Firefox sandboxing is reduced under proot.
|
||||
|
||||
## Credits and licence
|
||||
|
||||
GPL-3.0. Runtime, shim, input, and controller work build on WinNative and Bannerlator (maxjivi05). Epic Games and GOG support build on [Phobos’s](https://github.com/phobos665) adaptation of [Legendary](https://github.com/legendary-gl/legendary) and [gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl), respectively. Battle.net support is [@kayakyakr](https://github.com/kayakyakr)'s: it runs Blizzard's own Battle.net client, downloaded from Blizzard and not included, in Proton, and shows the key art from each game's [Battle.net Shop](https://shop.battle.net) page; without the Steam client its games see DroidDeck's pad as an Xbox 360 controller through `PROTON_SPOOF_STEAMINPUT_VIDPID` in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/winebus.sys`. Its games install from Stores through Blizzard's own Agent and the local HTTP API it serves, driven the way [@barncastle](https://github.com/barncastle)'s [Battle.Net-Installer](https://github.com/barncastle/Battle.Net-Installer) drives it, with the requests described on [wowdev.wiki](https://wowdev.wiki/Agent); how other launchers find, install and start Blizzard games was read in [@mubaraknumann](https://github.com/mubaraknumann)'s [unifideck](https://github.com/mubaraknumann/unifideck), [@djmittens](https://github.com/djmittens)'s [neo-mittens](https://github.com/djmittens/neo-mittens) `bnetswitch`, [@BCD1210](https://github.com/BCD1210)'s [soju](https://github.com/BCD1210/soju) and [Lutris](https://github.com/lutris/lutris)'s `product.db` reader, without taking their code. The registry entries a GOG game's install script (`goggame-<id>.script`) sets are read the way [Heroic Games Launcher](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher)'s GOG setup (GPL-3.0) reads them. LSFG frame generation is from the work of Camille LaVey and the [Eden](https://eden-emu.dev) emulator project, following [lsfg-vk](https://github.com/PancakeTAS/lsfg-vk), ported to WinNative and DroidDeck by [@maxjivi05](https://github.com/maxjivi05); it needs your own copy of [Lossless Scaling](https://store.steampowered.com/app/993090/) and ships none of its shaders. x86 AppImages, and any whose own runtime cannot unpack them, are unpacked with [uruntime](https://github.com/VHSgunzo/uruntime) by VHSgunzo (MIT), shipped unmodified with its licence, which also starts the arm64 emulator AppImages whose own runtime cannot run its extractor on Android. x86 AppImages packed with [sharun](https://github.com/VHSgunzo/sharun) by VHSgunzo (MIT) start because DroidDeck's own [FEX](https://github.com/FEX-Emu/FEX) build (MIT) puts the platform name under `AT_PLATFORM`, which sharun's [userland-execve](https://crates.io/crates/userland-execve) loader (MIT) requires; FEX filed it under `AT_BASE_PLATFORM`. The Steam client's audio goes through [@The412Banner](https://github.com/The412Banner)'s [DirectAudio](https://github.com/The412Banner/directaudio) PulseAudio sink (LGPL-2.1-or-later), built from `tools/directaudio/sink` with its request size kept to its ring so clients are not asked to queue 100 ms ahead. The in-game performance HUD is [@The412Banner](https://github.com/The412Banner)'s [FusionHUD](https://github.com/The412Banner/FusionHUD) (GPL-3.0 with an attribution term), Bannerlator's HUD; its frame rate, frame times and readings are taken from the same sources, and worked out the same way, as Valve's [MangoHud](https://github.com/flightlessmango/MangoHud) build (MIT) that runs Steam's performance overlay in a DroidDeck session, with the frame times shared by gamescope patch 0125; when gamescope sends no frames for two seconds, the HUD counts the frames DroidDeck's compositor shows instead, which stop at the screen's refresh rate. mmap ring-buffer controller input was developed by ribbit384 ([WinNative #345](https://github.com/WinNative-Emu/WinNative/pull/345)). Why the x86-64 Steam client refused the arm64 client's sign-in was checked by reading Steam's saved token with the `ConnectCache` format from [deadlock-api-ingest](https://github.com/deadlock-api/deadlock-api-ingest). x86 programs that link OpenSSL 3 under FEX use the copy in the [Steam Linux Runtime 4.0](https://gitlab.steamos.cloud/steamrt/steamrt) platform. Hooks written with `WriteProcessMemory` into code [FEX](https://github.com/FEX-Emu/FEX) has translated go through `/proc/<pid>/mem` again when the kernel refuses `process_vm_writev`, as [Wine](https://gitlab.winehq.org/wine/wine)'s `server/ptrace.c` wrote them before Wine 11. x86 Linux games under FEX get the same `/etc/asound.conf` that [pressure-vessel](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools) writes into the Steam Linux Runtime, so ALSA plays through PulseAudio. Games render with [Mesa](https://gitlab.freedesktop.org/mesa/mesa) Turnip's own per-render-pass choice between tile memory and system memory, while the Steam client keeps `TU_DEBUG=sysmem`; [FEX](https://github.com/FEX-Emu/FEX)'s code disk cache was checked in its source and isLine truncated
|
||||
DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. VITURE, RayNeo, XREAL, Rokid, REDMAGIC, Nintendo Switch and Joy-Con are trademarks of their owners. This project is not affiliated with any of them.
|
||||
|
||||
XR glasses support builds on WinNative's VITURE glasses work. VITURE protocol details were checked against [XRLinuxDriver](https://github.com/wheaney/XRLinuxDriver) by [@wheaney](https://github.com/wheaney), including the VITURE protocol header it ships, [ar-drivers-rs](https://github.com/badicsalex/ar-drivers-rs) by [@badicsalex](https://github.com/badicsalex) and the [go-macos/iokit VITURE package](https://pkg.go.dev/github.com/go-macos/iokit/viture); the optional VITURE SDK belongs to VITURE and is not included. RayNeo support adapts [@informalTechCode](https://github.com/informalTechCode)'s [RayNeo-Air-Series-3DoF-Scaffold](https://github.com/informalTechCode/RayNeo-Air-Series-3DoF-Scaffold) (Apache-2.0) and references [@verncat](https://github.com/verncat)'s [RayNeo-Air-3S-Pro-OpenVR](https://github.com/verncat/RayNeo-Air-3S-Pro-OpenVR) (MIT) and [Monado](https://gitlab.freedesktop.org/monado/monado) (BSL-1.0); see [docs/third-party/rayneo](docs/third-party/rayneo/README.md). XREAL 1S support references [XRLinuxDriver](https://github.com/wheaney/XRLinuxDriver) and [xrealOneDeviceKit](https://github.com/wheaney/xrealOneDeviceKit) by @wheaney, [xreal_one_driver](https://github.com/rohitsangwan01/xreal_one_driver) by [@rohitsangwan01](https://github.com/rohitsangwan01) (MIT) and [xr-tools](https://github.com/0xcaff/xr-tools) by [@0xcaff](https://github.com/0xcaff). Rokid support follows the Rokid protocol notes in [ar-drivers-rs](https://github.com/badicsalex/ar-drivers-rs) and @badicsalex's [Void Computing write-ups](https://voidcomputing.hu/blog/worse-better-prettier/), and [Monado](https://gitlab.freedesktop.org/monado/monado)'s Rokid driver. The REDMAGIC glasses-display findings draw on [@mekhontsev](https://github.com/mekhontsev)'s [MagicDesk investigation](https://github.com/mekhontsev/magicdesk/blob/main/docs/xr-resolution-fix.md) and [@Coding-BR](https://github.com/Coding-BR)'s [decompiled Nubia kernel](https://github.com/Coding-BR/android_kernel_nubia_sm8850_qwjujube). VITURE, RayNeo, XREAL, Rokid and REDMAGIC are trademarks of their owners; this project is not affiliated with them.
|
||||
<details>
|
||||
<summary><b>Runtime, Wine and Proton</b></summary>
|
||||
|
||||
Joy-Con VR controllers port the arm model of Google's [Google VR SDK for Unity](https://github.com/googlevr/gvr-unity-sdk) (Apache-2.0), adapt the hand skeleton of Valve's [OpenVR](https://github.com/ValveSoftware/openvr) `handskeletonsimulation` sample (BSD-3-Clause), which follows Moshi Turner's hand simulation in [Monado](https://gitlab.freedesktop.org/monado/monado), and use the Index controller offsets from Monado's `vive_poses.c` (BSL-1.0). Joy-Con behaviour was researched in Linux's [hid-nintendo](https://github.com/torvalds/linux/blob/master/drivers/hid/hid-nintendo.c) driver by Daniel J. Ogorchock, [@dekuNukem](https://github.com/dekuNukem)'s [Nintendo_Switch_Reverse_Engineering](https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering), [SDL](https://github.com/libsdl-org/SDL) and the Android Open Source Project, and checked against [ALVR](https://github.com/alvr-org/ALVR), [OpenComposite](https://gitlab.com/znixian/OpenOVR), [PSMoveSteamVRBridge](https://github.com/HipsterSloth/PSMoveSteamVRBridge), [@F8LEFT](https://github.com/F8LEFT)'s [JoyConVr](https://github.com/F8LEFT/JoyConVr), [@krnelpan1c](https://github.com/krnelpan1c)'s [Daydream-Controller-SteamVR](https://github.com/krnelpan1c/Daydream-Controller-SteamVR), [@yoyobuae](https://github.com/yoyobuae)'s [joyconvr](https://github.com/yoyobuae/joyconvr), [Moonlight](https://github.com/moonlight-stream/moonlight-android) and [Dolphin](https://github.com/dolphin-emu/dolphin); see [docs/third-party/joycon](docs/third-party/joycon/README.md). Nintendo Switch and Joy-Con are trademarks of Nintendo; this project is not affiliated with Nintendo.
|
||||
- Runtime, shim, input and controller work build on WinNative and Bannerlator by maxjivi05.
|
||||
- mmap ring buffer controller input by ribbit384 ([WinNative #345](https://github.com/WinNative-Emu/WinNative/pull/345)).
|
||||
- [FEX](https://github.com/FEX-Emu/FEX) (MIT) runs x86 code. DroidDeck's build puts the platform name under `AT_PLATFORM` so [sharun](https://github.com/VHSgunzo/sharun) AppImages by VHSgunzo (MIT) start through its [userland-execve](https://crates.io/crates/userland-execve) loader (MIT). FEX's code disk cache was checked in its source.
|
||||
- x86 AppImages, and arm64 ones whose runtime can't unpack on Android, are unpacked with [uruntime](https://github.com/VHSgunzo/uruntime) by VHSgunzo (MIT), shipped unmodified with its licence.
|
||||
- x86 programs linking OpenSSL 3 use the copy in the [Steam Linux Runtime 4.0](https://gitlab.steamos.cloud/steamrt/steamrt). x86 Linux games get the `/etc/asound.conf` that [pressure-vessel](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools) writes.
|
||||
- `WriteProcessMemory` hooks fall back to `/proc/<pid>/mem` the way [Wine](https://gitlab.winehq.org/wine/wine)'s `server/ptrace.c` did before Wine 11.
|
||||
- Wine write watches use userfaultfd support in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/ntdll/unix/virtual.c` (LGPL-2.1-or-later). libblsession supplies the arm64 syscall number and answers `PAGEMAP_SCAN` from `/proc/self/pagemap`.
|
||||
- libblsession runs Wine's arm64 `SIGUSR2` context handler (`dlls/ntdll/unix/signal_arm64.c`, LGPL-2.1-or-later) in place on a frame laid out like [Linux](https://github.com/torvalds/linux)'s `arch/arm64/kernel/signal.c`, and serves `fill_vm_counters` in `dlls/ntdll/unix/process.c` the kernel's own `/proc/<pid>/status`.
|
||||
- droiddeck-ntsync follows the [Linux](https://github.com/torvalds/linux) ntsync semantics in `Documentation/userspace-api/ntsync.rst` (GPL-2.0).
|
||||
- The proot fast path orders bindings like [PRoot](https://github.com/proot-me/proot)'s `path/binding.c` (GPL-2.0-or-later).
|
||||
- Games use [Mesa](https://gitlab.freedesktop.org/mesa/mesa) Turnip's per render pass memory choice. The Steam client keeps `TU_DEBUG=sysmem`.
|
||||
- Black Ops III and Dark Souls Remastered start without [umu-protonfixes](https://github.com/Open-Wine-Components/umu-protonfixes) (BSD-2-Clause), whose `311210.py` and `570940.py` fail under ARM64 Proton.
|
||||
- [ReSkate](https://github.com/Dingo-Shenanigans/ReSkate) (GPL-3.0) by Dingo Shenanigans uses the launch option from its README and D3D12 feature level 12_1.
|
||||
- The arm64 client's sign in was checked by reading Steam's saved token with the `ConnectCache` format from [deadlock-api-ingest](https://github.com/deadlock-api/deadlock-api-ingest).
|
||||
|
||||
Camera hand tracking runs Google's [MediaPipe](https://github.com/google-ai-edge/mediapipe) Tasks Vision library with its Pose Landmarker (Lite) model, BlazePose GHUM 3D, and its Hand Landmarker model (all Apache-2.0), on frames from AndroidX [CameraX](https://developer.android.com/jetpack/androidx/releases/camera) (Apache-2.0); MediaPipe's usage reports are switched off. The design was checked against [@F8LEFT](https://github.com/F8LEFT)'s [JoyConVr](https://github.com/F8LEFT/JoyConVr) camera app (MIT), and the short Joy-Con movements follow the accelerometer mode of the [Google VR SDK for Unity](https://github.com/googlevr/gvr-unity-sdk)'s arm model, Eric Foxlin's zero-velocity updates and Frosio, Pedersini and Borghese's accelerometer autocalibration, and the camera and Joy-Con are joined by a Kalman filter (R. E. Kalman, 1960). Bare camera hands take their gestures after [ALVR](https://github.com/alvr-org/ALVR)'s `hand_gestures.rs` (MIT) and Meta Quest's menu pinch, with distances checked on photos from the [HaGRID](https://github.com/hukenovs/hagrid) gesture set (CC BY-SA 4.0, not included), fit the palm with Horn's quaternion method (1987) and smooth it with the 1€ filter (Casiez, Roussel and Vogel, 2012); the white glove model follows Valve's OpenVR render model reference and Index controller poses, is meshed with surface nets (Gibson, 1998; Mikola Lysenko) and blends and shades it with Inigo Quilez's smooth minimum and distance-field ambient occlusion, porting his polygon distance (MIT); see [docs/third-party/handtracking](docs/third-party/handtracking/README.md).
|
||||
</details>
|
||||
|
||||
The Store installs and runs apps with [Flatpak](https://github.com/flatpak/flatpak) (LGPL-2.1). Its sandbox goes through DroidDeck's own bubblewrap shim, which follows how Flatpak hands bwrap its environment. Chromium and Electron apps from Flathub start their browser processes through [zypak](https://github.com/refi64/zypak) by [@refi64](https://github.com/refi64) (BSD-3-Clause); its source was read to see that it always spawns them through Flatpak's spawn portal, which is why DroidDeck starts them directly without Chromium's sandbox instead.
|
||||
<details>
|
||||
<summary><b>Stores</b></summary>
|
||||
|
||||
Remote Play from a PC to the arm64 Steam client goes through a stand-in for the V4L2 decoder and the libdrm dumb buffers that Steam's `streaming_client` expects: each frame is decoded by Android's MediaCodec through the app, or by the [FFmpeg](https://ffmpeg.org) (LGPL-2.1-or-later) that ships in Steam's own runtime, into dma-heap buffers that its Vulkan renderer imports. The Qualcomm low-latency decoder settings follow [Moonlight](https://github.com/moonlight-stream/moonlight-android) (GPL-3.0).
|
||||
- Epic Games and GOG build on [Phobos](https://github.com/phobos665)'s adaptation of [Legendary](https://github.com/legendary-gl/legendary) and [gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl). GOG install script registry entries are read the way [Heroic Games Launcher](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher) (GPL-3.0) reads them.
|
||||
- Epic's official Linux launcher preview runs through FEX. That setup is outside Epic's listed Linux support.
|
||||
- Battle.net is by [@kayakyakr](https://github.com/kayakyakr). It runs Blizzard's own client in Proton (downloaded from Blizzard, not included) and shows key art from the [Battle.net Shop](https://shop.battle.net). Without Steam, its games see the pad as an Xbox 360 controller via `PROTON_SPOOF_STEAMINPUT_VIDPID` in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/winebus.sys`.
|
||||
- Battle.net installs drive Blizzard's Agent the way [@barncastle](https://github.com/barncastle)'s [Battle.Net-Installer](https://github.com/barncastle/Battle.Net-Installer) does, with requests from [wowdev.wiki](https://wowdev.wiki/Agent). Read without taking code: [@mubaraknumann](https://github.com/mubaraknumann)'s [unifideck](https://github.com/mubaraknumann/unifideck), [@djmittens](https://github.com/djmittens)'s [neo-mittens](https://github.com/djmittens/neo-mittens) `bnetswitch`, [@BCD1210](https://github.com/BCD1210)'s [soju](https://github.com/BCD1210/soju) and [Lutris](https://github.com/lutris/lutris)'s `product.db` reader.
|
||||
- Xbox games load [@domsvoboda](https://github.com/domsvoboda)'s [xodus-nexus](https://github.com/domsvoboda/xodus-nexus) modules (LGPL-2.1-or-later), including `wintypes.dll`. Minecraft's GameInput setup was checked against [@Wyze3306](https://github.com/Wyze3306)'s [BedrockOnLinux](https://github.com/Wyze3306/BedrockOnLinux) (MIT).
|
||||
- The itch.io butler pack ships butler's `7z.so`, itch.io's build of [7-Zip](https://www.7-zip.org) by Igor Pavlov (LGPL-2.1, unRAR restriction on RAR code), unmodified. Other archives use Apache Commons Compress and the runtime's bsdtar (libarchive).
|
||||
- The Store uses [Flatpak](https://github.com/flatpak/flatpak) (LGPL-2.1) through DroidDeck's own bubblewrap shim. Chromium and Electron apps start directly, since [zypak](https://github.com/refi64/zypak) by [@refi64](https://github.com/refi64) (BSD-3-Clause) always uses Flatpak's spawn portal.
|
||||
|
||||
Steam's Browse buttons open a GTK 3 file chooser through PyGObject (LGPL-2.1-or-later). It runs under Steam's own `reaper` with Steam's app ID, which [gamescope](https://github.com/ValveSoftware/gamescope) (BSD-2-Clause) reads from the process tree (`GetAppIdFromReaper` in `src/Utils/Process.cpp`) to show it over Steam.
|
||||
</details>
|
||||
|
||||
Black Ops III and Dark Souls Remastered start without [umu-protonfixes](https://github.com/Open-Wine-Components/umu-protonfixes) (BSD-2-Clause), whose fixes for them (`311210.py` sets ALSA audio, `570940.py` installs VC++ 2017) fail under ARM64 Proton.
|
||||
<details>
|
||||
<summary><b>Audio, video and HUD</b></summary>
|
||||
|
||||
- Steam audio goes through [@The412Banner](https://github.com/The412Banner)'s [DirectAudio](https://github.com/The412Banner/directaudio) PulseAudio sink (LGPL-2.1-or-later), built from `tools/directaudio/sink`.
|
||||
- The DroidDeck HUD is [@The412Banner](https://github.com/The412Banner)'s [FusionHUD](https://github.com/The412Banner/FusionHUD) (GPL-3.0 with an attribution term). Its readings match Valve's [MangoHud](https://github.com/flightlessmango/MangoHud) build (MIT), with frame times from gamescope patch 0125.
|
||||
- LSFG frame generation comes from Camille LaVey and the [Eden](https://eden-emu.dev) project, following [lsfg-vk](https://github.com/PancakeTAS/lsfg-vk), ported by [@maxjivi05](https://github.com/maxjivi05). It needs your own copy of [Lossless Scaling](https://store.steampowered.com/app/993090/) and ships none of its shaders.
|
||||
- Remote Play decodes through Android's MediaCodec or the [FFmpeg](https://ffmpeg.org) (LGPL-2.1-or-later) in Steam's runtime. Qualcomm low latency settings follow [Moonlight](https://github.com/moonlight-stream/moonlight-android) (GPL-3.0).
|
||||
- [PipeWire](https://gitlab.freedesktop.org/pipewire/pipewire) (MIT) sockets use the settings in its `module-access.c`, and [WirePlumber](https://gitlab.freedesktop.org/pipewire/wireplumber) (MIT) keeps those clients at full permissions.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>Desktop</b></summary>
|
||||
|
||||
- The KDE pacman repository snapshots [Arch Linux ARM](https://archlinuxarm.org) and installs with [pacman](https://gitlab.archlinux.org/pacman/pacman) (GPL-2.0-or-later).
|
||||
- [KWin](https://invent.kde.org/plasma/kwin) (GPL-2.0-or-later) is patched to pass on the scroll data its `wayland_backend.cpp` leaves as a TODO.
|
||||
- Read without taking code: [Qt](https://code.qt.io/cgit/qt/qtbase.git)'s `qwaylandinputdevice.cpp` and `qguiapplication.cpp`, [Konsole](https://invent.kde.org/utilities/konsole)'s `TerminalDisplay.cpp`, and [Mesa](https://gitlab.freedesktop.org/mesa/mesa)'s `u_threaded_context.c` and `zink_resource.c`.
|
||||
- The Steam Keyboard window rule follows Valve's `steamdeck-kde-presets` with [Bazzite](https://github.com/ublue-os/bazzite)'s `0001-steam-virtual-keyboard.patch`.
|
||||
- Steam's Browse buttons open a GTK 3 file chooser via PyGObject (LGPL-2.1-or-later), shown over Steam by [gamescope](https://github.com/ValveSoftware/gamescope) (BSD-2-Clause) through `GetAppIdFromReaper`.
|
||||
- The AYN Odin 2 phantom second display was confirmed by [@SapphireRhodonite](https://github.com/SapphireRhodonite)'s [WatermelonDS 0.0.5](https://github.com/SapphireRhodonite/WatermelonDS/releases/tag/0.0.5) notes and [iiSU #363](https://github.com/iisu-network/iiSU/issues/363), without taking their code.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>Smart glasses</b></summary>
|
||||
|
||||
- Builds on WinNative's VITURE work. Protocol checked against [@wheaney](https://github.com/wheaney)'s [XRLinuxDriver](https://github.com/wheaney/XRLinuxDriver), [@badicsalex](https://github.com/badicsalex)'s [ar-drivers-rs](https://github.com/badicsalex/ar-drivers-rs) and [go-macos/iokit](https://pkg.go.dev/github.com/go-macos/iokit/viture). The optional VITURE SDK is not included.
|
||||
- RayNeo adapts [@informalTechCode](https://github.com/informalTechCode)'s [RayNeo-Air-Series-3DoF-Scaffold](https://github.com/informalTechCode/RayNeo-Air-Series-3DoF-Scaffold) (Apache-2.0) and references [@verncat](https://github.com/verncat)'s [RayNeo-Air-3S-Pro-OpenVR](https://github.com/verncat/RayNeo-Air-3S-Pro-OpenVR) (MIT) and [Monado](https://gitlab.freedesktop.org/monado/monado) (BSL-1.0). See [docs/third-party/rayneo](docs/third-party/rayneo/README.md).
|
||||
- XREAL 1S references XRLinuxDriver and [xrealOneDeviceKit](https://github.com/wheaney/xrealOneDeviceKit) by @wheaney, [@rohitsangwan01](https://github.com/rohitsangwan01)'s [xreal_one_driver](https://github.com/rohitsangwan01/xreal_one_driver) (MIT) and [@0xcaff](https://github.com/0xcaff)'s [xr-tools](https://github.com/0xcaff/xr-tools).
|
||||
- Rokid follows ar-drivers-rs, @badicsalex's [Void Computing write-ups](https://voidcomputing.hu/blog/worse-better-prettier/) and Monado's Rokid driver.
|
||||
- REDMAGIC display findings draw on [@mekhontsev](https://github.com/mekhontsev)'s [MagicDesk investigation](https://github.com/mekhontsev/magicdesk/blob/main/docs/xr-resolution-fix.md) and [@Coding-BR](https://github.com/Coding-BR)'s [decompiled Nubia kernel](https://github.com/Coding-BR/android_kernel_nubia_sm8850_qwjujube).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>VR, Joy-Con and hand tracking</b></summary>
|
||||
|
||||
- Joy-Con VR ports the arm model from Google's [GVR SDK for Unity](https://github.com/googlevr/gvr-unity-sdk) (Apache-2.0) and adapts the hand skeleton from Valve's [OpenVR](https://github.com/ValveSoftware/openvr) `handskeletonsimulation` sample (BSD-3-Clause), which follows Moshi Turner's work in Monado. Index offsets come from Monado's `vive_poses.c` (BSL-1.0).
|
||||
- Joy-Con research: Linux's [hid-nintendo](https://github.com/torvalds/linux/blob/master/drivers/hid/hid-nintendo.c) by Daniel J. Ogorchock, [@dekuNukem](https://github.com/dekuNukem)'s [Nintendo_Switch_Reverse_Engineering](https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering), [SDL](https://github.com/libsdl-org/SDL) and AOSP. Checked against [ALVR](https://github.com/alvr-org/ALVR), [OpenComposite](https://gitlab.com/znixian/OpenOVR), [PSMoveSteamVRBridge](https://github.com/HipsterSloth/PSMoveSteamVRBridge), [@F8LEFT](https://github.com/F8LEFT)'s [JoyConVr](https://github.com/F8LEFT/JoyConVr), [@krnelpan1c](https://github.com/krnelpan1c)'s [Daydream-Controller-SteamVR](https://github.com/krnelpan1c/Daydream-Controller-SteamVR), [@yoyobuae](https://github.com/yoyobuae)'s [joyconvr](https://github.com/yoyobuae/joyconvr), [Moonlight](https://github.com/moonlight-stream/moonlight-android) and [Dolphin](https://github.com/dolphin-emu/dolphin). See [docs/third-party/joycon](docs/third-party/joycon/README.md).
|
||||
- Camera hand tracking runs Google's [MediaPipe](https://github.com/google-ai-edge/mediapipe) Pose Landmarker (Lite), BlazePose GHUM 3D and Hand Landmarker (Apache-2.0) on [CameraX](https://developer.android.com/jetpack/androidx/releases/camera) frames (Apache-2.0), with usage reports off. Checked against JoyConVr's camera app (MIT).
|
||||
- Tracking math: the GVR arm model's accelerometer mode, Eric Foxlin's zero velocity updates, Frosio, Pedersini and Borghese's accelerometer autocalibration, a Kalman filter (Kalman, 1960), Horn's quaternion method (1987) and the 1€ filter (Casiez, Roussel and Vogel, 2012).
|
||||
- Gestures follow [ALVR](https://github.com/alvr-org/ALVR)'s `hand_gestures.rs` (MIT) and Meta Quest's menu pinch, tuned on [HaGRID](https://github.com/hukenovs/hagrid) photos (CC BY-SA 4.0, not included).
|
||||
- The glove model follows OpenVR's render model reference, is meshed with surface nets (Gibson, 1998; Mikola Lysenko), and uses Inigo Quilez's smooth minimum, distance field ambient occlusion and polygon distance (MIT). See [docs/third-party/handtracking](docs/third-party/handtracking/README.md).
|
||||
|
||||
</details>
|
||||
|
||||
## Star history
|
||||
|
||||
<a href="https://www.star-history.com/#Droid-Deck/DroidDeck&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=Droid-Deck/DroidDeck&type=Date&theme=dark">
|
||||
<img alt="Star history chart" src="https://api.star-history.com/svg?repos=Droid-Deck/DroidDeck&type=Date" width="100%">
|
||||
</picture>
|
||||
</a>
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "blend_vert.h"
|
||||
#include "blend_frag.h"
|
||||
#include "rotate_vert.h"
|
||||
|
||||
struct pc_blend { float dst[4]; float src[4]; };
|
||||
|
||||
@@ -15,11 +16,11 @@ static VkSampler g_sampler;
|
||||
static VkDescriptorSetLayout g_dsl;
|
||||
static VkPipelineLayout g_pl;
|
||||
static VkDescriptorPool g_dpool;
|
||||
static VkShaderModule g_vert, g_frag;
|
||||
static VkShaderModule g_vert, g_frag, g_rot_vert;
|
||||
static unsigned g_frame = 1;
|
||||
|
||||
#define NFMT 4
|
||||
static struct { VkFormat fmt; VkRenderPass rp; VkPipeline pipe; } g_out[NFMT];
|
||||
static struct { VkFormat fmt; VkRenderPass rp; VkPipeline pipe, rot; } g_out[NFMT];
|
||||
|
||||
#define NSRC 32
|
||||
static struct { VkImage img; VkImageView view; VkDescriptorSet ds; unsigned frame; } g_src[NSRC];
|
||||
@@ -85,10 +86,10 @@ static VkRenderPass make_rp(VkFormat fmt) {
|
||||
return rp;
|
||||
}
|
||||
|
||||
static VkPipeline make_pipe(VkRenderPass rp) {
|
||||
static VkPipeline make_pipe(VkRenderPass rp, VkShaderModule vert, int blend) {
|
||||
VkPipelineShaderStageCreateInfo st[2] = {
|
||||
{.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, .stage = VK_SHADER_STAGE_VERTEX_BIT,
|
||||
.module = g_vert, .pName = "main"},
|
||||
.module = vert, .pName = "main"},
|
||||
{.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, .stage = VK_SHADER_STAGE_FRAGMENT_BIT,
|
||||
.module = g_frag, .pName = "main"}};
|
||||
VkPipelineVertexInputStateCreateInfo vi = {.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO};
|
||||
@@ -105,11 +106,12 @@ static VkPipeline make_pipe(VkRenderPass rp) {
|
||||
VkPipelineMultisampleStateCreateInfo ms = {.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
|
||||
.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT};
|
||||
VkPipelineColorBlendAttachmentState ba = {
|
||||
.blendEnable = VK_TRUE, .srcColorBlendFactor = VK_BLEND_FACTOR_ONE,
|
||||
.blendEnable = blend ? VK_TRUE : VK_FALSE, .srcColorBlendFactor = VK_BLEND_FACTOR_ONE,
|
||||
.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, .colorBlendOp = VK_BLEND_OP_ADD,
|
||||
.srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE, .dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
|
||||
.alphaBlendOp = VK_BLEND_OP_ADD,
|
||||
.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT};
|
||||
.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT |
|
||||
(blend ? 0 : VK_COLOR_COMPONENT_A_BIT)};
|
||||
VkPipelineColorBlendStateCreateInfo cb = {.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
|
||||
.attachmentCount = 1, .pAttachments = &ba};
|
||||
VkGraphicsPipelineCreateInfo pi = {.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, .stageCount = 2,
|
||||
@@ -125,11 +127,12 @@ static VkPipeline make_pipe(VkRenderPass rp) {
|
||||
static void objects_destroy(void) {
|
||||
if (g_vert) g_vk.DestroyShaderModule(g_dev, g_vert, NULL);
|
||||
if (g_frag) g_vk.DestroyShaderModule(g_dev, g_frag, NULL);
|
||||
if (g_rot_vert) g_vk.DestroyShaderModule(g_dev, g_rot_vert, NULL);
|
||||
if (g_dpool) g_vk.DestroyDescriptorPool(g_dev, g_dpool, NULL);
|
||||
if (g_pl) g_vk.DestroyPipelineLayout(g_dev, g_pl, NULL);
|
||||
if (g_dsl) g_vk.DestroyDescriptorSetLayout(g_dev, g_dsl, NULL);
|
||||
if (g_sampler) g_vk.DestroySampler(g_dev, g_sampler, NULL);
|
||||
g_vert = g_frag = VK_NULL_HANDLE; g_dpool = VK_NULL_HANDLE; g_pl = VK_NULL_HANDLE;
|
||||
g_vert = g_frag = g_rot_vert = VK_NULL_HANDLE; g_dpool = VK_NULL_HANDLE; g_pl = VK_NULL_HANDLE;
|
||||
g_dsl = VK_NULL_HANDLE; g_sampler = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
@@ -159,6 +162,7 @@ static int objects_ensure(void) {
|
||||
if (g_vk.CreateDescriptorPool(g_dev, &dpi, NULL, &g_dpool) != VK_SUCCESS) goto fail;
|
||||
if (!(g_vert = shader(blend_vert_code, sizeof(blend_vert_code)))) goto fail;
|
||||
if (!(g_frag = shader(blend_frag_code, sizeof(blend_frag_code)))) goto fail;
|
||||
if (!(g_rot_vert = shader(rotate_vert_code, sizeof(rotate_vert_code)))) goto fail;
|
||||
g_ready = 1;
|
||||
droiddeck_log("gpu", "alpha composition ready on %s: translucent surfaces are blended over what is under them",
|
||||
vkp_gpu_name());
|
||||
@@ -175,7 +179,7 @@ static int out_slot(VkFormat fmt) {
|
||||
for (i = 0; i < NFMT && g_out[i].pipe; i++) if (g_out[i].fmt == fmt) return i;
|
||||
if (i == NFMT) return -1;
|
||||
VkRenderPass rp = make_rp(fmt);
|
||||
VkPipeline pipe = rp ? make_pipe(rp) : VK_NULL_HANDLE;
|
||||
VkPipeline pipe = rp ? make_pipe(rp, g_vert, 1) : VK_NULL_HANDLE;
|
||||
if (!pipe) {
|
||||
if (rp) g_vk.DestroyRenderPass(g_dev, rp, NULL);
|
||||
return -1;
|
||||
@@ -303,3 +307,31 @@ int blendp_draw(VkCommandBuffer cmd, VkImage src, VkFormat src_fmt, int src_w, i
|
||||
if (!src_general) src_layout(cmd, src, sampled, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int blendp_rotate(VkCommandBuffer cmd, VkImage src, VkFormat src_fmt, int src_w, int src_h,
|
||||
VkImage dst, VkFormat dst_fmt, int dst_w, int dst_h, int degrees) {
|
||||
if (!src || !dst || src_w <= 0 || src_h <= 0 || dst_w <= 0 || dst_h <= 0 || objects_ensure() != 0) return -1;
|
||||
if (degrees != 90 && degrees != 270) return -1;
|
||||
int slot = out_slot(dst_fmt);
|
||||
if (slot < 0) return -1;
|
||||
if (!g_out[slot].rot && !(g_out[slot].rot = make_pipe(g_out[slot].rp, g_rot_vert, 0))) return -1;
|
||||
VkDescriptorSet ds = src_ensure(src, src_fmt, VK_IMAGE_LAYOUT_GENERAL);
|
||||
if (!ds) return -1;
|
||||
VkFramebuffer fb = dst_ensure(dst, dst_fmt, dst_w, dst_h, g_out[slot].rp);
|
||||
if (!fb) return -1;
|
||||
struct pc_blend pc = {.dst = {-1.0f, -1.0f, 1.0f, 1.0f}};
|
||||
if (degrees == 90) { pc.src[0] = 0.0f; pc.src[1] = 1.0f; pc.src[2] = 1.0f; pc.src[3] = 0.0f; }
|
||||
else { pc.src[0] = 1.0f; pc.src[1] = 0.0f; pc.src[2] = 0.0f; pc.src[3] = 1.0f; }
|
||||
VkRenderPassBeginInfo rpi = {.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, .renderPass = g_out[slot].rp,
|
||||
.framebuffer = fb, .renderArea = {{0, 0}, {(uint32_t)dst_w, (uint32_t)dst_h}}};
|
||||
VkViewport vp = {0, 0, (float)dst_w, (float)dst_h, 0, 1};
|
||||
g_vk.CmdBeginRenderPass(cmd, &rpi, VK_SUBPASS_CONTENTS_INLINE);
|
||||
g_vk.CmdSetViewport(cmd, 0, 1, &vp);
|
||||
g_vk.CmdSetScissor(cmd, 0, 1, &rpi.renderArea);
|
||||
g_vk.CmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, g_out[slot].rot);
|
||||
g_vk.CmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, g_pl, 0, 1, &ds, 0, NULL);
|
||||
g_vk.CmdPushConstants(cmd, g_pl, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(pc), &pc);
|
||||
g_vk.CmdDraw(cmd, 4, 1, 0, 0);
|
||||
g_vk.CmdEndRenderPass(cmd);
|
||||
return 0;
|
||||
}
|
||||
@@ -10,4 +10,7 @@ void blendp_begin_frame(void);
|
||||
int blendp_draw(VkCommandBuffer cmd, VkImage src, VkFormat src_fmt, int src_w, int src_h, int src_general,
|
||||
VkImage dst, VkFormat dst_fmt, int dst_w, int dst_h, const VkImageBlit *blit);
|
||||
|
||||
int blendp_rotate(VkCommandBuffer cmd, VkImage src, VkFormat src_fmt, int src_w, int src_h,
|
||||
VkImage dst, VkFormat dst_fmt, int dst_w, int dst_h, int degrees);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
#version 450
|
||||
layout(push_constant) uniform PC { vec4 dst; vec4 src; } pc;
|
||||
layout(location = 0) out vec2 uv;
|
||||
|
||||
void main() {
|
||||
vec2 t = vec2(gl_VertexIndex & 1, gl_VertexIndex >> 1);
|
||||
gl_Position = vec4(mix(pc.dst.xy, pc.dst.zw, t), 0.0, 1.0);
|
||||
uv = mix(pc.src.xy, pc.src.zw, t.yx);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
const uint32_t rotate_vert_code[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x0000003b,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000c,0x0000001b,0x00000031,
|
||||
0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00030005,
|
||||
0x00000009,0x00000074,0x00060005,0x0000000c,0x565f6c67,0x65747265,0x646e4978,0x00007865,
|
||||
0x00060005,0x00000019,0x505f6c67,0x65567265,0x78657472,0x00000000,0x00060006,0x00000019,
|
||||
0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00070006,0x00000019,0x00000001,0x505f6c67,
|
||||
0x746e696f,0x657a6953,0x00000000,0x00070006,0x00000019,0x00000002,0x435f6c67,0x4470696c,
|
||||
0x61747369,0x0065636e,0x00070006,0x00000019,0x00000003,0x435f6c67,0x446c6c75,0x61747369,
|
||||
0x0065636e,0x00030005,0x0000001b,0x00000000,0x00030005,0x0000001d,0x00004350,0x00040006,
|
||||
0x0000001d,0x00000000,0x00747364,0x00040006,0x0000001d,0x00000001,0x00637273,0x00030005,
|
||||
0x0000001f,0x00006370,0x00030005,0x00000031,0x00007675,0x00040047,0x0000000c,0x0000000b,
|
||||
0x0000002a,0x00030047,0x00000019,0x00000002,0x00050048,0x00000019,0x00000000,0x0000000b,
|
||||
0x00000000,0x00050048,0x00000019,0x00000001,0x0000000b,0x00000001,0x00050048,0x00000019,
|
||||
0x00000002,0x0000000b,0x00000003,0x00050048,0x00000019,0x00000003,0x0000000b,0x00000004,
|
||||
0x00030047,0x0000001d,0x00000002,0x00050048,0x0000001d,0x00000000,0x00000023,0x00000000,
|
||||
0x00050048,0x0000001d,0x00000001,0x00000023,0x00000010,0x00040047,0x00000031,0x0000001e,
|
||||
0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,
|
||||
0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,
|
||||
0x00000007,0x00040015,0x0000000a,0x00000020,0x00000001,0x00040020,0x0000000b,0x00000001,
|
||||
0x0000000a,0x0004003b,0x0000000b,0x0000000c,0x00000001,0x0004002b,0x0000000a,0x0000000e,
|
||||
0x00000001,0x00040017,0x00000015,0x00000006,0x00000004,0x00040015,0x00000016,0x00000020,
|
||||
0x00000000,0x0004002b,0x00000016,0x00000017,0x00000001,0x0004001c,0x00000018,0x00000006,
|
||||
0x00000017,0x0006001e,0x00000019,0x00000015,0x00000006,0x00000018,0x00000018,0x00040020,
|
||||
0x0000001a,0x00000003,0x00000019,0x0004003b,0x0000001a,0x0000001b,0x00000003,0x0004002b,
|
||||
0x0000000a,0x0000001c,0x00000000,0x0004001e,0x0000001d,0x00000015,0x00000015,0x00040020,
|
||||
0x0000001e,0x00000009,0x0000001d,0x0004003b,0x0000001e,0x0000001f,0x00000009,0x00040020,
|
||||
0x00000020,0x00000009,0x00000015,0x0004002b,0x00000006,0x00000029,0x00000000,0x0004002b,
|
||||
0x00000006,0x0000002a,0x3f800000,0x00040020,0x0000002e,0x00000003,0x00000015,0x00040020,
|
||||
0x00000030,0x00000003,0x00000007,0x0004003b,0x00000030,0x00000031,0x00000003,0x00050036,
|
||||
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000008,
|
||||
0x00000009,0x00000007,0x0004003d,0x0000000a,0x0000000d,0x0000000c,0x000500c7,0x0000000a,
|
||||
0x0000000f,0x0000000d,0x0000000e,0x0004006f,0x00000006,0x00000010,0x0000000f,0x0004003d,
|
||||
0x0000000a,0x00000011,0x0000000c,0x000500c3,0x0000000a,0x00000012,0x00000011,0x0000000e,
|
||||
0x0004006f,0x00000006,0x00000013,0x00000012,0x00050050,0x00000007,0x00000014,0x00000010,
|
||||
0x00000013,0x0003003e,0x00000009,0x00000014,0x00050041,0x00000020,0x00000021,0x0000001f,
|
||||
0x0000001c,0x0004003d,0x00000015,0x00000022,0x00000021,0x0007004f,0x00000007,0x00000023,
|
||||
0x00000022,0x00000022,0x00000000,0x00000001,0x00050041,0x00000020,0x00000024,0x0000001f,
|
||||
0x0000001c,0x0004003d,0x00000015,0x00000025,0x00000024,0x0007004f,0x00000007,0x00000026,
|
||||
0x00000025,0x00000025,0x00000002,0x00000003,0x0004003d,0x00000007,0x00000027,0x00000009,
|
||||
0x0008000c,0x00000007,0x00000028,0x00000001,0x0000002e,0x00000023,0x00000026,0x00000027,
|
||||
0x00050051,0x00000006,0x0000002b,0x00000028,0x00000000,0x00050051,0x00000006,0x0000002c,
|
||||
0x00000028,0x00000001,0x00070050,0x00000015,0x0000002d,0x0000002b,0x0000002c,0x00000029,
|
||||
0x0000002a,0x00050041,0x0000002e,0x0000002f,0x0000001b,0x0000001c,0x0003003e,0x0000002f,
|
||||
0x0000002d,0x00050041,0x00000020,0x00000032,0x0000001f,0x0000000e,0x0004003d,0x00000015,
|
||||
0x00000033,0x00000032,0x0007004f,0x00000007,0x00000034,0x00000033,0x00000033,0x00000000,
|
||||
0x00000001,0x00050041,0x00000020,0x00000035,0x0000001f,0x0000000e,0x0004003d,0x00000015,
|
||||
0x00000036,0x00000035,0x0007004f,0x00000007,0x00000037,0x00000036,0x00000036,0x00000002,
|
||||
0x00000003,0x0004003d,0x00000007,0x00000038,0x00000009,0x0007004f,0x00000007,0x00000039,
|
||||
0x00000038,0x00000038,0x00000001,0x00000000,0x0008000c,0x00000007,0x0000003a,0x00000001,
|
||||
0x0000002e,0x00000034,0x00000037,0x00000039,0x0003003e,0x00000031,0x0000003a,0x000100fd,
|
||||
0x00010038
|
||||
};
|
||||
@@ -116,7 +116,8 @@ static VkResult timed_wait(VkFence fence, uint64_t timeout) {
|
||||
static struct { VkImage img; VkDeviceMemory mem; int w, h; } g_scene;
|
||||
|
||||
struct vkp_img_slot { VkImage img; VkDeviceMemory mem; int w, h; VkFormat fmt; };
|
||||
static struct vkp_img_slot g_mixed, g_hdrscene, g_fgscene;
|
||||
static struct vkp_img_slot g_mixed, g_hdrscene, g_fgscene, g_land;
|
||||
static int g_prerot, g_prerot_failed;
|
||||
#define HDR_FMT VK_FORMAT_A2B10G10R10_UNORM_PACK32
|
||||
#define FG_HDR_FMT VK_FORMAT_R16G16B16A16_SFLOAT
|
||||
|
||||
@@ -661,6 +662,20 @@ static void log_surface_formats(const VkSurfaceFormatKHR *f, uint32_t n) {
|
||||
hdr_n ? hdr : "none", hdr_cut ? " (+more)" : "");
|
||||
}
|
||||
|
||||
struct vkp_img_slot;
|
||||
static int ensure_img(struct vkp_img_slot *s, int w, int h, VkFormat fmt, VkImageUsageFlags usage, const char *what);
|
||||
|
||||
static int prerotate_degrees(const VkSurfaceCapabilitiesKHR *caps) {
|
||||
if (g_prerot_failed) return 0;
|
||||
char v[PROP_VALUE_MAX] = "";
|
||||
__system_property_get("debug.droiddeck.prerotate", v);
|
||||
if (v[0] == '0') return 0;
|
||||
if (!(caps->supportedTransforms & caps->currentTransform)) return 0;
|
||||
if (caps->currentTransform == VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) return 90;
|
||||
if (caps->currentTransform == VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) return 270;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int swap_init_locked(void) {
|
||||
|
||||
VkAndroidSurfaceCreateInfoKHR aci = {
|
||||
@@ -733,11 +748,18 @@ static int swap_init_locked(void) {
|
||||
VkSurfaceTransformFlagBitsKHR pretrans =
|
||||
(caps.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR)
|
||||
? VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : caps.currentTransform;
|
||||
g_prerot = prerotate_degrees(&caps);
|
||||
VkExtent2D image_extent = g_extent;
|
||||
if (g_prerot) {
|
||||
pretrans = caps.currentTransform;
|
||||
image_extent.width = g_extent.height;
|
||||
image_extent.height = g_extent.width;
|
||||
}
|
||||
|
||||
VkSwapchainCreateInfoKHR sci = {
|
||||
.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, .surface = g_surface,
|
||||
.minImageCount = want, .imageFormat = chosen.format, .imageColorSpace = chosen.colorSpace,
|
||||
.imageExtent = g_extent, .imageArrayLayers = 1,
|
||||
.imageExtent = image_extent, .imageArrayLayers = 1,
|
||||
.imageUsage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
|
||||
.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE, .preTransform = pretrans,
|
||||
.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR,
|
||||
@@ -754,6 +776,17 @@ static int swap_init_locked(void) {
|
||||
g_swap_fmt = sdr_choice.format;
|
||||
cr = g_vk.CreateSwapchainKHR(g_dev, &sci, NULL, &g_swapchain);
|
||||
}
|
||||
if (cr != VK_SUCCESS && g_prerot) {
|
||||
droiddeck_log("gpu", "the driver refused a swapchain turned for the panel (%s): the display rotates the "
|
||||
"picture instead", vk_result_name(cr));
|
||||
g_prerot = 0;
|
||||
g_prerot_failed = 1;
|
||||
g_swapchain = VK_NULL_HANDLE;
|
||||
sci.preTransform = (caps.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR)
|
||||
? VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : caps.currentTransform;
|
||||
sci.imageExtent = g_extent;
|
||||
cr = g_vk.CreateSwapchainKHR(g_dev, &sci, NULL, &g_swapchain);
|
||||
}
|
||||
if (cr != VK_SUCCESS) {
|
||||
g_swapchain = VK_NULL_HANDLE;
|
||||
SWLOGE("present: vkCreateSwapchainKHR failed (%d)", (int)cr);
|
||||
@@ -762,6 +795,18 @@ static int swap_init_locked(void) {
|
||||
g_vk.GetSwapchainImagesKHR(g_dev, g_swapchain, &g_nimg, NULL);
|
||||
g_images = calloc(g_nimg, sizeof(VkImage));
|
||||
g_vk.GetSwapchainImagesKHR(g_dev, g_swapchain, &g_nimg, g_images);
|
||||
if (g_prerot && ensure_img(&g_land, (int)g_extent.width, (int)g_extent.height, g_swap_fmt,
|
||||
VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
|
||||
VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
|
||||
"panel rotation") != 0) {
|
||||
g_prerot_failed = 1;
|
||||
droiddeck_log("gpu", "the panel-rotation image could not be made: the display rotates the picture instead");
|
||||
destroy_swapchain();
|
||||
return -1;
|
||||
}
|
||||
if (g_prerot)
|
||||
droiddeck_log("gpu", "the panel is mounted at %d degrees: frames are turned on the GPU before they are shown, "
|
||||
"so the display hardware can show the game layer directly", g_prerot);
|
||||
|
||||
droiddeck_log("gpu", "screen output %ux%u, %u buffers, vsync%s", g_extent.width, g_extent.height, g_nimg,
|
||||
g_swap_extra ? " (frame generation: several presents per frame)" : "");
|
||||
@@ -1345,6 +1390,53 @@ static const char *vk_result_name(VkResult r) {
|
||||
}
|
||||
|
||||
|
||||
static VkImage out_image(uint32_t img) {
|
||||
return g_prerot ? g_land.img : g_images[img];
|
||||
}
|
||||
|
||||
static void finish_out_image(VkCommandBuffer cmd, uint32_t img) {
|
||||
VkImageSubresourceRange range = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
|
||||
if (!g_prerot) {
|
||||
VkImageMemoryBarrier b_present = {
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||
.newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = g_images[img],
|
||||
.subresourceRange = range, .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT};
|
||||
g_vk.CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
|
||||
0, 0, NULL, 0, NULL, 1, &b_present);
|
||||
return;
|
||||
}
|
||||
VkImageMemoryBarrier pre[2] = {
|
||||
{.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||
.newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = g_land.img, .subresourceRange = range,
|
||||
.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
|
||||
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT},
|
||||
{.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
|
||||
.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = g_images[img], .subresourceRange = range,
|
||||
.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT}};
|
||||
g_vk.CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
|
||||
VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
0, 0, NULL, 0, NULL, 2, pre);
|
||||
VkClearColorValue black = {.float32 = {0.0f, 0.0f, 0.0f, 1.0f}};
|
||||
g_vk.CmdClearColorImage(cmd, g_images[img], VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &black, 1, &range);
|
||||
if (blendp_rotate(cmd, g_land.img, g_swap_fmt, (int)g_extent.width, (int)g_extent.height, g_images[img],
|
||||
g_swap_fmt, (int)g_extent.height, (int)g_extent.width, g_prerot) != 0 && !g_prerot_failed) {
|
||||
g_prerot_failed = 1;
|
||||
droiddeck_log("gpu", "the panel-rotation pass could not be built on this driver: the display rotates the "
|
||||
"picture from the next frame");
|
||||
g_surface_checked_ns = 0;
|
||||
}
|
||||
VkImageMemoryBarrier b_present = {
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||
.newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = g_images[img], .subresourceRange = range,
|
||||
.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT};
|
||||
g_vk.CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
|
||||
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, NULL, 0, NULL, 1, &b_present);
|
||||
}
|
||||
|
||||
static void record_screen_blit(VkCommandBuffer cmd, VkImage src, int src_w, int src_h,
|
||||
int scene_w, int scene_h, uint32_t img, VkFilter filter, int cardboard) {
|
||||
VkImageSubresourceRange range = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
|
||||
@@ -1370,7 +1462,7 @@ static void record_screen_blit(VkCommandBuffer cmd, VkImage src, int src_w, int
|
||||
{.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
|
||||
.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.image = g_images[img], .subresourceRange = range, .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT},
|
||||
.image = out_image(img), .subresourceRange = range, .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT},
|
||||
{.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
@@ -1387,9 +1479,9 @@ static void record_screen_blit(VkCommandBuffer cmd, VkImage src, int src_w, int
|
||||
.srcOffsets = {{0, 0, 0}, {src_w, src_h, 1}},
|
||||
.dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1},
|
||||
.dstOffsets = {{0, 0, 0}, {src_w, src_h, 1}}};
|
||||
if (!have_blit || !record_bars_clear(cmd, g_images[img], &blit)) {
|
||||
if (!have_blit || !record_bars_clear(cmd, out_image(img), &blit)) {
|
||||
VkClearColorValue black = {.float32 = {0.0f, 0.0f, 0.0f, 1.0f}};
|
||||
g_vk.CmdClearColorImage(cmd, g_images[img], VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &black, 1, &range);
|
||||
g_vk.CmdClearColorImage(cmd, out_image(img), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &black, 1, &range);
|
||||
}
|
||||
VkMemoryBarrier mb = {.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER,
|
||||
.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT,
|
||||
@@ -1397,15 +1489,9 @@ static void record_screen_blit(VkCommandBuffer cmd, VkImage src, int src_w, int
|
||||
g_vk.CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT,
|
||||
0, 1, &mb, 0, NULL, 0, NULL);
|
||||
if (have_blit)
|
||||
g_vk.CmdBlitImage(cmd, src, VK_IMAGE_LAYOUT_GENERAL, g_images[img],
|
||||
g_vk.CmdBlitImage(cmd, src, VK_IMAGE_LAYOUT_GENERAL, out_image(img),
|
||||
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &blit, filter);
|
||||
VkImageMemoryBarrier b_present = {
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||
.newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = g_images[img],
|
||||
.subresourceRange = range, .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT};
|
||||
g_vk.CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
|
||||
0, 0, NULL, 0, NULL, 1, &b_present);
|
||||
finish_out_image(cmd, img);
|
||||
}
|
||||
|
||||
static int acquire_image(int k, int first, uint32_t *img, VkResult *ar_out) {
|
||||
@@ -1439,6 +1525,10 @@ int vkp_render_plain(int scene_w, int scene_h) {
|
||||
|
||||
static void check_surface_changed(void) {
|
||||
if (!g_swapchain || !g_surface || g_dev_state != 1) return;
|
||||
if (g_prerot && g_prerot_failed) {
|
||||
destroy_swapchain();
|
||||
return;
|
||||
}
|
||||
const int64_t now = perf_now();
|
||||
if (now - g_surface_checked_ns < 100000000LL) return;
|
||||
g_surface_checked_ns = now;
|
||||
@@ -1612,7 +1702,7 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
|
||||
.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.image = pass ? scene_img : g_images[img], .subresourceRange = range,
|
||||
.image = pass ? scene_img : out_image(img), .subresourceRange = range,
|
||||
.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT};
|
||||
for (int i = 0; i < n; i++) {
|
||||
struct vkp_image *im = draws[i].img;
|
||||
@@ -1636,11 +1726,11 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
||||
}
|
||||
}
|
||||
g_vk.CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_HOST_BIT | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT |
|
||||
(pass ? VK_PIPELINE_STAGE_ALL_COMMANDS_BIT : 0),
|
||||
((pass || g_prerot) ? VK_PIPELINE_STAGE_ALL_COMMANDS_BIT : 0),
|
||||
VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, NULL, 0, NULL, (uint32_t)nb, bars);
|
||||
free(bars);
|
||||
|
||||
VkImage target = pass ? scene_img : g_images[img];
|
||||
VkImage target = pass ? scene_img : out_image(img);
|
||||
int covered = 0;
|
||||
VkImageBlit cover_blit;
|
||||
if (!(hf && pass)) {
|
||||
@@ -1687,13 +1777,7 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
||||
VkImage result = scene_img;
|
||||
int rw = scene_w, rh = scene_h;
|
||||
if (!pass) {
|
||||
VkImageMemoryBarrier b_present = {
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||
.newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = g_images[img],
|
||||
.subresourceRange = range, .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT};
|
||||
g_vk.CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
|
||||
0, 0, NULL, 0, NULL, 1, &b_present);
|
||||
finish_out_image(cmd, img);
|
||||
} else {
|
||||
VkImageLayout result_layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
|
||||
if (fx) {
|
||||
|
||||
@@ -1576,7 +1576,10 @@ class FrontEndActivity : ComponentActivity() {
|
||||
|
||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
||||
super.onWindowFocusChanged(hasFocus)
|
||||
if (hasFocus) applyLauncherFullscreen()
|
||||
if (hasFocus) {
|
||||
com.droiddeck.launcher.ui.DualScreenPanel.yieldTo(taskId, false)
|
||||
applyLauncherFullscreen()
|
||||
}
|
||||
}
|
||||
|
||||
private fun applyLauncherFullscreen() {
|
||||
@@ -1635,7 +1638,7 @@ class FrontEndActivity : ComponentActivity() {
|
||||
|
||||
override fun onPause() {
|
||||
compatLaunchVisible = false
|
||||
if (android.os.Build.VERSION.SDK_INT >= 29) com.droiddeck.launcher.ui.DualScreenPanel.yieldTo(taskId, true)
|
||||
if (android.os.Build.VERSION.SDK_INT >= 29) com.droiddeck.launcher.ui.DualScreenPanel.ownerPaused(taskId, true)
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
@@ -1643,6 +1646,7 @@ class FrontEndActivity : ComponentActivity() {
|
||||
super.onResume()
|
||||
compatLaunchVisible = true
|
||||
com.droiddeck.launcher.ui.DualScreenPanel.yieldTo(taskId, false)
|
||||
com.droiddeck.launcher.ui.DualScreenPanel.ownerPaused(taskId, false)
|
||||
orientation = SessionPrefs.orientation(this)
|
||||
launcherOrientation = com.droiddeck.launcher.core.AppUiPrefs.orientation(this)
|
||||
requestedOrientation = launcherOrientation
|
||||
|
||||
@@ -148,7 +148,15 @@ object HomeApp {
|
||||
}.getOrNull()
|
||||
|
||||
fun startShortcut(context: Context, info: ShortcutInfo) {
|
||||
context.getSystemService(LauncherApps::class.java).startShortcut(info, null, null)
|
||||
val task = generateSequence(context) { (it as? android.content.ContextWrapper)?.baseContext }
|
||||
.filterIsInstance<android.app.Activity>().firstOrNull()?.taskId
|
||||
task?.let { com.droiddeck.launcher.ui.DualScreenPanel.yieldTo(it, true) }
|
||||
try {
|
||||
context.getSystemService(LauncherApps::class.java).startShortcut(info, null, null)
|
||||
} catch (e: Exception) {
|
||||
task?.let { com.droiddeck.launcher.ui.DualScreenPanel.yieldTo(it, false) }
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
fun openAppInfo(context: Context, app: LaunchableApp) {
|
||||
|
||||
@@ -92,8 +92,8 @@ import com.droiddeck.launcher.input.TouchscreenGestures
|
||||
import com.droiddeck.launcher.input.ScrollTouchGestures
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.session.LoadingState
|
||||
import com.droiddeck.launcher.hud.FusionHudConfig
|
||||
import com.droiddeck.launcher.hud.FusionHudHost
|
||||
import com.droiddeck.launcher.hud.DroidDeckHudConfig
|
||||
import com.droiddeck.launcher.hud.DroidDeckHudHost
|
||||
import com.droiddeck.launcher.session.PerfMode
|
||||
import com.droiddeck.launcher.session.SteamRepair
|
||||
import com.droiddeck.launcher.session.GameEnvironmentStore
|
||||
@@ -161,7 +161,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
private lateinit var surfaceView: SurfaceView
|
||||
private lateinit var sessionOverlay: ComposeView
|
||||
private lateinit var loading: LoadingState
|
||||
private lateinit var hud: FusionHudHost
|
||||
private lateinit var hud: DroidDeckHudHost
|
||||
private lateinit var memoryHud: com.droiddeck.launcher.session.MemoryHud
|
||||
private var padBridge: PadBridge? = null
|
||||
private val physicalShortcuts = PhysicalShortcutRouter()
|
||||
@@ -746,8 +746,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
val needProton = protonUser && com.droiddeck.launcher.runtime.DesktopCatalog.protonSeedNeeded(this)
|
||||
if (needRuntime || needResume || needDesktop || needProton) installThenStart(needRuntime, needDesktop, needProton, needResume)
|
||||
}
|
||||
hud = FusionHudHost(this)
|
||||
hud.onConfigChanged = { hudConfig = FusionHudConfig.load(this) }
|
||||
hud = DroidDeckHudHost(this)
|
||||
hud.onConfigChanged = { hudConfig = DroidDeckHudConfig.load(this) }
|
||||
hud.passesTouchAt = ::controlTakesTouchAt
|
||||
hud.attach(root, root.childCount)
|
||||
memoryHud = com.droiddeck.launcher.session.MemoryHud(this)
|
||||
@@ -1180,8 +1180,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
secondScreenDisplays = secondScreenDisplays,
|
||||
selectedSecondScreenDisplay = selectedSecondScreenDisplay,
|
||||
onHud = { on -> SessionPrefs.setHudEnabled(this@SessionActivity, on); hudOn = on; hud.refresh() },
|
||||
onHudSetting = { key, value -> hudConfig = FusionHudConfig.set(this@SessionActivity, key, value); hud.applyConfig() },
|
||||
onHudReset = { hudConfig = FusionHudConfig.reset(this@SessionActivity); hud.applyConfig() },
|
||||
onHudSetting = { key, value -> hudConfig = DroidDeckHudConfig.set(this@SessionActivity, key, value); hud.applyConfig() },
|
||||
onHudReset = { hudConfig = DroidDeckHudConfig.reset(this@SessionActivity); hud.applyConfig() },
|
||||
onHudExport = { exportHudDiagnostics() },
|
||||
onUpscaler = { m ->
|
||||
SessionPrefs.setUpscaler(this@SessionActivity, m); upscaler = m
|
||||
@@ -1821,7 +1821,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
unfoldedControlsWithController = SessionPrefs.unfoldedControlsWithController(this)
|
||||
picturePosition = SessionPrefs.picturePosition(this)
|
||||
hudOn = SessionPrefs.hudEnabled(this)
|
||||
hudConfig = FusionHudConfig.load(this)
|
||||
hudConfig = DroidDeckHudConfig.load(this)
|
||||
hudColor = SessionPrefs.hudColor(this)
|
||||
hudOpacity = SessionPrefs.hudOpacity(this)
|
||||
upscaler = SessionPrefs.upscaler(this)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.droiddeck.launcher.files
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Environment
|
||||
import android.provider.Settings
|
||||
|
||||
object AllFilesAccess {
|
||||
fun missing(sdk: Int = Build.VERSION.SDK_INT, granted: () -> Boolean = { Environment.isExternalStorageManager() }): Boolean =
|
||||
sdk >= Build.VERSION_CODES.R && !granted()
|
||||
|
||||
fun open(context: Context) {
|
||||
val app = Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, Uri.parse("package:" + context.packageName))
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
runCatching { context.startActivity(app) }.recoverCatching {
|
||||
context.startActivity(Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -498,6 +498,25 @@ fun FileManagerScreen(
|
||||
onDispose { lifecycleOwner.lifecycle.removeObserver(observer) }
|
||||
}
|
||||
val drives = remember(storageTick) { StorageRoots.list(context) }
|
||||
var accessDrive by remember { mutableStateOf<String?>(null) }
|
||||
fun unreadable(drive: StorageRoot) {
|
||||
if (AllFilesAccess.missing()) accessDrive = drive.label
|
||||
else Toast.makeText(context, context.getString(R.string.fm_drive_not_readable, drive.label), Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
accessDrive?.let { label ->
|
||||
OutlinedAlertDialog(
|
||||
onDismissRequest = { accessDrive = null },
|
||||
title = { Text(stringResource(R.string.fm_drive_access_title, label)) },
|
||||
text = { Text(stringResource(R.string.fm_drive_access_text)) },
|
||||
confirmButton = {
|
||||
TextButton(onClick = {
|
||||
accessDrive = null
|
||||
AllFilesAccess.open(context)
|
||||
}, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.upd_open_settings)) }
|
||||
},
|
||||
dismissButton = { TextButton(onClick = { accessDrive = null }, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.common_cancel)) } },
|
||||
)
|
||||
}
|
||||
val linuxRoot = remember(storageTick) {
|
||||
com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context).takeIf { File(it, "usr").isDirectory }
|
||||
}
|
||||
@@ -747,11 +766,7 @@ fun FileManagerScreen(
|
||||
if (drive.readable) {
|
||||
openDrive(drive.dir)
|
||||
} else {
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.fm_drive_not_readable, drive.label),
|
||||
Toast.LENGTH_SHORT,
|
||||
).show()
|
||||
unreadable(drive)
|
||||
}
|
||||
},
|
||||
modifier = Modifier.focusGlide(),
|
||||
@@ -1072,7 +1087,7 @@ fun FileManagerScreen(
|
||||
add(locItem(stringResource(R.string.fm_drive_internal), Icons.Filled.Smartphone, File("/storage/emulated/0")))
|
||||
drives.filter { it.removable }.forEach { d ->
|
||||
add(RailItem(d.label, Icons.Filled.SdStorage, !showFavorites && currentRoot.absolutePath == d.dir.absolutePath) {
|
||||
showFavorites = false; if (d.readable) openDrive(d.dir)
|
||||
showFavorites = false; if (d.readable) openDrive(d.dir) else unreadable(d)
|
||||
})
|
||||
}
|
||||
linuxRoot?.let { add(locItem(stringResource(R.string.fm_drive_linux), Icons.Filled.Terminal, it)) }
|
||||
|
||||
+7
-7
@@ -3,14 +3,14 @@ package com.droiddeck.launcher.hud
|
||||
import android.content.Context
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
|
||||
/** FusionHUD's settings as one "key=value,…" string (FusionHudView.applyConfig), stored in SessionPrefs. */
|
||||
internal object FusionHudConfig {
|
||||
/** DroidDeck HUD's settings as one "key=value,…" string (DroidDeckHudView.applyConfig), stored in SessionPrefs. */
|
||||
internal object DroidDeckHudConfig {
|
||||
/**
|
||||
* Bannerlator's Fusion defaults (DeckOverlaySettings), with the FPS graph from the old DroidDeck HUD. The HUD starts
|
||||
* Bannerlator's defaults (DeckOverlaySettings), with the FPS graph from the old DroidDeck HUD. The HUD starts
|
||||
* locked, so like the old HUD it lets touches through until it is unlocked to move it.
|
||||
*/
|
||||
val DEFAULTS: Map<String, String> = linkedMapOf(
|
||||
"hudSize" to "minimal", "hudLocked" to "1", "hudScale" to "100", "hudOpacity" to "80", "hudColor" to "mid",
|
||||
"hudSize" to "minimal", "hudLocked" to "1", "hudScale" to "100", "hudDock" to "none", "hudOpacity" to "80", "hudColor" to "mid",
|
||||
"hudOutline" to "40", "hudOutlineAccent" to "1",
|
||||
"showFPS" to "1", "showFPSGraph" to "1", "showCPUUsage" to "1", "showCPULoad" to "1", "showGPULoad" to "1",
|
||||
"showVram" to "1", "showRAM" to "1", "showPower" to "1", "showTemp" to "1", "showBatteryTemp" to "1",
|
||||
@@ -25,7 +25,7 @@ internal object FusionHudConfig {
|
||||
|
||||
fun load(context: Context): MutableMap<String, String> {
|
||||
val values = LinkedHashMap(DEFAULTS)
|
||||
val stored = SessionPrefs.fusionHudConfig(context)
|
||||
val stored = SessionPrefs.droidDeckHudConfig(context)
|
||||
if (stored == null) {
|
||||
values["showFPS"] = flag(SessionPrefs.hudShowFps(context))
|
||||
values["showFPSGraph"] = flag(SessionPrefs.hudShowGraph(context))
|
||||
@@ -43,12 +43,12 @@ internal object FusionHudConfig {
|
||||
if (key !in DEFAULTS) return values
|
||||
values[key] = value
|
||||
TWINS[key]?.let { values[it] = value }
|
||||
SessionPrefs.setFusionHudConfig(context, encode(values))
|
||||
SessionPrefs.setDroidDeckHudConfig(context, encode(values))
|
||||
return values
|
||||
}
|
||||
|
||||
fun reset(context: Context): Map<String, String> {
|
||||
SessionPrefs.setFusionHudConfig(context, encode(DEFAULTS))
|
||||
SessionPrefs.setDroidDeckHudConfig(context, encode(DEFAULTS))
|
||||
return DEFAULTS
|
||||
}
|
||||
|
||||
+132
-14
@@ -6,26 +6,28 @@ import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.Choreographer
|
||||
import android.view.View
|
||||
import android.view.animation.PathInterpolator
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import com.droiddeck.launcher.gpu.FrameGen
|
||||
import com.droiddeck.launcher.gpu.GpuInfo
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.ui.Motion
|
||||
import com.droiddeck.launcher.wayland.WaylandCompositor
|
||||
import java.io.File
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
* FusionHUD on the session screen, in place of the old text HUD: the view, the frame feed from gamescope
|
||||
* DroidDeck HUD on the session screen, in place of the old text HUD: the view, the frame feed from gamescope
|
||||
* (MangoHud's frame times) and MangoHud's readings, started with the session's first frame.
|
||||
*/
|
||||
class FusionHudHost(context: Context) {
|
||||
class DroidDeckHudHost(context: Context) {
|
||||
private val context = context.applicationContext
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
private val feed = GameFrameFeed(File(LinuxRuntime.rootDir(this.context), HudFrames.PATH))
|
||||
private val readings = MangoReadings(File(this.context.filesDir, "session"), LinuxRuntime.rootDir(this.context))
|
||||
private var view: FusionHudView? = null
|
||||
private var view: DroidDeckHudView? = null
|
||||
private var parent: ViewGroup? = null
|
||||
private var running = false
|
||||
private var hidden = false
|
||||
@@ -49,7 +51,7 @@ class FusionHudHost(context: Context) {
|
||||
|
||||
private val listener = object : WaylandCompositor.GameListener {
|
||||
override fun onGameSurface(window: String?, gpuName: String?) {
|
||||
if (!gpuName.isNullOrBlank()) handler.post { this@FusionHudHost.gpuName = cleanGpuName(gpuName) }
|
||||
if (!gpuName.isNullOrBlank()) handler.post { this@DroidDeckHudHost.gpuName = cleanGpuName(gpuName) }
|
||||
if (window != null && window != lastWindow) {
|
||||
lastWindow = window
|
||||
handler.post { onPresentingWindowChanged?.invoke() }
|
||||
@@ -76,20 +78,26 @@ class FusionHudHost(context: Context) {
|
||||
/** Adds the HUD to [root] at [index] (above the game surface, under the session overlay). */
|
||||
fun attach(root: FrameLayout, index: Int) {
|
||||
if (view != null) return
|
||||
val hud = FusionHudView(root.context)
|
||||
val hud = DroidDeckHudView(root.context)
|
||||
hud.setFrameStats(feed.stats)
|
||||
hud.setMangoReadings(readings)
|
||||
hud.setGpuModel(cleanGpuName(GpuInfo.detect().displayName(context)))
|
||||
hud.onRefresh = Runnable { refreshLabels(hud) }
|
||||
hud.setOnMovedListener { x, y ->
|
||||
wantX = x; wantY = y
|
||||
dockEdgeFor(hud)?.let { edge -> setDock(hud, edge); return@setOnMovedListener }
|
||||
keepOnScreen(hud)
|
||||
wantX = hud.x; wantY = hud.y
|
||||
SessionPrefs.setFusionHudPosition(context, hud.x, hud.y)
|
||||
SessionPrefs.setDroidDeckHudPosition(context, hud.x, hud.y)
|
||||
}
|
||||
hud.setOnSizeCycledListener { size -> DroidDeckHudConfig.set(context, "hudSize", size); onConfigChanged?.invoke() }
|
||||
hud.setOnDockChangedListener { token -> setDock(hud, DroidDeckHudDock.from(token)) }
|
||||
hud.setOnScaledListener { percent ->
|
||||
DroidDeckHudConfig.set(context, "hudScale", percent.toString())
|
||||
onConfigChanged?.invoke()
|
||||
}
|
||||
hud.setOnSizeCycledListener { size -> FusionHudConfig.set(context, "hudSize", size); onConfigChanged?.invoke() }
|
||||
hud.setOnLockChangedListener { locked ->
|
||||
FusionHudConfig.set(context, "hudLocked", if (locked) "1" else "0")
|
||||
DroidDeckHudConfig.set(context, "hudLocked", if (locked) "1" else "0")
|
||||
onConfigChanged?.invoke()
|
||||
}
|
||||
hud.addOnLayoutChangeListener { _, _, _, _, _, _, _, _, _ -> if (!hud.isDragging) keepOnScreen(hud) }
|
||||
@@ -100,14 +108,14 @@ class FusionHudHost(context: Context) {
|
||||
leftMargin = margin
|
||||
topMargin = margin
|
||||
})
|
||||
SessionPrefs.fusionHudPosition(context)?.let { (x, y) -> wantX = x; wantY = y; hud.post { keepOnScreen(hud) } }
|
||||
SessionPrefs.droidDeckHudPosition(context)?.let { (x, y) -> wantX = x; wantY = y; hud.post { keepOnScreen(hud) } }
|
||||
view = hud
|
||||
parent = root
|
||||
applyConfig()
|
||||
}
|
||||
|
||||
fun applyConfig() {
|
||||
view?.applyConfig(FusionHudConfig.encode(FusionHudConfig.load(context)))
|
||||
view?.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.load(context)))
|
||||
}
|
||||
|
||||
fun refresh() {
|
||||
@@ -157,7 +165,7 @@ class FusionHudHost(context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
/** A sensor report (FusionHUD's diagnostics) in Downloads/DroidDeck; null when it can't be written. */
|
||||
/** A sensor report (DroidDeck HUD's diagnostics) in Downloads/DroidDeck; null when it can't be written. */
|
||||
fun exportDiagnostics(): File? = runCatching {
|
||||
val dir = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "DroidDeck")
|
||||
dir.mkdirs()
|
||||
@@ -180,7 +188,7 @@ class FusionHudHost(context: Context) {
|
||||
file
|
||||
}.getOrNull()
|
||||
|
||||
private fun refreshLabels(hud: FusionHudView) {
|
||||
private fun refreshLabels(hud: DroidDeckHudView) {
|
||||
if (feed.engine.isNotBlank() && !feed.steamFocused) engine = feed.engine
|
||||
hud.setEngineLabel(engine)
|
||||
if (gpuName.isNotBlank()) hud.setGpuModel(gpuName)
|
||||
@@ -203,6 +211,105 @@ class FusionHudHost(context: Context) {
|
||||
return if (stats.size > 3 && stats[3] > 1f) stats[3] else 0f
|
||||
}
|
||||
|
||||
/** The edge the HUD was dropped over, once a good part of it hangs past that edge; null when it stays. */
|
||||
private fun dockEdgeFor(v: View): DroidDeckHudDock? {
|
||||
val p = v.parent as? View ?: return null
|
||||
if (p.width <= 0 || p.height <= 0 || v.width <= 0 || v.height <= 0) return null
|
||||
val over = mapOf(
|
||||
DroidDeckHudDock.LEFT to -v.x / v.width,
|
||||
DroidDeckHudDock.RIGHT to (v.x + v.width - p.width) / v.width,
|
||||
DroidDeckHudDock.TOP to -v.y / v.height,
|
||||
DroidDeckHudDock.BOTTOM to (v.y + v.height - p.height) / v.height,
|
||||
).maxByOrNull { it.value } ?: return null
|
||||
return over.key.takeIf { over.value >= DOCK_OVERHANG }
|
||||
}
|
||||
|
||||
/** Tucks the HUD against [edge] as its FPS tab, or with [DroidDeckHudDock.NONE] brings it back out from where it was docked. */
|
||||
private fun setDock(hud: DroidDeckHudView, edge: DroidDeckHudDock) {
|
||||
if (edge == hud.dock) return
|
||||
animateDock(hud, edge) { commitDock(hud, edge) }
|
||||
}
|
||||
|
||||
private fun commitDock(hud: DroidDeckHudView, edge: DroidDeckHudDock) {
|
||||
if (edge == DroidDeckHudDock.NONE) {
|
||||
when (hud.dock) {
|
||||
DroidDeckHudDock.LEFT -> wantX = 0f
|
||||
DroidDeckHudDock.RIGHT -> wantX = Float.MAX_VALUE
|
||||
DroidDeckHudDock.TOP -> wantY = 0f
|
||||
DroidDeckHudDock.BOTTOM -> wantY = Float.MAX_VALUE
|
||||
DroidDeckHudDock.NONE -> {}
|
||||
}
|
||||
} else {
|
||||
val p = hud.parent as? View
|
||||
if (p != null) {
|
||||
wantX = wantX.coerceIn(0f, p.width.toFloat())
|
||||
wantY = wantY.coerceIn(0f, p.height.toFloat())
|
||||
}
|
||||
SessionPrefs.setDroidDeckHudPosition(context, wantX, wantY)
|
||||
}
|
||||
DroidDeckHudConfig.set(context, "hudDock", edge.token)
|
||||
applyConfig()
|
||||
hud.post { keepOnScreen(hud) }
|
||||
onConfigChanged?.invoke()
|
||||
}
|
||||
|
||||
/**
|
||||
* One shape contracts into the tab, and the tab expands back out to the HUD: the view is scaled onto the
|
||||
* tab's exact rectangle, and the layouts swap at that same size and place. Timing and curve are the
|
||||
* launcher's own ([Motion]), and off when animations are off.
|
||||
*/
|
||||
private fun animateDock(hud: DroidDeckHudView, edge: DroidDeckHudDock, commit: () -> Unit) {
|
||||
hud.animate().cancel()
|
||||
hud.scaleX = 1f; hud.scaleY = 1f; hud.alpha = 1f
|
||||
val p = hud.parent as? View
|
||||
if (Motion.scale == 0f || p == null || !hud.isLaidOut || hud.width <= 0) { commit(); return }
|
||||
if (edge != DroidDeckHudDock.NONE) {
|
||||
val (tabW, tabH) = hud.dockTabSize()
|
||||
val (tabX, tabY) = settled(p, edge, tabW, tabH)
|
||||
val sx = tabW / hud.width; val sy = tabH / hud.height
|
||||
hud.pivotX = pivotFor(hud.x, tabX, sx) - hud.x
|
||||
hud.pivotY = pivotFor(hud.y, tabY, sy) - hud.y
|
||||
hud.animate().scaleX(sx).scaleY(sy).setDuration(Motion.ms(300).toLong()).setInterpolator(EASE)
|
||||
.withEndAction {
|
||||
commit()
|
||||
hud.scaleX = 1f; hud.scaleY = 1f
|
||||
hud.x = tabX; hud.y = tabY
|
||||
hud.alpha = 0.5f
|
||||
hud.animate().alpha(1f).setDuration(Motion.ms(120).toLong()).start()
|
||||
}.start()
|
||||
} else {
|
||||
val tabX = hud.x; val tabY = hud.y
|
||||
val tabW = hud.width.toFloat(); val tabH = hud.height.toFloat()
|
||||
commit()
|
||||
val w = hud.contentWidth; val h = hud.contentHeight
|
||||
val (x, y) = settled(p, DroidDeckHudDock.NONE, w, h)
|
||||
hud.x = x; hud.y = y
|
||||
val sx = tabW / w; val sy = tabH / h
|
||||
hud.pivotX = pivotFor(x, tabX, sx) - x
|
||||
hud.pivotY = pivotFor(y, tabY, sy) - y
|
||||
hud.scaleX = sx; hud.scaleY = sy
|
||||
hud.animate().scaleX(1f).scaleY(1f).setDuration(Motion.ms(360).toLong()).setInterpolator(EASE).start()
|
||||
}
|
||||
}
|
||||
|
||||
/** The pivot, in parent coordinates, that scaling by [scale] takes a span starting at [from] onto one starting at [to]. */
|
||||
private fun pivotFor(from: Float, to: Float, scale: Float): Float =
|
||||
if (scale > 0.999f) from else (to - from * scale) / (1f - scale)
|
||||
|
||||
/** Where a [w] x [h] HUD or tab sits once [keepOnScreen] has settled it against [dock]. */
|
||||
private fun settled(p: View, dock: DroidDeckHudDock, w: Float, h: Float): Pair<Float, Float> {
|
||||
val maxX = (p.width - w).coerceAtLeast(0f); val maxY = (p.height - h).coerceAtLeast(0f)
|
||||
var x = wantX.coerceIn(0f, maxX); var y = wantY.coerceIn(0f, maxY)
|
||||
when (dock) {
|
||||
DroidDeckHudDock.LEFT -> x = 0f
|
||||
DroidDeckHudDock.RIGHT -> x = maxX
|
||||
DroidDeckHudDock.TOP -> y = 0f
|
||||
DroidDeckHudDock.BOTTOM -> y = maxY
|
||||
DroidDeckHudDock.NONE -> {}
|
||||
}
|
||||
return Pair(x, y)
|
||||
}
|
||||
|
||||
// The HUD is clamped from where the user left it (wantX/wantY, set on a drop or restore), not from where
|
||||
// it is drawn: a window that shrinks and grows back (picture-in-picture, a fold) must not leave it in the
|
||||
// corner the small window pushed it to.
|
||||
@@ -212,13 +319,24 @@ class FusionHudHost(context: Context) {
|
||||
if (wantX.isNaN()) { wantX = v.x; wantY = v.y }
|
||||
val maxX = (p.width - v.width).toFloat().coerceAtLeast(0f)
|
||||
val maxY = (p.height - v.height).toFloat().coerceAtLeast(0f)
|
||||
val x = wantX.coerceIn(0f, maxX)
|
||||
val y = wantY.coerceIn(0f, maxY)
|
||||
var x = wantX.coerceIn(0f, maxX)
|
||||
var y = wantY.coerceIn(0f, maxY)
|
||||
when (v.let { it as? DroidDeckHudView }?.dock) {
|
||||
DroidDeckHudDock.LEFT -> x = 0f
|
||||
DroidDeckHudDock.RIGHT -> x = maxX
|
||||
DroidDeckHudDock.TOP -> y = 0f
|
||||
DroidDeckHudDock.BOTTOM -> y = maxY
|
||||
else -> {}
|
||||
}
|
||||
if (v.x != x) v.x = x
|
||||
if (v.y != y) v.y = y
|
||||
}
|
||||
|
||||
companion object {
|
||||
/** How much of the HUD, as a share of its own size, must hang past a screen edge for it to dock there. */
|
||||
private const val DOCK_OVERHANG = 0.4f
|
||||
private val EASE = PathInterpolator(0.2f, 0.8f, 0.2f, 1f)
|
||||
|
||||
/** True while the HUD is on screen; DroidDeck keeps sampling VRAM for it (GpuMemComponent). */
|
||||
@Volatile @JvmStatic var showing = false
|
||||
private set
|
||||
+16
-7
@@ -14,11 +14,11 @@
|
||||
package com.droiddeck.launcher.hud
|
||||
|
||||
/**
|
||||
* Size modes for the Fusion HUD (the 4th selectable in-game overlay style). One shared color-coded
|
||||
* Size modes for the DroidDeck HUD (the 4th selectable in-game overlay style). One shared color-coded
|
||||
* visual language, four amounts of detail — see the approved mockup. The config value is the lower-case
|
||||
* token stored under the `hudSize` key; the label is the user-facing string.
|
||||
*/
|
||||
enum class FusionSize(val token: String, val label: String) {
|
||||
enum class DroidDeckHudSize(val token: String, val label: String) {
|
||||
FULL("full", "Full"),
|
||||
TILES("tiles", "Tiles"),
|
||||
PILL("pill", "Pill"),
|
||||
@@ -26,7 +26,7 @@ enum class FusionSize(val token: String, val label: String) {
|
||||
MEGA("mega", "Mega");
|
||||
|
||||
/** Next size in the tap-cycle: Full → Tiles → Pill → Minimal → Mega → Full. */
|
||||
fun next(): FusionSize {
|
||||
fun next(): DroidDeckHudSize {
|
||||
val all = values()
|
||||
return all[(ordinal + 1) % all.size]
|
||||
}
|
||||
@@ -45,7 +45,7 @@ enum class FusionSize(val token: String, val label: String) {
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun from(token: String?): FusionSize =
|
||||
fun from(token: String?): DroidDeckHudSize =
|
||||
values().firstOrNull { it.token.equals(token, ignoreCase = true) } ?: FULL
|
||||
|
||||
// Chip-label ids (must match the labels the config UIs build). "Clock" is a small subtle
|
||||
@@ -66,12 +66,21 @@ enum class FusionSize(val token: String, val label: String) {
|
||||
}
|
||||
}
|
||||
|
||||
/** The screen edge the HUD is tucked against, where only its FPS tab shows ([NONE] = floating free). */
|
||||
enum class DroidDeckHudDock(val token: String) {
|
||||
NONE("none"), LEFT("left"), RIGHT("right"), TOP("top"), BOTTOM("bottom");
|
||||
|
||||
companion object {
|
||||
fun from(token: String?): DroidDeckHudDock = values().firstOrNull { it.token == token } ?: NONE
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The Wayland HDR state the Fusion HUD shows on its own line, directly under the latency · display-server
|
||||
* line (the host sets it with [FusionHudView.setHdrState]). [NONE] = no line at all: every session whose
|
||||
* The Wayland HDR state the DroidDeck HUD shows on its own line, directly under the latency · display-server
|
||||
* line (the host sets it with [DroidDeckHudView.setHdrState]). [NONE] = no line at all: every session whose
|
||||
* HDR gate is closed (X11, SDR screens, HDR off) keeps the HUD exactly as it was.
|
||||
*/
|
||||
object FusionHdr {
|
||||
object DroidDeckHudHdr {
|
||||
const val NONE = 0
|
||||
const val ON = 1 // HDR frames on screen with HDR headroom
|
||||
const val NO_HEADROOM = 2 // HDR frames on screen, but the display gives them no headroom (5 s+)
|
||||
+127
-46
@@ -23,6 +23,7 @@ import android.graphics.Path
|
||||
import android.graphics.RectF
|
||||
import android.graphics.Typeface
|
||||
import android.text.format.DateFormat
|
||||
import android.view.GestureDetector
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import androidx.annotation.VisibleForTesting
|
||||
@@ -32,6 +33,7 @@ import java.util.Date
|
||||
import java.util.Locale
|
||||
import java.util.function.BiConsumer
|
||||
import java.util.function.Consumer
|
||||
import java.util.function.IntConsumer
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
import kotlin.math.roundToInt
|
||||
@@ -47,7 +49,7 @@ import kotlinx.coroutines.withContext
|
||||
import kotlinx.coroutines.withTimeoutOrNull
|
||||
|
||||
/**
|
||||
* Fusion HUD — the 4th selectable in-game overlay. One color-coded visual language rendered at four
|
||||
* DroidDeck HUD — the 4th selectable in-game overlay. One color-coded visual language rendered at four
|
||||
* SIZE modes (Full / Tiles / Pill / Minimal / Mega), all driven by [FrameStats] (gamescope's frame times
|
||||
* read by MangoHud's rules) + a single cached [HudMetrics.Snapshot]. Pure Canvas drawing.
|
||||
*
|
||||
@@ -60,7 +62,7 @@ import kotlinx.coroutines.withTimeoutOrNull
|
||||
* drag are frozen while locked. A locked HUD lets a touch through where an on-screen control under it
|
||||
* takes it ([passesTouchAt]); everywhere else it keeps the touch, so a long press there unlocks it.
|
||||
*/
|
||||
class FusionHudView(context: Context) : View(context) {
|
||||
class DroidDeckHudView(context: Context) : View(context) {
|
||||
|
||||
private var frames: FrameStats? = null
|
||||
internal fun setFrameStats(stats: FrameStats?) { frames = stats }
|
||||
@@ -78,7 +80,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
private val density = resources.displayMetrics.density
|
||||
|
||||
// ---- Config -----------------------------------------------------------
|
||||
private var size = FusionSize.FULL
|
||||
private var size = DroidDeckHudSize.FULL
|
||||
private var scale = 1f
|
||||
private var bgOpacity = 0.8f
|
||||
private var outlineIntensity = 0.4f
|
||||
@@ -114,7 +116,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
|
||||
private var engineLabel = ""
|
||||
private var displayServer = "" // "X11" / "Wayland": which display server the game runs on
|
||||
private var hdrState = FusionHdr.NONE // Wayland HDR, on its own line under latency · display server
|
||||
private var hdrState = DroidDeckHudHdr.NONE // Wayland HDR, on its own line under latency · display server
|
||||
private var gpuModel = ""
|
||||
// The GPU name a Wayland session reports to games instead of the real adapter ("" = none). It has
|
||||
// to travel separately from gpuModel: Wayland hands the spoof to DXVK and leaves the Vulkan device
|
||||
@@ -146,7 +148,13 @@ class FusionHudView(context: Context) : View(context) {
|
||||
private var headerMark: RectF? = null
|
||||
private var chipRect: RectF? = null
|
||||
|
||||
// Every size sits in the DroidDeck mark's D: a straight left side split by the orb, round on the
|
||||
// Pushed past a screen edge, the HUD shrinks to a tab with the FPS that stays at that edge.
|
||||
var dock = DroidDeckHudDock.NONE
|
||||
private set
|
||||
private var tabRect: RectF? = null
|
||||
private val tabPath = Path()
|
||||
|
||||
// Every size sits in the DroidDeck mark's D: a straight left side, round on the
|
||||
// right. Its fixed layers (fill, header band, watermark, glowing outline) go into a bitmap, because
|
||||
// Android before 9 skips glow on shapes drawn with hardware acceleration.
|
||||
private var dPanel: RectF? = null
|
||||
@@ -213,11 +221,41 @@ class FusionHudView(context: Context) : View(context) {
|
||||
fun setOnMovedListener(l: BiConsumer<Float, Float>?) { onMovedListener = l }
|
||||
fun setOnSizeCycledListener(l: Consumer<String>?) { onSizeCycledListener = l }
|
||||
fun setOnLockChangedListener(l: Consumer<Boolean>?) { onLockChangedListener = l }
|
||||
private var onDockChangedListener: Consumer<String>? = null
|
||||
private var onScaledListener: IntConsumer? = null
|
||||
fun setOnDockChangedListener(l: Consumer<String>?) { onDockChangedListener = l }
|
||||
/** A pinch settled on this size, in percent. */
|
||||
fun setOnScaledListener(l: IntConsumer?) { onScaledListener = l }
|
||||
|
||||
private val lockController = HudLockController(context, this, object : HudLockController.Callbacks {
|
||||
override fun onTap() { cycleSize() }
|
||||
override fun onMoved(x: Float, y: Float) { onMovedListener?.accept(x, y) }
|
||||
override fun onLockChanged(locked: Boolean) { onLockChangedListener?.accept(locked) }
|
||||
override fun onPinch(factor: Float) {
|
||||
val next = (scale * factor).coerceIn(MIN_SCALE, MAX_SCALE)
|
||||
if (next == scale) return
|
||||
scale = next
|
||||
rebuildAndInvalidate()
|
||||
}
|
||||
override fun onPinchEnd() { onScaledListener?.accept((scale * 100f).roundToInt()) }
|
||||
})
|
||||
|
||||
// A docked tab always takes touches, locked or not: a tap or a pull away from the edge brings the HUD back.
|
||||
private val dockDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() {
|
||||
override fun onDown(e: MotionEvent): Boolean = true
|
||||
override fun onSingleTapUp(e: MotionEvent): Boolean { onDockChangedListener?.accept(DroidDeckHudDock.NONE.token); return true }
|
||||
override fun onScroll(e1: MotionEvent?, e2: MotionEvent, distanceX: Float, distanceY: Float): Boolean {
|
||||
if (e1 == null) return false
|
||||
val inward = when (dock) {
|
||||
DroidDeckHudDock.LEFT -> e2.rawX - e1.rawX
|
||||
DroidDeckHudDock.RIGHT -> e1.rawX - e2.rawX
|
||||
DroidDeckHudDock.TOP -> e2.rawY - e1.rawY
|
||||
DroidDeckHudDock.BOTTOM -> e1.rawY - e2.rawY
|
||||
DroidDeckHudDock.NONE -> 0f
|
||||
}
|
||||
if (inward > 12f * density) onDockChangedListener?.accept(DroidDeckHudDock.NONE.token)
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
// ---- Public surface (symmetric with the other overlays) ---------------
|
||||
@@ -227,9 +265,9 @@ class FusionHudView(context: Context) : View(context) {
|
||||
* in place of the real model, marked so it can't be read as the chip that is really rendering. */
|
||||
fun setGpuSpoofName(s: String?) { gpuSpoofName = s ?: ""; post { rebuildAndInvalidate() } }
|
||||
fun setDisplayServer(s: String?) { displayServer = s ?: ""; post { rebuildAndInvalidate() } }
|
||||
/** [FusionHdr] code; [FusionHdr.NONE] (the default) draws no HDR line anywhere. Any thread. */
|
||||
/** [DroidDeckHudHdr] code; [DroidDeckHudHdr.NONE] (the default) draws no HDR line anywhere. Any thread. */
|
||||
fun setHdrState(state: Int) {
|
||||
val v = if (state in FusionHdr.ON..FusionHdr.NOT_ON_THIS_SCREEN) state else FusionHdr.NONE
|
||||
val v = if (state in DroidDeckHudHdr.ON..DroidDeckHudHdr.NOT_ON_THIS_SCREEN) state else DroidDeckHudHdr.NONE
|
||||
post { if (v != hdrState) { hdrState = v; rebuildAndInvalidate() } }
|
||||
}
|
||||
fun setWineVersion(s: String?) { if ((s ?: "") != wineVersion) { wineVersion = s ?: ""; post { rebuildAndInvalidate() } } }
|
||||
@@ -255,7 +293,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
if (graphRect != null) invalidate()
|
||||
}
|
||||
|
||||
/** Fusion has no orientation (tap cycles size instead); kept for a symmetric host surface. */
|
||||
/** The HUD has no orientation (tap cycles size instead); kept for a symmetric host surface. */
|
||||
fun setVertical(vertical: Boolean) { /* no-op */ }
|
||||
fun isVertical(): Boolean = false
|
||||
|
||||
@@ -269,7 +307,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
if (configString.isNullOrEmpty()) return
|
||||
val cfg = KeyValueSet(configString)
|
||||
|
||||
size = FusionSize.from(cfg.get("hudSize", "minimal"))
|
||||
size = DroidDeckHudSize.from(cfg.get("hudSize", "minimal"))
|
||||
showFPS = cfg.get("showFPS", "1") == "1"
|
||||
showEngine = cfg.get("showEngine", "1") == "1"
|
||||
showGpuModel = cfg.get("showGpuModel", "1") == "1"
|
||||
@@ -285,7 +323,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
showGraph = cfg.get("showFPSGraph", "0") == "1"
|
||||
showLow001 = cfg.get("showLow001", "1") == "1"
|
||||
fpsDecimal = cfg.get("fpsDecimal", "1") == "1"
|
||||
showClockTime = cfg.get("showClock", "1") == "1" // Fusion clock defaults ON
|
||||
showClockTime = cfg.get("showClock", "1") == "1" // the clock defaults ON
|
||||
showPerCore = cfg.get("showPerCore", "1") == "1"
|
||||
showSwap = cfg.get("showSwap", "1") == "1"
|
||||
showNet = cfg.get("showNet", "1") == "1"
|
||||
@@ -296,6 +334,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
showSession = cfg.get("showSession", "1") == "1"
|
||||
tempDisplay = HudMetrics.TempDisplay.from(cfg)
|
||||
lockController.setLocked(cfg.get("hudLocked", "1") == "1")
|
||||
dock = DroidDeckHudDock.from(cfg.get("hudDock", "none"))
|
||||
|
||||
colorIntensity = when (cfg.get("hudColor", "vivid")) {
|
||||
"soft" -> 0.72f; "mid" -> 0.88f; else -> 1.0f
|
||||
@@ -453,27 +492,27 @@ class FusionHudView(context: Context) : View(context) {
|
||||
private fun glowing(spans: List<Span>): List<Span> =
|
||||
spans.mapIndexed { i, s -> if (i == 0) Span(s.text, s.color, s.sizePx, glow = true) else s }
|
||||
|
||||
// ---- Wayland HDR state (one line of its own; nothing at all for FusionHdr.NONE) ----
|
||||
// ---- Wayland HDR state (one line of its own; nothing at all for DroidDeckHudHdr.NONE) ----
|
||||
/** The state as a full line: "HDR", "HDR (no headroom)", "HDR off", "HDR ready", "HDR tone-mapped",
|
||||
* "HDR not on this screen". */
|
||||
private fun hdrLine(px: Float): List<Span> = when (hdrState) {
|
||||
FusionHdr.ON -> listOf(Span("HDR", colHdr, px))
|
||||
FusionHdr.NO_HEADROOM -> listOf(Span("HDR", colHdr, px), Span(" (no headroom)", colBat, px))
|
||||
FusionHdr.OFF -> listOf(Span("HDR off", colDim, px))
|
||||
FusionHdr.READY -> listOf(Span("HDR ready", colDim, px))
|
||||
FusionHdr.TONEMAPPED -> listOf(Span("HDR", colDim, px), Span(" tone-mapped", colBat, px))
|
||||
FusionHdr.NOT_ON_THIS_SCREEN -> listOf(Span("HDR", colDim, px), Span(" not on this screen", colBat, px))
|
||||
DroidDeckHudHdr.ON -> listOf(Span("HDR", colHdr, px))
|
||||
DroidDeckHudHdr.NO_HEADROOM -> listOf(Span("HDR", colHdr, px), Span(" (no headroom)", colBat, px))
|
||||
DroidDeckHudHdr.OFF -> listOf(Span("HDR off", colDim, px))
|
||||
DroidDeckHudHdr.READY -> listOf(Span("HDR ready", colDim, px))
|
||||
DroidDeckHudHdr.TONEMAPPED -> listOf(Span("HDR", colDim, px), Span(" tone-mapped", colBat, px))
|
||||
DroidDeckHudHdr.NOT_ON_THIS_SCREEN -> listOf(Span("HDR", colDim, px), Span(" not on this screen", colBat, px))
|
||||
else -> emptyList()
|
||||
}
|
||||
/** The value after an "HDR" label (Full / Mega): "on", "no headroom", "off", "ready", "tone-mapped",
|
||||
* "not on this screen". */
|
||||
private fun hdrValue(px: Float): List<Span> = when (hdrState) {
|
||||
FusionHdr.ON -> listOf(Span("on", colHdr, px))
|
||||
FusionHdr.NO_HEADROOM -> listOf(Span("no headroom", colBat, px))
|
||||
FusionHdr.OFF -> listOf(Span("off", colDim, px))
|
||||
FusionHdr.READY -> listOf(Span("ready", colDim, px))
|
||||
FusionHdr.TONEMAPPED -> listOf(Span("tone-mapped", colBat, px))
|
||||
FusionHdr.NOT_ON_THIS_SCREEN -> listOf(Span("not on this screen", colBat, px))
|
||||
DroidDeckHudHdr.ON -> listOf(Span("on", colHdr, px))
|
||||
DroidDeckHudHdr.NO_HEADROOM -> listOf(Span("no headroom", colBat, px))
|
||||
DroidDeckHudHdr.OFF -> listOf(Span("off", colDim, px))
|
||||
DroidDeckHudHdr.READY -> listOf(Span("ready", colDim, px))
|
||||
DroidDeckHudHdr.TONEMAPPED -> listOf(Span("tone-mapped", colBat, px))
|
||||
DroidDeckHudHdr.NOT_ON_THIS_SCREEN -> listOf(Span("not on this screen", colBat, px))
|
||||
else -> emptyList()
|
||||
}
|
||||
private fun hdrText(): String = hdrLine(1f).joinToString("") { it.text }
|
||||
@@ -495,26 +534,65 @@ class FusionHudView(context: Context) : View(context) {
|
||||
// ---- Layout builders --------------------------------------------------
|
||||
private fun rebuild() {
|
||||
glyphs.clear(); tileRects.clear(); graphRect = null
|
||||
headerMark = null; chipRect = null; dPanel = null; dDividerTop = -1f
|
||||
headerMark = null; chipRect = null; dPanel = null; dDividerTop = -1f; tabRect = null
|
||||
val s = snap
|
||||
if (s == null) { contentW = 0f; contentH = 0f; return }
|
||||
if (dock != DroidDeckHudDock.NONE) { buildDockTab(); return }
|
||||
when (size) {
|
||||
FusionSize.FULL -> { buildFull(s); intoPanel(sp(10f), header = true) }
|
||||
FusionSize.TILES -> { buildTiles(s); intoPanel(sp(9f), header = true) }
|
||||
FusionSize.PILL -> { buildPill(s); intoPanel(sp(10f), header = false) }
|
||||
FusionSize.MINIMAL -> buildMinimal(s)
|
||||
FusionSize.MEGA -> { buildMega(s); intoPanel(sp(10f), header = true) }
|
||||
DroidDeckHudSize.FULL -> { buildFull(s); intoPanel(sp(10f), header = true) }
|
||||
DroidDeckHudSize.TILES -> { buildTiles(s); intoPanel(sp(9f), header = true) }
|
||||
DroidDeckHudSize.PILL -> { buildPill(s); intoPanel(sp(10f), header = false) }
|
||||
DroidDeckHudSize.MINIMAL -> buildMinimal(s)
|
||||
DroidDeckHudSize.MEGA -> { buildMega(s); intoPanel(sp(10f), header = true) }
|
||||
}
|
||||
}
|
||||
|
||||
/** The docked tab: the FPS alone, in a box square on the edge it sits against. */
|
||||
private fun buildDockTab() {
|
||||
val numPx = sp(20f)
|
||||
val spans = tabSpans()
|
||||
val padX = sp(9f); val padY = sp(7f)
|
||||
placeRun(padX, padY + capHeight(numPx), spans)
|
||||
val (w, h) = dockTabSize()
|
||||
contentW = w; contentH = h
|
||||
tabRect = RectF(0f, 0f, contentW, contentH)
|
||||
}
|
||||
|
||||
private fun tabSpans() = listOf(Span(one(fpsNow), colValue, sp(20f)), Span("fps", colDim, sp(8.5f)))
|
||||
|
||||
/** The size the docked tab has, so the HUD can contract to exactly that shape before the tab replaces it. */
|
||||
internal fun dockTabSize(): Pair<Float, Float> =
|
||||
Pair(runWidth(tabSpans()) + 2f * sp(9f), capHeight(sp(20f)) + 2f * sp(7f))
|
||||
|
||||
private fun drawTab(canvas: Canvas, rect: RectF) {
|
||||
val r = sp(8f); val stroke = max(outlineWidth(), sp(1.5f)); val h = stroke / 2f
|
||||
val round = floatArrayOf(r, r, r, r, r, r, r, r)
|
||||
val edge = when (dock) {
|
||||
DroidDeckHudDock.LEFT -> intArrayOf(0, 3)
|
||||
DroidDeckHudDock.RIGHT -> intArrayOf(1, 2)
|
||||
DroidDeckHudDock.TOP -> intArrayOf(0, 1)
|
||||
DroidDeckHudDock.BOTTOM -> intArrayOf(2, 3)
|
||||
DroidDeckHudDock.NONE -> intArrayOf()
|
||||
}
|
||||
for (corner in edge) { round[corner * 2] = 0f; round[corner * 2 + 1] = 0f }
|
||||
tabPath.rewind()
|
||||
tabPath.addRoundRect(rect.left + h, rect.top + h, rect.right - h, rect.bottom - h, round, Path.Direction.CW)
|
||||
headerPaint.shader = null
|
||||
headerPaint.color = withAlpha(panelColor(), max(Color.alpha(panelColor()), 200))
|
||||
canvas.drawPath(tabPath, headerPaint)
|
||||
strokePaint.strokeWidth = stroke
|
||||
strokePaint.color = outlineColor()
|
||||
canvas.drawPath(tabPath, strokePaint)
|
||||
}
|
||||
|
||||
// ---- DroidDeck panel, header and chip -----------------------------------
|
||||
/** The clock sits in the header on every size but the Pill, which keeps it under the FPS. */
|
||||
private fun footerClock(): Boolean = showClockTime && size == FusionSize.PILL
|
||||
private fun footerClock(): Boolean = showClockTime && size == DroidDeckHudSize.PILL
|
||||
|
||||
private fun measureSans(text: String, sizePx: Float): Float { wordmarkPaint.textSize = sizePx; return wordmarkPaint.measureText(text) }
|
||||
|
||||
private fun panelInset() = sp(8f) // room for the glow around the panel
|
||||
private fun panelLeft() = sp(13f) // the orb and its glow stick out of the left side
|
||||
private fun panelLeft() = sp(13f) // the outline's glow sticks out of the left side
|
||||
private fun contentLeft() = panelLeft() + sp(16f)
|
||||
|
||||
/** The DroidDeck mark, "DroidDeck" and the clock across the top, starting on [left], with the same
|
||||
@@ -672,7 +750,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
rows.add(HudRow(Span("GPU", colGpu, rowPx), gpuModelSpans(rowPx, colValue)))
|
||||
if (displayServer.isNotBlank())
|
||||
rows.add(HudRow(Span("DISP", colDisp, rowPx), listOf(Span(displayServer, colValue, rowPx))))
|
||||
if (hdrState != FusionHdr.NONE)
|
||||
if (hdrState != DroidDeckHudHdr.NONE)
|
||||
rows.add(HudRow(Span("HDR", colHdr, rowPx), hdrValue(rowPx)))
|
||||
if (showGPU) {
|
||||
val v = ArrayList<Span>()
|
||||
@@ -784,7 +862,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
dxVersion().ifBlank { null }, false))
|
||||
if (displayServer.isNotBlank())
|
||||
tiles.add(Tile("DISPLAY", colDisp, listOf(Span(displayServer, colValue, valPx)),
|
||||
if (hdrState != FusionHdr.NONE) hdrText() else null, false))
|
||||
if (hdrState != DroidDeckHudHdr.NONE) hdrText() else null, false))
|
||||
if (showGpuModel && gpuNameText().isNotBlank())
|
||||
tiles.add(Tile("GPU", colGpu, gpuModelSpans(valPx, colValue), null, true))
|
||||
if (showBattery || showPower || showBatteryTemp) {
|
||||
@@ -893,7 +971,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
}
|
||||
// Wayland HDR state on its OWN line directly under the latency · display-server line (it ran off
|
||||
// the capsule's right edge as "40.3ms · Wayland · HDR (no headroom)"). Only in HDR sessions.
|
||||
if (hdrState != FusionHdr.NONE) stack.add(hdrLine(stkPx))
|
||||
if (hdrState != DroidDeckHudHdr.NONE) stack.add(hdrLine(stkPx))
|
||||
|
||||
var statsW = 0f
|
||||
for (l in stack) statsW = max(statsW, runWidth(l))
|
||||
@@ -963,7 +1041,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
}
|
||||
val footerLabel = listOf(if (showEngine) engineLabel else "", displayServer)
|
||||
.filter { it.isNotBlank() }.joinToString(" · ")
|
||||
val hdr = if (hdrState != FusionHdr.NONE) hdrLine(footPx) else emptyList()
|
||||
val hdr = if (hdrState != DroidDeckHudHdr.NONE) hdrLine(footPx) else emptyList()
|
||||
|
||||
val (headerBottom, headerRight) = addPanelHeader(left, inner)
|
||||
val x = headerRight
|
||||
@@ -1143,7 +1221,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
val band = ArrayList<List<Span>>()
|
||||
if (showResolution) band.add(listOf(Span("RES ", colDim, bandPx), Span(resolutionString(), colValue, bandPx)))
|
||||
if (displayServer.isNotBlank()) band.add(listOf(Span("DISP ", colDim, bandPx), Span(displayServer, colDisp, bandPx)))
|
||||
if (hdrState != FusionHdr.NONE) band.add(listOf(Span("HDR ", colDim, bandPx)) + hdrValue(bandPx))
|
||||
if (hdrState != DroidDeckHudHdr.NONE) band.add(listOf(Span("HDR ", colDim, bandPx)) + hdrValue(bandPx))
|
||||
if (showProton && wineVersion.isNotBlank()) band.add(listOf(Span(wineVersion, colVram, bandPx)))
|
||||
if (showSession) band.add(listOf(Span("elapsed ", colDim, bandPx), Span(elapsedString(), colValue, bandPx)))
|
||||
if (band.isNotEmpty()) {
|
||||
@@ -1204,6 +1282,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
}
|
||||
|
||||
chipRect?.let { drawChip(canvas, it) }
|
||||
tabRect?.let { drawTab(canvas, it) }
|
||||
|
||||
// Text
|
||||
for (g in glyphs) {
|
||||
@@ -1253,19 +1332,17 @@ class FusionHudView(context: Context) : View(context) {
|
||||
Color.argb(alpha, Color.red(color), Color.green(color), Color.blue(color))
|
||||
|
||||
/** The D: straight left side with small corners, round on the right with radius [rad] (a half circle
|
||||
* when it is half the height). [split] > 0 leaves that much open above and below the middle of the
|
||||
* left side, where the orb sits. */
|
||||
private fun dShape(l: Float, t: Float, r: Float, b: Float, rad: Float, corner: Float, split: Float): Path {
|
||||
val cy = (t + b) / 2f
|
||||
* when it is half the height). */
|
||||
private fun dShape(l: Float, t: Float, r: Float, b: Float, rad: Float, corner: Float): Path {
|
||||
return Path().apply {
|
||||
if (split > 0f) moveTo(l, cy + split) else moveTo(l, t + corner)
|
||||
moveTo(l, t + corner)
|
||||
lineTo(l, b - corner); quadTo(l, b, l + corner, b)
|
||||
lineTo(r - rad, b)
|
||||
arcTo(r - 2f * rad, b - 2f * rad, r, b, 90f, -90f, false)
|
||||
lineTo(r, t + rad)
|
||||
arcTo(r - 2f * rad, t, r, t + 2f * rad, 0f, -90f, false)
|
||||
lineTo(l + corner, t); quadTo(l, t, l, t + corner)
|
||||
if (split > 0f) lineTo(l, cy - split) else close()
|
||||
close()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1285,7 +1362,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
val bmp = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
|
||||
val c = Canvas(bmp)
|
||||
val corner = sp(6f)
|
||||
val body = dShape(panel.left, panel.top, panel.right, panel.bottom, dRadius, corner, 0f)
|
||||
val body = dShape(panel.left, panel.top, panel.right, panel.bottom, dRadius, corner)
|
||||
bgPaint.color = panelColor()
|
||||
c.drawPath(body, bgPaint)
|
||||
c.save()
|
||||
@@ -1307,7 +1384,7 @@ class FusionHudView(context: Context) : View(context) {
|
||||
c.restore()
|
||||
if (stroke > 0f) {
|
||||
val h = stroke / 2f
|
||||
val outline = dShape(panel.left + h, panel.top + h, panel.right - h, panel.bottom - h, dRadius - h, corner, sp(9f))
|
||||
val outline = dShape(panel.left + h, panel.top + h, panel.right - h, panel.bottom - h, dRadius - h, corner)
|
||||
val blur = BlurMaskFilter((sp(3.2f) - 0.5f).coerceAtLeast(0.5f) / 0.57735f, BlurMaskFilter.Blur.NORMAL)
|
||||
glowPaint.strokeWidth = stroke
|
||||
// Two blurred passes under the sharp one, as the 4-in-1 preview's neon.
|
||||
@@ -1315,8 +1392,6 @@ class FusionHudView(context: Context) : View(context) {
|
||||
glowPaint.maskFilter = if (pass < 2) blur else null
|
||||
glowPaint.style = Paint.Style.STROKE; glowPaint.color = outlineColor()
|
||||
c.drawPath(outline, glowPaint)
|
||||
glowPaint.style = Paint.Style.FILL; glowPaint.color = accent
|
||||
c.drawCircle(panel.left + h, panel.centerY(), sp(5.5f), glowPaint)
|
||||
}
|
||||
glowPaint.maskFilter = null
|
||||
}
|
||||
@@ -1358,15 +1433,21 @@ class FusionHudView(context: Context) : View(context) {
|
||||
|
||||
// Declining the down event hands the whole gesture to the views under the HUD.
|
||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||
if (dock != DroidDeckHudDock.NONE) return dockDetector.onTouchEvent(event)
|
||||
if (event.actionMasked == MotionEvent.ACTION_DOWN && lockController.isLocked() &&
|
||||
passesTouchAt?.invoke(event.rawX, event.rawY) == true) return false
|
||||
return lockController.onTouchEvent(event)
|
||||
}
|
||||
|
||||
internal val contentWidth: Float get() = contentW
|
||||
internal val contentHeight: Float get() = contentH
|
||||
|
||||
internal val isDragging: Boolean get() = lockController.isDragging()
|
||||
|
||||
private companion object {
|
||||
const val REFRESH_MS = 500L
|
||||
const val MIN_SCALE = 0.5f
|
||||
const val MAX_SCALE = 2f
|
||||
const val GRAPH_CLIP_MS = 49.9f
|
||||
|
||||
fun parseIntOr(s: String?, d: Int): Int = try { s?.trim()?.toInt() ?: d } catch (e: Exception) { d }
|
||||
@@ -8,7 +8,7 @@ import kotlin.math.roundToInt
|
||||
* overlay.cpp update_hud_info_with_frametime and hud_elements.cpp fps() / frame_timing(). The FPS is the
|
||||
* frames counted over a sampling period of at least 500 ms, the frame time next to it is 1000 / FPS, and
|
||||
* the graph holds the last 200 frame times (zeros until filled) on a fixed 0-50 ms scale, min and max
|
||||
* taken over those 200. Average and lows are FusionHUD's own readouts.
|
||||
* taken over those 200. Average and lows are DroidDeck HUD's own readouts.
|
||||
*/
|
||||
internal class FrameStats {
|
||||
private val graph = FloatArray(GRAPH_FRAMES)
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.graphics.RectF;
|
||||
import android.os.SystemClock;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.ScaleGestureDetector;
|
||||
import android.view.View;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
@@ -29,17 +30,17 @@ import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* Shared touch + lock behaviour for every in-game performance HUD (classic FrameRating(+Horizontal),
|
||||
* GameHub PerfHudView, GameNative PerformanceHudView, and the Fusion HUD). One place so the four
|
||||
* GameHub PerfHudView, GameNative PerformanceHudView, and the DroidDeck HUD). One place so the four
|
||||
* overlays can't drift:
|
||||
*
|
||||
* <ul>
|
||||
* <li><b>tap</b> → {@link Callbacks#onTap()} (orientation-toggle for the first three; size-cycle for
|
||||
* Fusion) — a no-op that only re-flashes the lock badge while locked.</li>
|
||||
* the DroidDeck HUD) — a no-op that only re-flashes the lock badge while locked.</li>
|
||||
* <li><b>drag</b> → moves the host view and, on release, {@link Callbacks#onMoved} to persist the
|
||||
* position — disabled (frozen) while locked.</li>
|
||||
* <li><b>long-press</b> → toggles {@code hudLocked}, persisted via {@link Callbacks#onLockChanged}
|
||||
* and kept in sync with the "Lock in place" menu chip. Works locked or unlocked (so a long-press
|
||||
* always unlocks); a locked {@code FusionHudView} passes touches on only over on-screen controls.</li>
|
||||
* always unlocks); a locked {@code DroidDeckHudView} passes touches on only over on-screen controls.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>On every lock/unlock (and on a blocked gesture while locked) a small padlock badge fades in →
|
||||
@@ -52,12 +53,16 @@ import java.util.function.Consumer;
|
||||
public class HudLockController {
|
||||
|
||||
public interface Callbacks {
|
||||
/** Unlocked single tap: orientation-toggle (classic/gamehub/gamenative) or size-cycle (fusion). */
|
||||
/** Unlocked single tap: orientation-toggle (classic/gamehub/gamenative) or size-cycle (DroidDeck HUD). */
|
||||
void onTap();
|
||||
/** Drag released (unlocked): persist the new (x, y). */
|
||||
void onMoved(float x, float y);
|
||||
/** Lock toggled by long-press: persist {@code hudLocked} + sync the menu chip. */
|
||||
void onLockChanged(boolean locked);
|
||||
/** Two-finger pinch (unlocked): the change since the previous event, above 1 when the fingers spread. */
|
||||
default void onPinch(float factor) {}
|
||||
/** The fingers came off a pinch: persist the new size. */
|
||||
default void onPinchEnd() {}
|
||||
}
|
||||
|
||||
// Fade timing (ms): in → hold → out. Lock/unlock hold ~1.5 s; a blocked-gesture re-flash is shorter.
|
||||
@@ -70,12 +75,15 @@ public class HudLockController {
|
||||
private final View view;
|
||||
private final Callbacks cb;
|
||||
private final GestureDetector detector;
|
||||
private final ScaleGestureDetector scaleDetector;
|
||||
|
||||
private boolean locked = false;
|
||||
|
||||
// Drag state
|
||||
private float downRawX, downRawY, startX, startY;
|
||||
private boolean dragging = false;
|
||||
// A pinch ends the gesture's drag and tap: the finger left down after it must not move the HUD.
|
||||
private boolean pinched = false;
|
||||
|
||||
// Fade state
|
||||
private long fadeStart = 0;
|
||||
@@ -90,6 +98,8 @@ public class HudLockController {
|
||||
this.cb = cb;
|
||||
this.detector = new GestureDetector(context, new Listener());
|
||||
this.detector.setIsLongpressEnabled(true);
|
||||
this.scaleDetector = new ScaleGestureDetector(context, new PinchListener());
|
||||
this.scaleDetector.setQuickScaleEnabled(false);
|
||||
iconFill.setStyle(Paint.Style.FILL);
|
||||
iconStroke.setStyle(Paint.Style.STROKE);
|
||||
iconStroke.setStrokeCap(Paint.Cap.ROUND);
|
||||
@@ -105,6 +115,7 @@ public class HudLockController {
|
||||
|
||||
/** Feed from the host view's onTouchEvent. Always consumes (mirrors the legacy manual handlers). */
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
scaleDetector.onTouchEvent(event);
|
||||
detector.onTouchEvent(event);
|
||||
int action = event.getActionMasked();
|
||||
if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
|
||||
@@ -122,6 +133,7 @@ public class HudLockController {
|
||||
startX = view.getX();
|
||||
startY = view.getY();
|
||||
dragging = false;
|
||||
pinched = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -135,6 +147,7 @@ public class HudLockController {
|
||||
|
||||
@Override
|
||||
public boolean onSingleTapUp(MotionEvent e) {
|
||||
if (pinched) return true;
|
||||
if (locked) {
|
||||
flash(true, HOLD_REFLASH_MS); // intentionally locked — remind the user
|
||||
} else {
|
||||
@@ -145,6 +158,7 @@ public class HudLockController {
|
||||
|
||||
@Override
|
||||
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
||||
if (pinched) return true;
|
||||
if (locked) {
|
||||
if (!dragging) flash(true, HOLD_REFLASH_MS);
|
||||
dragging = true; // mark so the blocked drag doesn't fall through to a tap
|
||||
@@ -157,6 +171,27 @@ public class HudLockController {
|
||||
}
|
||||
}
|
||||
|
||||
private final class PinchListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
|
||||
@Override
|
||||
public boolean onScaleBegin(ScaleGestureDetector d) {
|
||||
if (locked) return false;
|
||||
pinched = true;
|
||||
dragging = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScale(ScaleGestureDetector d) {
|
||||
cb.onPinch(d.getScaleFactor());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScaleEnd(ScaleGestureDetector d) {
|
||||
cb.onPinchEnd();
|
||||
}
|
||||
}
|
||||
|
||||
// ---- Fade badge -------------------------------------------------------
|
||||
private void flash(boolean showLocked, long hold) {
|
||||
fadeShowLocked = showLocked;
|
||||
|
||||
@@ -1006,7 +1006,7 @@ public class HudMetrics {
|
||||
// =======================================================================
|
||||
|
||||
/**
|
||||
* Immutable point-in-time reading of every metric the Fusion HUD draws. Collected in one pass by
|
||||
* Immutable point-in-time reading of every metric the DroidDeck HUD draws. Collected in one pass by
|
||||
* {@link #snapshot()} so the view never touches sysfs / BatteryManager during draw (the user's
|
||||
* explicit ask: one collection pass, cached, so gameplay isn't strained). All numeric fields are
|
||||
* raw (nullable when unreadable); the view formats + colours them.
|
||||
@@ -1268,7 +1268,7 @@ public class HudMetrics {
|
||||
Snapshot s = snapshot();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("DroidDeck FusionHUD diagnostics\n");
|
||||
sb.append("DroidDeck HUD diagnostics\n");
|
||||
sb.append("Generated: ")
|
||||
.append(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).format(new Date())).append('\n');
|
||||
sb.append("Device: ").append(Build.MANUFACTURER).append(' ').append(Build.MODEL).append('\n');
|
||||
|
||||
@@ -75,7 +75,10 @@ object BwrapSpawner {
|
||||
}
|
||||
}
|
||||
|
||||
class Plan(val root: File, val binds: List<Bind>, val cwd: String, val argv: List<String>, val env: Map<String, String>)
|
||||
class Plan(
|
||||
val root: File, val binds: List<Bind>, val cwd: String, val argv: List<String>, val env: Map<String, String>,
|
||||
val envTool: String = "/usr/bin/env",
|
||||
)
|
||||
|
||||
data class Bind(val host: String, val guest: String) {
|
||||
val spec: String get() = if (host == guest) host else "$host:$guest"
|
||||
@@ -179,12 +182,13 @@ object BwrapSpawner {
|
||||
val argv = request.getJSONArray("argv").let { a -> (0 until a.length()).map { a.getString(it) } }
|
||||
val env = LinkedHashMap<String, String>()
|
||||
request.optJSONObject("env")?.let { e -> e.keys().forEach { k -> env[k] = e.getString(k) } }
|
||||
if (binds.any { it.guest == "/dev" }) gpu(rootfs, root, env)?.forEach { addBind(it) }
|
||||
val envTool = request.optString("envTool").takeIf { it.startsWith("/") }
|
||||
if (envTool == null && binds.any { it.guest == "/dev" }) gpu(rootfs, root, env)?.forEach { addBind(it) }
|
||||
val libc = listOf("/usr/lib/aarch64-linux-gnu/libc.so.6", "/lib/aarch64-linux-gnu/libc.so.6").map { hostPath(binds, root.path, it) }
|
||||
if (preloadFits(rootfs, libc.firstOrNull { File(it).isFile } ?: libc.first())) preload(session, rootfs, env).forEach { addBind(it) }
|
||||
if (envTool == null && preloadFits(rootfs, libc.firstOrNull { File(it).isFile } ?: libc.first())) preload(session, rootfs, env).forEach { addBind(it) }
|
||||
zypakShims(binds, root, dir).forEach { addBind(it) }
|
||||
browserSandboxes(env)
|
||||
return Plan(root, binds, request.optString("cwd", "/").ifEmpty { "/" }, argv, env)
|
||||
return Plan(root, binds, request.optString("cwd", "/").ifEmpty { "/" }, argv, env, envTool ?: "/usr/bin/env")
|
||||
}
|
||||
|
||||
private const val GPU_DIR = "/run/droiddeck-gpu"
|
||||
@@ -325,7 +329,7 @@ object BwrapSpawner {
|
||||
val verbose = plan.env["DROIDDECK_PROOT_VERBOSE"]?.toIntOrNull()
|
||||
if (verbose != null) { cmd.add(1, "-v"); cmd.add(2, verbose.toString()) }
|
||||
plan.binds.forEach { cmd.add("-b"); cmd.add(it.spec) }
|
||||
cmd.add("/usr/bin/env")
|
||||
cmd.add(plan.envTool)
|
||||
cmd.add("-i")
|
||||
plan.env.forEach { (k, v) -> cmd.add("$k=$v") }
|
||||
cmd.addAll(plan.argv)
|
||||
|
||||
@@ -19,7 +19,7 @@ object FlatpakManager {
|
||||
@Volatile var busy: String? = null
|
||||
private set
|
||||
|
||||
class App(val id: String, val name: String, val icon: File?, val branch: String, val summary: String?)
|
||||
class App(val id: String, val name: String, val icon: File?, val branch: String, val summary: String?, val arch: String = "aarch64")
|
||||
|
||||
fun ready(context: Context): Boolean {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
@@ -33,24 +33,33 @@ object FlatpakManager {
|
||||
else -> "aarch64"
|
||||
}
|
||||
|
||||
internal fun arches(native: String = arch()): List<String> = if (native == "aarch64") listOf("aarch64", "x86_64") else listOf(native)
|
||||
|
||||
internal fun installedBranch(appDir: File, native: String = arch()): Pair<String, File>? =
|
||||
arches(native).firstNotNullOfOrNull { arch ->
|
||||
File(appDir, arch).listFiles()?.firstOrNull { File(it, "active").exists() }?.let { arch to it }
|
||||
}
|
||||
|
||||
fun foreign(app: App, native: String = arch()): Boolean = app.arch != native
|
||||
|
||||
fun launchArgs(app: App, native: String = arch()): List<String> = if (foreign(app, native)) listOf("--arch=${app.arch}", app.id) else listOf(app.id)
|
||||
|
||||
fun installedApps(context: Context): List<App> {
|
||||
val apps = File(LinuxRuntime.rootDir(context), "$USER_DIR/app")
|
||||
val arch = arch()
|
||||
return apps.listFiles()?.mapNotNull { dir ->
|
||||
val id = dir.name
|
||||
val archDir = File(dir, arch)
|
||||
val branch = archDir.listFiles()?.firstOrNull { File(it, "active").exists() } ?: return@mapNotNull null
|
||||
val (arch, branch) = installedBranch(dir) ?: return@mapNotNull null
|
||||
val active = File(branch, "active")
|
||||
val export = File(active, "export/share")
|
||||
val desktop = FileUtils.readString(File(export, "applications/$id.desktop"))
|
||||
val name = desktop?.let { entry(it, "Name") } ?: id.substringAfterLast('.')
|
||||
val summary = desktop?.let { entry(it, "Comment") }
|
||||
App(id, name, icon(export, id), branch.name, summary)
|
||||
App(id, name, icon(export, id), branch.name, summary, arch)
|
||||
}?.sortedBy { it.name.lowercase() } ?: emptyList()
|
||||
}
|
||||
|
||||
fun isInstalled(context: Context, id: String): Boolean =
|
||||
File(LinuxRuntime.rootDir(context), "$USER_DIR/app/$id/${arch()}").listFiles()?.any { File(it, "active").exists() } == true
|
||||
installedBranch(File(LinuxRuntime.rootDir(context), "$USER_DIR/app/$id")) != null
|
||||
|
||||
private fun entry(desktop: String, key: String): String? {
|
||||
var inMain = false
|
||||
@@ -117,7 +126,11 @@ object FlatpakManager {
|
||||
when (o.optString("e")) {
|
||||
"op" -> { step = stage(context, o); onProgress(step, overall(o, 0)) }
|
||||
"progress" -> onProgress(step, overall(o, o.optInt("percent")))
|
||||
"error" -> { error = o.optString("message"); Log.w(TAG, "$verb $id: $error") }
|
||||
"error" -> {
|
||||
error = if (o.optString("code") == "arch") context.getString(R.string.flatpakmgr_wrong_arch, o.optString("id"), o.optString("arch"))
|
||||
else o.optString("message")
|
||||
Log.w(TAG, "$verb $id: ${o.optString("message")}")
|
||||
}
|
||||
"warning" -> Log.w(TAG, "$verb $id: ${o.optString("message")}")
|
||||
"done" -> onDone(o)
|
||||
}
|
||||
|
||||
@@ -97,7 +97,8 @@ object UserApps {
|
||||
App(
|
||||
"flatpak:${app.id}", Kind.FLATPAK, readName(custom) ?: app.name,
|
||||
File(custom, "icon.png").takeIf { it.isFile } ?: app.icon ?: FlathubApi.iconUrl(app.id),
|
||||
app.summary, FlatpakManager.LAUNCHER, listOf(app.id),
|
||||
app.summary, FlatpakManager.LAUNCHER, FlatpakManager.launchArgs(app),
|
||||
arch = app.arch.takeIf { FlatpakManager.foreign(app) },
|
||||
)
|
||||
}
|
||||
return (scripts + images + flatpaks).sortedBy { it.name.lowercase() }
|
||||
|
||||
@@ -21,7 +21,7 @@ class GpuMemComponent(private val file: File, private val root: File) : SessionP
|
||||
thread = Thread({
|
||||
while (running) {
|
||||
try { Thread.sleep(PERIOD_MS) } catch (e: InterruptedException) { break }
|
||||
if (running && (OverlayShown.check(root) || com.droiddeck.launcher.hud.FusionHudHost.showing)) sample()?.let { write(it) }
|
||||
if (running && (OverlayShown.check(root) || com.droiddeck.launcher.hud.DroidDeckHudHost.showing)) sample()?.let { write(it) }
|
||||
}
|
||||
}, "gpu-mem").apply { isDaemon = true; start() }
|
||||
}
|
||||
|
||||
@@ -286,18 +286,18 @@ object SessionPrefs {
|
||||
prefs(context).edit().putInt("hudOpacity", percent.coerceIn(HUD_OPACITY_RANGE)).apply()
|
||||
}
|
||||
|
||||
fun fusionHudConfig(context: Context): String? = prefs(context).getString("fusionHud", null)
|
||||
fun droidDeckHudConfig(context: Context): String? = prefs(context).getString("__KEEP_droidDeckHud__", null)
|
||||
|
||||
fun setFusionHudConfig(context: Context, config: String) {
|
||||
prefs(context).edit().putString("fusionHud", config).apply()
|
||||
fun setDroidDeckHudConfig(context: Context, config: String) {
|
||||
prefs(context).edit().putString("__KEEP_droidDeckHud__", config).apply()
|
||||
}
|
||||
|
||||
fun fusionHudPosition(context: Context): Pair<Float, Float>? =
|
||||
prefs(context).getString("fusionHudPos", null)?.split(',')?.mapNotNull { it.toFloatOrNull() }
|
||||
fun droidDeckHudPosition(context: Context): Pair<Float, Float>? =
|
||||
prefs(context).getString("__KEEP_droidDeckHudPos__", null)?.split(',')?.mapNotNull { it.toFloatOrNull() }
|
||||
?.takeIf { it.size == 2 }?.let { it[0] to it[1] }
|
||||
|
||||
fun setFusionHudPosition(context: Context, x: Float, y: Float) {
|
||||
prefs(context).edit().putString("fusionHudPos", "$x,$y").apply()
|
||||
fun setDroidDeckHudPosition(context: Context, x: Float, y: Float) {
|
||||
prefs(context).edit().putString("__KEEP_droidDeckHudPos__", "$x,$y").apply()
|
||||
}
|
||||
|
||||
const val HUD_COLOR_MINT = "mint"
|
||||
|
||||
@@ -15,7 +15,7 @@ object SettingsReset {
|
||||
"dualScreenMode", "dualScreenLauncher", "dualScreenSessionControls",
|
||||
"gameStoresEnabled", "gameStoresSpeedTier", "gameStoresParallel", "storesOpenTab", "storesShowMature",
|
||||
"storesInstallLanguage",
|
||||
"hud", "hudDeck", "hudFps", "hudBattery", "hudGraph", "hudColor", "hudOpacity", "fusionHud", "fusionHudPos", "backActionsInverted", "backDoubleTapMs", "touch", "osc", "shape", "steamController",
|
||||
"hud", "hudDeck", "hudFps", "hudBattery", "hudGraph", "hudColor", "hudOpacity", "__KEEP_droidDeckHud__", "__KEEP_droidDeckHudPos__", "backActionsInverted", "backDoubleTapMs", "touch", "osc", "shape", "steamController",
|
||||
"gamepadLeft", "gamepadRight", "pipAutoEnter", "unfoldedControls", "unfoldedControlsWithController",
|
||||
"stretch16x9", "picturePosition", "railLabels",
|
||||
"gpuDriverMode", "androidDriver", "linuxDriver", "linuxDriver.steam", "linuxDriver.desktop",
|
||||
|
||||
+17
-17
@@ -4,11 +4,11 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.hud.FusionSize
|
||||
import com.droiddeck.launcher.hud.DroidDeckHudSize
|
||||
|
||||
/** Bannerlator's Fusion HUD settings (DeckOverlaySettings): one row per key of the HUD's config string. */
|
||||
/** Bannerlator's DroidDeck HUD settings (DeckOverlaySettings): one row per key of the HUD's config string. */
|
||||
@Composable
|
||||
internal fun FusionHudSettings(host: MenuHost, a: DrawerActions, track: (String) -> Modifier) {
|
||||
internal fun DroidDeckHudSettings(host: MenuHost, a: DrawerActions, track: (String) -> Modifier) {
|
||||
val cfg = a.hudConfig
|
||||
fun on(key: String) = cfg[key] == "1"
|
||||
fun int(key: String, fallback: Int) = cfg[key]?.toIntOrNull() ?: fallback
|
||||
@@ -16,14 +16,14 @@ internal fun FusionHudSettings(host: MenuHost, a: DrawerActions, track: (String)
|
||||
SettingsGroup(stringResource(R.string.drawer_hud)) {
|
||||
ToggleRow(host, "hud", stringResource(R.string.drawer_hud), null, a.hudOn, chipModifier = track("hud"), onChange = a.onHud)
|
||||
if (!a.hudOn) return@SettingsGroup
|
||||
val size = FusionSize.from(cfg["hudSize"])
|
||||
val size = DroidDeckHudSize.from(cfg["hudSize"])
|
||||
ChoiceRow(host, "hud-size", stringResource(R.string.hud_size), stringResource(R.string.hud_size_hint),
|
||||
listOf(
|
||||
FusionSize.FULL to stringResource(R.string.hud_size_full),
|
||||
FusionSize.TILES to stringResource(R.string.hud_size_tiles),
|
||||
FusionSize.PILL to stringResource(R.string.hud_size_pill),
|
||||
FusionSize.MINIMAL to stringResource(R.string.hud_size_minimal),
|
||||
FusionSize.MEGA to stringResource(R.string.hud_size_mega),
|
||||
DroidDeckHudSize.FULL to stringResource(R.string.hud_size_full),
|
||||
DroidDeckHudSize.TILES to stringResource(R.string.hud_size_tiles),
|
||||
DroidDeckHudSize.PILL to stringResource(R.string.hud_size_pill),
|
||||
DroidDeckHudSize.MINIMAL to stringResource(R.string.hud_size_minimal),
|
||||
DroidDeckHudSize.MEGA to stringResource(R.string.hud_size_mega),
|
||||
),
|
||||
size, chipModifier = track("hud-size")) { a.onHudSetting("hudSize", it.token) }
|
||||
ToggleRow(host, "hud-locked", stringResource(R.string.hud_locked), stringResource(R.string.hud_locked_hint), on("hudLocked"),
|
||||
@@ -47,7 +47,7 @@ internal fun FusionHudSettings(host: MenuHost, a: DrawerActions, track: (String)
|
||||
if (cfg["hudOutlineAccent"] == "0") "0" else "1", chipModifier = track("hud-outline-color")) { a.onHudSetting("hudOutlineAccent", it) }
|
||||
}
|
||||
|
||||
val size = FusionSize.from(cfg["hudSize"])
|
||||
val size = DroidDeckHudSize.from(cfg["hudSize"])
|
||||
val chips = size.supportedChips() + EXTRA[size].orEmpty()
|
||||
SettingsGroup(stringResource(R.string.hud_group_metrics)) {
|
||||
for (metric in METRICS) {
|
||||
@@ -84,7 +84,7 @@ internal fun FusionHudSettings(host: MenuHost, a: DrawerActions, track: (String)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsGroup(stringResource(R.string.hud_group_more), detail = stringResource(R.string.hud_credit)) {
|
||||
SettingsGroup(stringResource(R.string.hud_group_more)) {
|
||||
ActionRow(stringResource(R.string.hud_export), stringResource(R.string.hud_export_hint),
|
||||
stringResource(R.string.hud_export_button), onClick = a.onHudExport, modifier = track("hud-export"))
|
||||
ActionRow(stringResource(R.string.hud_reset), null, stringResource(R.string.hud_reset_button),
|
||||
@@ -95,11 +95,11 @@ internal fun FusionHudSettings(host: MenuHost, a: DrawerActions, track: (String)
|
||||
private fun flag(on: Boolean) = if (on) "1" else "0"
|
||||
|
||||
// The Pill also draws the battery temperature and watts.
|
||||
private val EXTRA = mapOf(FusionSize.PILL to setOf("Temp", "Power"))
|
||||
private val EXTRA = mapOf(DroidDeckHudSize.PILL to setOf("Temp", "Power"))
|
||||
|
||||
private class HudMetric(val chip: String, val key: String, val label: Int)
|
||||
|
||||
// FusionSize.supportedChips() names; Wrapper and DX version have nothing to show in DroidDeck.
|
||||
// DroidDeckHudSize.supportedChips() names; Wrapper and DX version have nothing to show in DroidDeck.
|
||||
private val METRICS = listOf(
|
||||
HudMetric("FPS", "showFPS", R.string.drawer_hud_fps),
|
||||
HudMetric("FPS graph", "showFPSGraph", R.string.hud_metric_graph),
|
||||
@@ -124,10 +124,10 @@ private val METRICS = listOf(
|
||||
HudMetric("Clock", "showClock", R.string.hud_metric_clock),
|
||||
)
|
||||
|
||||
// Switches a size lists but never draws (FusionHudView): the Pill and Minimal always show the FPS, the
|
||||
// Switches a size lists but never draws (DroidDeckHudView): the Pill and Minimal always show the FPS, the
|
||||
// Pill has no graph, Tiles has no graph and no 0.01% low.
|
||||
private val HIDDEN = mapOf(
|
||||
FusionSize.PILL to setOf("FPS", "FPS graph"),
|
||||
FusionSize.MINIMAL to setOf("FPS"),
|
||||
FusionSize.TILES to setOf("FPS graph", "0.01% low"),
|
||||
DroidDeckHudSize.PILL to setOf("FPS", "FPS graph"),
|
||||
DroidDeckHudSize.MINIMAL to setOf("FPS"),
|
||||
DroidDeckHudSize.TILES to setOf("FPS graph", "0.01% low"),
|
||||
)
|
||||
@@ -70,6 +70,7 @@ object DualScreenPanel {
|
||||
set(value) { field = value; available = value || activity != null }
|
||||
private var ownerTask = -1
|
||||
private var ownerYielded = false
|
||||
private var ownerPaused = false
|
||||
|
||||
var typing by mutableStateOf<TypingRequest?>(null)
|
||||
private set
|
||||
@@ -120,6 +121,7 @@ object DualScreenPanel {
|
||||
displayId = display
|
||||
ownerTask = task
|
||||
ownerYielded = false
|
||||
ownerPaused = false
|
||||
launching = true
|
||||
val intent = Intent(context, DualScreenActivity::class.java)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_MULTIPLE_TASK or Intent.FLAG_ACTIVITY_NO_ANIMATION)
|
||||
@@ -153,15 +155,27 @@ object DualScreenPanel {
|
||||
if (ownerTask == task) ownerYielded = app
|
||||
}
|
||||
|
||||
internal fun returnFocus(context: Context) {
|
||||
if (ownerYielded) return
|
||||
val task = ownerTask.takeIf { it >= 0 } ?: return
|
||||
fun ownerPaused(task: Int, paused: Boolean) {
|
||||
if (ownerTask == task) ownerPaused = paused
|
||||
}
|
||||
|
||||
internal fun focusTask(fromPanel: Boolean): Int? {
|
||||
if (ownerYielded || (ownerPaused && !fromPanel)) return null
|
||||
return ownerTask.takeIf { it >= 0 }
|
||||
}
|
||||
|
||||
internal fun tookFocus(fresh: Boolean, touchedAt: Long, now: Long): Boolean =
|
||||
fresh || now - touchedAt in 0..TOUCH_FOCUS_MS
|
||||
|
||||
private const val TOUCH_FOCUS_MS = 1000L
|
||||
|
||||
internal fun returnFocus(context: Context, fromPanel: Boolean = false) {
|
||||
val task = focusTask(fromPanel) ?: return
|
||||
runCatching { (context.getSystemService(Context.ACTIVITY_SERVICE) as android.app.ActivityManager).moveTaskToFront(task, 0) }
|
||||
}
|
||||
|
||||
internal fun reclaimFocus(context: Context) {
|
||||
if (ownerYielded) return
|
||||
val task = ownerTask.takeIf { it >= 0 } ?: return
|
||||
val task = focusTask(false) ?: return
|
||||
val manager = context.getSystemService(Context.ACTIVITY_SERVICE) as android.app.ActivityManager
|
||||
runCatching {
|
||||
manager.appTasks.firstOrNull {
|
||||
@@ -209,10 +223,10 @@ class DualScreenActivity : ComponentActivity() {
|
||||
runCatching { (getSystemService(ACTIVITY_SERVICE) as android.app.ActivityManager).moveTaskToFront(taskId, 0) }
|
||||
} else {
|
||||
unfocusPending = true
|
||||
DualScreenPanel.returnFocus(this)
|
||||
DualScreenPanel.returnFocus(this, fromPanel = true)
|
||||
window.decorView.postDelayed({
|
||||
if (!unfocusPending || DualScreenPanel.typingShown) return@postDelayed
|
||||
if (window.decorView.hasWindowFocus()) DualScreenPanel.returnFocus(this) else dropFocus()
|
||||
if (window.decorView.hasWindowFocus()) DualScreenPanel.returnFocus(this, fromPanel = true) else dropFocus()
|
||||
}, 400)
|
||||
}
|
||||
}
|
||||
@@ -228,9 +242,24 @@ class DualScreenActivity : ComponentActivity() {
|
||||
if (!DualScreenPanel.typingShown) DualScreenPanel.returnFocus(this)
|
||||
}
|
||||
|
||||
private var topResumed = false
|
||||
private var fresh = true
|
||||
private var touchedAt = Long.MIN_VALUE
|
||||
|
||||
override fun onTopResumedActivityChanged(isTopResumedActivity: Boolean) {
|
||||
super.onTopResumedActivityChanged(isTopResumedActivity)
|
||||
if (isTopResumedActivity && !DualScreenPanel.typingShown) DualScreenPanel.returnFocus(this)
|
||||
topResumed = isTopResumedActivity
|
||||
val took = DualScreenPanel.tookFocus(fresh, touchedAt, android.os.SystemClock.uptimeMillis())
|
||||
fresh = false
|
||||
if (isTopResumedActivity && !DualScreenPanel.typingShown) DualScreenPanel.returnFocus(this, fromPanel = took)
|
||||
}
|
||||
|
||||
override fun dispatchTouchEvent(event: android.view.MotionEvent): Boolean {
|
||||
if (event.actionMasked == android.view.MotionEvent.ACTION_DOWN) {
|
||||
touchedAt = event.downTime
|
||||
if (topResumed && !DualScreenPanel.typingShown) DualScreenPanel.returnFocus(this, fromPanel = true)
|
||||
}
|
||||
return super.dispatchTouchEvent(event)
|
||||
}
|
||||
|
||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
||||
@@ -251,6 +280,7 @@ class DualScreenActivity : ComponentActivity() {
|
||||
if (event.action == KeyEvent.ACTION_UP && !event.isCanceled) DualScreenPanel.finishTyping()
|
||||
return true
|
||||
}
|
||||
if (topResumed && !DualScreenPanel.typingShown && event.action == KeyEvent.ACTION_DOWN) DualScreenPanel.returnFocus(this, fromPanel = true)
|
||||
return super.dispatchKeyEvent(event)
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,8 @@ private fun UserAppPage(app: UserApps.App, s: FrontEndState, a: FrontEndActions,
|
||||
val ctx = LocalContext.current
|
||||
val narrow = LocalNarrowPane.current
|
||||
var editing by rememberSaveable(app.key) { mutableStateOf(false) }
|
||||
val x86 = (app.arch == "x86_64" || app.arch == "i386") && app.fex != com.droiddeck.launcher.runtime.LinuxFex.OFF
|
||||
val x86 = (app.arch == "x86_64" || app.arch == "i386") && app.fex != com.droiddeck.launcher.runtime.LinuxFex.OFF &&
|
||||
app.kind != UserApps.Kind.FLATPAK
|
||||
val fexReady by produceState<Boolean?>(null, app.key, x86, s.sessionRunning) {
|
||||
value = if (x86) kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) { com.droiddeck.launcher.runtime.LinuxFex.ready(ctx) } else true
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
modifier = Modifier.weight(1f).fillMaxWidth().verticalScroll(pageScroll.getValue(page)),
|
||||
) { CompositionLocalProvider(LocalChipMinWidth provides 96.dp, LocalCompactSettings provides true) {
|
||||
when (page) {
|
||||
SessionDrawerPage.HUD -> FusionHudSettings(host, a) { key -> focus.track(page, key) }
|
||||
SessionDrawerPage.HUD -> DroidDeckHudSettings(host, a) { key -> focus.track(page, key) }
|
||||
SessionDrawerPage.DISPLAY -> {
|
||||
SettingsGroup(stringResource(R.string.drawer_page_display)) {
|
||||
val fgOpen = host.open == "fg"
|
||||
|
||||
@@ -709,7 +709,6 @@
|
||||
<string name="hud_export_failed">تعذّر حفظ تقرير HUD.</string>
|
||||
<string name="hud_reset">إعادة ضبط إعدادات HUD</string>
|
||||
<string name="hud_reset_button">إعادة ضبط</string>
|
||||
<string name="hud_credit">FusionHUD من The412Banner، github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">وضع التحجيم</string>
|
||||
<string name="drawer_scaling_sharpness">حدة التحجيم</string>
|
||||
<string name="drawer_effects">مؤثرات الشاشة</string>
|
||||
@@ -1783,6 +1782,8 @@
|
||||
<string name="fm_accept">موافق</string>
|
||||
<string name="fm_decline">رفض</string>
|
||||
<string name="fm_drive_not_readable">تم تركيب %1$s لكن تتعذّر قراءته حاليًا</string>
|
||||
<string name="fm_drive_access_title">السماح بالوصول إلى %1$s</string>
|
||||
<string name="fm_drive_access_text">يتيح Android لتطبيق DroidDeck رؤية محرك الأقراص هذا دون قراءته. فعّل الوصول إلى جميع الملفات لتطبيق DroidDeck ثم عُد.</string>
|
||||
<string name="fm_list_view">عرض القائمة</string>
|
||||
<string name="fm_grid_view">عرض الشبكة</string>
|
||||
<string name="fm_search">بحث</string>
|
||||
@@ -1892,6 +1893,7 @@
|
||||
<string name="flatpakmgr_not_ready">أعِدّ Flatpak أولاً</string>
|
||||
<string name="flatpakmgr_starting">جارٍ البدء</string>
|
||||
<string name="flatpakmgr_exit_status">خرج Flatpak بالحالة %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">تم بناء %1$s لمعمارية %2$s، ولا يستطيع DroidDeck تشغيلها. تحتاج تطبيقات Flatpak هنا إلى إصدار لمعمارية ARM64 أو x86_64.</string>
|
||||
<string name="flatpakmgr_installing">جارٍ تثبيت %1$s</string>
|
||||
<string name="flatpakmgr_updating">جارٍ تحديث %1$s</string>
|
||||
<string name="flatpakmgr_removing">جارٍ إزالة %1$s</string>
|
||||
|
||||
@@ -703,7 +703,6 @@
|
||||
<string name="hud_export_failed">No se pudo guardar el informe del HUD.</string>
|
||||
<string name="hud_reset">Restablecer ajustes del HUD</string>
|
||||
<string name="hud_reset_button">Restablecer</string>
|
||||
<string name="hud_credit">FusionHUD de The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Modo de escalado</string>
|
||||
<string name="drawer_scaling_sharpness">Nitidez del escalado</string>
|
||||
<string name="drawer_effects">Efectos de pantalla</string>
|
||||
@@ -1784,6 +1783,8 @@
|
||||
<string name="fm_accept">Aceptar</string>
|
||||
<string name="fm_decline">Rechazar</string>
|
||||
<string name="fm_drive_not_readable">%1$s está montado, pero ahora mismo no se puede leer</string>
|
||||
<string name="fm_drive_access_title">Permitir acceso a %1$s</string>
|
||||
<string name="fm_drive_access_text">Android deja que DroidDeck vea esta unidad, pero no que la lea. Activa Acceso a todos los archivos para DroidDeck y vuelve.</string>
|
||||
<string name="fm_list_view">Vista de lista</string>
|
||||
<string name="fm_grid_view">Vista de cuadrícula</string>
|
||||
<string name="fm_search">Buscar</string>
|
||||
@@ -1884,6 +1885,7 @@
|
||||
<string name="flatpakmgr_not_ready">Configura Flatpak primero</string>
|
||||
<string name="flatpakmgr_starting">Iniciando</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak terminó con el código %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s está compilado para %2$s, que DroidDeck no puede ejecutar. Aquí las apps Flatpak necesitan una versión para ARM64 o x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Instalando %1$s</string>
|
||||
<string name="flatpakmgr_updating">Actualizando %1$s</string>
|
||||
<string name="flatpakmgr_removing">Quitando %1$s</string>
|
||||
|
||||
@@ -701,7 +701,6 @@
|
||||
<string name="hud_export_failed">Отчетът за HUD не можа да бъде записан.</string>
|
||||
<string name="hud_reset">Нулиране на настройките на HUD</string>
|
||||
<string name="hud_reset_button">Нулиране</string>
|
||||
<string name="hud_credit">FusionHUD от The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Режим на мащабиране</string>
|
||||
<string name="drawer_scaling_sharpness">Острота на мащабиране</string>
|
||||
<string name="drawer_effects">Ефекти на екрана</string>
|
||||
@@ -1699,6 +1698,8 @@
|
||||
<string name="fm_accept">Приемам</string>
|
||||
<string name="fm_decline">Отказвам</string>
|
||||
<string name="fm_drive_not_readable">%1$s е монтирано, но в момента не може да се прочете</string>
|
||||
<string name="fm_drive_access_title">Разрешаване на достъп до %1$s</string>
|
||||
<string name="fm_drive_access_text">Android позволява на DroidDeck да вижда това устройство, но не и да го чете. Включете Достъп до всички файлове за DroidDeck и се върнете.</string>
|
||||
<string name="fm_list_view">Изглед като списък</string>
|
||||
<string name="fm_grid_view">Изглед като мрежа</string>
|
||||
<string name="fm_search">Търсене</string>
|
||||
@@ -1800,6 +1801,7 @@
|
||||
<string name="flatpakmgr_not_ready">Настрой Flatpak първо</string>
|
||||
<string name="flatpakmgr_starting">Стартиране</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak приключи със код %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s е създадено за %2$s, което DroidDeck не може да изпълнява. Приложенията Flatpak тук трябва да са за ARM64 или x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Инсталиране на %1$s</string>
|
||||
<string name="flatpakmgr_updating">Актуализиране на %1$s</string>
|
||||
<string name="flatpakmgr_removing">Премахване на %1$s</string>
|
||||
|
||||
@@ -705,7 +705,6 @@
|
||||
<string name="hud_export_failed">Zprávu HUD se nepodařilo uložit.</string>
|
||||
<string name="hud_reset">Obnovit nastavení HUD</string>
|
||||
<string name="hud_reset_button">Obnovit</string>
|
||||
<string name="hud_credit">FusionHUD od The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Režim škálování</string>
|
||||
<string name="drawer_scaling_sharpness">Ostrost škálování</string>
|
||||
<string name="drawer_effects">Efekty obrazovky</string>
|
||||
@@ -1741,6 +1740,8 @@
|
||||
<string name="fm_accept">Přijmout</string>
|
||||
<string name="fm_decline">Odmítnout</string>
|
||||
<string name="fm_drive_not_readable">%1$s je připojeno, ale momentálně není čitelné</string>
|
||||
<string name="fm_drive_access_title">Povolit přístup k %1$s</string>
|
||||
<string name="fm_drive_access_text">Android umožňuje aplikaci DroidDeck tento disk vidět, ale ne číst. Zapněte pro DroidDeck Přístup ke všem souborům a pak se vraťte.</string>
|
||||
<string name="fm_list_view">Zobrazení seznamu</string>
|
||||
<string name="fm_grid_view">Zobrazení mřížky</string>
|
||||
<string name="fm_search">Hledat</string>
|
||||
@@ -1846,6 +1847,7 @@
|
||||
<string name="flatpakmgr_not_ready">Nejprve nastavte Flatpak</string>
|
||||
<string name="flatpakmgr_starting">Spouštění</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak skončil s návratovým kódem %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s je sestaveno pro %2$s, které DroidDeck neumí spustit. Aplikace Flatpak zde potřebují verzi pro ARM64 nebo x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Instalování %1$s</string>
|
||||
<string name="flatpakmgr_updating">Aktualizování %1$s</string>
|
||||
<string name="flatpakmgr_removing">Odstraňování %1$s</string>
|
||||
|
||||
@@ -701,7 +701,6 @@
|
||||
<string name="hud_export_failed">HUD-rapporten kunne ikke gemmes.</string>
|
||||
<string name="hud_reset">Nulstil HUD-indstillinger</string>
|
||||
<string name="hud_reset_button">Nulstil</string>
|
||||
<string name="hud_credit">FusionHUD af The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Skaleringstilstand</string>
|
||||
<string name="drawer_scaling_sharpness">Skaleringsskarphed</string>
|
||||
<string name="drawer_effects">Skærmeffekter</string>
|
||||
@@ -1699,6 +1698,8 @@
|
||||
<string name="fm_accept">Accepter</string>
|
||||
<string name="fm_decline">Afvis</string>
|
||||
<string name="fm_drive_not_readable">%1$s er monteret, men kan ikke læses lige nu</string>
|
||||
<string name="fm_drive_access_title">Giv adgang til %1$s</string>
|
||||
<string name="fm_drive_access_text">Android lader DroidDeck se dette drev, men ikke læse det. Slå Adgang til alle filer til for DroidDeck, og kom så tilbage.</string>
|
||||
<string name="fm_list_view">Listevisning</string>
|
||||
<string name="fm_grid_view">Gittervisning</string>
|
||||
<string name="fm_search">Søg</string>
|
||||
@@ -1800,6 +1801,7 @@
|
||||
<string name="flatpakmgr_not_ready">Opsæt Flatpak først</string>
|
||||
<string name="flatpakmgr_starting">Starter</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak afsluttede med status %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s er bygget til %2$s, som DroidDeck ikke kan køre. Flatpak-apps her skal være bygget til ARM64 eller x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Installerer %1$s</string>
|
||||
<string name="flatpakmgr_updating">Opdaterer %1$s</string>
|
||||
<string name="flatpakmgr_removing">Fjerner %1$s</string>
|
||||
|
||||
@@ -701,7 +701,6 @@
|
||||
<string name="hud_export_failed">Der HUD-Bericht konnte nicht gespeichert werden.</string>
|
||||
<string name="hud_reset">HUD-Einstellungen zurücksetzen</string>
|
||||
<string name="hud_reset_button">Zurücksetzen</string>
|
||||
<string name="hud_credit">FusionHUD von The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Skalierungsmodus</string>
|
||||
<string name="drawer_scaling_sharpness">Skalierungsschärfe</string>
|
||||
<string name="drawer_effects">Bildschirmeffekte</string>
|
||||
@@ -1691,6 +1690,8 @@
|
||||
<string name="fm_accept">Akzeptieren</string>
|
||||
<string name="fm_decline">Ablehnen</string>
|
||||
<string name="fm_drive_not_readable">%1$s ist eingebunden, aber derzeit nicht lesbar</string>
|
||||
<string name="fm_drive_access_title">Zugriff auf %1$s erlauben</string>
|
||||
<string name="fm_drive_access_text">Android lässt DroidDeck dieses Laufwerk sehen, aber nicht lesen. Aktiviere für DroidDeck den Zugriff auf alle Dateien und komm dann zurück.</string>
|
||||
<string name="fm_list_view">Listenansicht</string>
|
||||
<string name="fm_grid_view">Rasteransicht</string>
|
||||
<string name="fm_search">Suchen</string>
|
||||
@@ -1792,6 +1793,7 @@
|
||||
<string name="flatpakmgr_not_ready">Richte zuerst Flatpak ein</string>
|
||||
<string name="flatpakmgr_starting">Wird gestartet</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak wurde mit Status %1$d beendet</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s wurde für %2$s gebaut, das DroidDeck nicht ausführen kann. Flatpak-Apps brauchen hier eine ARM64- oder x86_64-Version.</string>
|
||||
<string name="flatpakmgr_installing">%1$s wird installiert</string>
|
||||
<string name="flatpakmgr_updating">%1$s wird aktualisiert</string>
|
||||
<string name="flatpakmgr_removing">%1$s wird entfernt</string>
|
||||
|
||||
@@ -701,7 +701,6 @@
|
||||
<string name="hud_export_failed">Δεν ήταν δυνατή η αποθήκευση της αναφοράς HUD.</string>
|
||||
<string name="hud_reset">Επαναφορά ρυθμίσεων HUD</string>
|
||||
<string name="hud_reset_button">Επαναφορά</string>
|
||||
<string name="hud_credit">FusionHUD από The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Λειτουργία κλιμάκωσης</string>
|
||||
<string name="drawer_scaling_sharpness">Οξύτητα κλιμάκωσης</string>
|
||||
<string name="drawer_effects">Εφέ οθόνης</string>
|
||||
@@ -1699,6 +1698,8 @@
|
||||
<string name="fm_accept">Αποδοχή</string>
|
||||
<string name="fm_decline">Απόρριψη</string>
|
||||
<string name="fm_drive_not_readable">Το %1$s είναι προσαρτημένο αλλά δεν είναι αναγνώσιμο αυτή τη στιγμή</string>
|
||||
<string name="fm_drive_access_title">Να επιτραπεί η πρόσβαση στο %1$s</string>
|
||||
<string name="fm_drive_access_text">Το Android επιτρέπει στο DroidDeck να βλέπει αυτόν τον δίσκο αλλά όχι να τον διαβάζει. Ενεργοποιήστε την Πρόσβαση σε όλα τα αρχεία για το DroidDeck και επιστρέψτε.</string>
|
||||
<string name="fm_list_view">Προβολή λίστας</string>
|
||||
<string name="fm_grid_view">Προβολή πλέγματος</string>
|
||||
<string name="fm_search">Αναζήτηση</string>
|
||||
@@ -1800,6 +1801,7 @@
|
||||
<string name="flatpakmgr_not_ready">Ρυθμίστε πρώτα το Flatpak</string>
|
||||
<string name="flatpakmgr_starting">Γίνεται εκκίνηση</string>
|
||||
<string name="flatpakmgr_exit_status">Το Flatpak έκλεισε με κατάσταση %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">Το %1$s είναι φτιαγμένο για %2$s, που το DroidDeck δεν μπορεί να εκτελέσει. Οι εφαρμογές Flatpak εδώ χρειάζονται έκδοση για ARM64 ή x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Εγκατάσταση %1$s</string>
|
||||
<string name="flatpakmgr_updating">Ενημέρωση %1$s</string>
|
||||
<string name="flatpakmgr_removing">Κατάργηση %1$s</string>
|
||||
|
||||
@@ -703,7 +703,6 @@
|
||||
<string name="hud_export_failed">No se ha podido guardar el informe del HUD.</string>
|
||||
<string name="hud_reset">Restablecer ajustes del HUD</string>
|
||||
<string name="hud_reset_button">Restablecer</string>
|
||||
<string name="hud_credit">FusionHUD de The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Modo de escalado</string>
|
||||
<string name="drawer_scaling_sharpness">Nitidez del escalado</string>
|
||||
<string name="drawer_effects">Efectos de pantalla</string>
|
||||
@@ -1720,6 +1719,8 @@
|
||||
<string name="fm_accept">Aceptar</string>
|
||||
<string name="fm_decline">Rechazar</string>
|
||||
<string name="fm_drive_not_readable">%1$s está montado, pero ahora mismo no se puede leer</string>
|
||||
<string name="fm_drive_access_title">Permitir acceso a %1$s</string>
|
||||
<string name="fm_drive_access_text">Android deja que DroidDeck vea esta unidad, pero no que la lea. Activa Acceso a todos los archivos para DroidDeck y vuelve.</string>
|
||||
<string name="fm_list_view">Vista de lista</string>
|
||||
<string name="fm_grid_view">Vista de cuadrícula</string>
|
||||
<string name="fm_search">Buscar</string>
|
||||
@@ -1823,6 +1824,7 @@
|
||||
<string name="flatpakmgr_not_ready">Configura Flatpak primero</string>
|
||||
<string name="flatpakmgr_starting">Iniciando</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak terminó con el código %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s está compilado para %2$s, que DroidDeck no puede ejecutar. Aquí las apps Flatpak necesitan una versión para ARM64 o x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Instalando %1$s</string>
|
||||
<string name="flatpakmgr_updating">Actualizando %1$s</string>
|
||||
<string name="flatpakmgr_removing">Quitando %1$s</string>
|
||||
|
||||
@@ -701,7 +701,6 @@
|
||||
<string name="hud_export_failed">HUD-raporttia ei voitu tallentaa.</string>
|
||||
<string name="hud_reset">Palauta HUD-asetukset</string>
|
||||
<string name="hud_reset_button">Palauta</string>
|
||||
<string name="hud_credit">FusionHUD, tekijä The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Skaalaustila</string>
|
||||
<string name="drawer_scaling_sharpness">Skaalauksen terävyys</string>
|
||||
<string name="drawer_effects">Näyttötehosteet</string>
|
||||
@@ -1699,6 +1698,8 @@
|
||||
<string name="fm_accept">Hyväksy</string>
|
||||
<string name="fm_decline">Hylkää</string>
|
||||
<string name="fm_drive_not_readable">%1$s on liitetty, mutta ei ole luettavissa juuri nyt</string>
|
||||
<string name="fm_drive_access_title">Salli pääsy kohteeseen %1$s</string>
|
||||
<string name="fm_drive_access_text">Android antaa DroidDeckin nähdä tämän aseman mutta ei lukea sitä. Ota DroidDeckille käyttöön Pääsy kaikkiin tiedostoihin ja palaa sitten takaisin.</string>
|
||||
<string name="fm_list_view">Luettelonäkymä</string>
|
||||
<string name="fm_grid_view">Ruudukkonäkymä</string>
|
||||
<string name="fm_search">Hae</string>
|
||||
@@ -1800,6 +1801,7 @@
|
||||
<string name="flatpakmgr_not_ready">Asenna Flatpak ensin</string>
|
||||
<string name="flatpakmgr_starting">Käynnistetään</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak sulkeutui tilakoodilla %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s on tehty alustalle %2$s, jota DroidDeck ei pysty ajamaan. Flatpak-sovelluksista tarvitaan täällä ARM64- tai x86_64-versio.</string>
|
||||
<string name="flatpakmgr_installing">Asennetaan %1$s</string>
|
||||
<string name="flatpakmgr_updating">Päivitetään %1$s</string>
|
||||
<string name="flatpakmgr_removing">Poistetaan %1$s</string>
|
||||
|
||||
@@ -703,7 +703,6 @@
|
||||
<string name="hud_export_failed">Impossible d\'enregistrer le rapport du HUD.</string>
|
||||
<string name="hud_reset">Réinitialiser les paramètres du HUD</string>
|
||||
<string name="hud_reset_button">Réinitialiser</string>
|
||||
<string name="hud_credit">FusionHUD par The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Mode de mise à l\'échelle</string>
|
||||
<string name="drawer_scaling_sharpness">Netteté de la mise à l\'échelle</string>
|
||||
<string name="drawer_effects">Effets d\'écran</string>
|
||||
@@ -1720,6 +1719,8 @@
|
||||
<string name="fm_accept">Accepter</string>
|
||||
<string name="fm_decline">Refuser</string>
|
||||
<string name="fm_drive_not_readable">%1$s est monté, mais illisible pour le moment</string>
|
||||
<string name="fm_drive_access_title">Autoriser l\'accès à %1$s</string>
|
||||
<string name="fm_drive_access_text">Android permet à DroidDeck de voir ce lecteur, mais pas de le lire. Activez l\'accès à tous les fichiers pour DroidDeck, puis revenez.</string>
|
||||
<string name="fm_list_view">Vue en liste</string>
|
||||
<string name="fm_grid_view">Vue en grille</string>
|
||||
<string name="fm_search">Rechercher</string>
|
||||
@@ -1823,6 +1824,7 @@
|
||||
<string name="flatpakmgr_not_ready">Configurez d\'abord Flatpak</string>
|
||||
<string name="flatpakmgr_starting">Démarrage</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak s\'est arrêté avec le code %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s est compilée pour %2$s, que DroidDeck ne peut pas exécuter. Ici, les applis Flatpak doivent exister en version ARM64 ou x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Installation : %1$s</string>
|
||||
<string name="flatpakmgr_updating">Mise à jour : %1$s</string>
|
||||
<string name="flatpakmgr_removing">Suppression : %1$s</string>
|
||||
|
||||
@@ -701,7 +701,6 @@
|
||||
<string name="hud_export_failed">HUD रिपोर्ट सेव नहीं हो सकी।</string>
|
||||
<string name="hud_reset">HUD सेटिंग रीसेट करें</string>
|
||||
<string name="hud_reset_button">रीसेट करें</string>
|
||||
<string name="hud_credit">The412Banner का FusionHUD, github.com/The412Banner/FusionHUD (GPL-3.0)।</string>
|
||||
<string name="drawer_scaling">स्केलिंग मोड</string>
|
||||
<string name="drawer_scaling_sharpness">स्केलिंग शार्पनेस</string>
|
||||
<string name="drawer_effects">स्क्रीन इफ़ेक्ट</string>
|
||||
@@ -1699,6 +1698,8 @@
|
||||
<string name="fm_accept">स्वीकार करें</string>
|
||||
<string name="fm_decline">अस्वीकार करें</string>
|
||||
<string name="fm_drive_not_readable">%1$s माउंट है लेकिन अभी पढ़ा नहीं जा सकता</string>
|
||||
<string name="fm_drive_access_title">%1$s तक पहुँच दें</string>
|
||||
<string name="fm_drive_access_text">Android, DroidDeck को यह ड्राइव दिखाता है पर पढ़ने नहीं देता। DroidDeck के लिए सभी फ़ाइलों का ऐक्सेस चालू करें, फिर वापस आएँ।</string>
|
||||
<string name="fm_list_view">लिस्ट व्यू</string>
|
||||
<string name="fm_grid_view">ग्रिड व्यू</string>
|
||||
<string name="fm_search">सर्च</string>
|
||||
@@ -1800,6 +1801,7 @@
|
||||
<string name="flatpakmgr_not_ready">पहले Flatpak सेट करें</string>
|
||||
<string name="flatpakmgr_starting">शुरू हो रहा है</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak status %1$d के साथ बंद हुआ</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s %2$s के लिए बना है, जिसे DroidDeck नहीं चला सकता। यहाँ Flatpak ऐप ARM64 या x86_64 के लिए बने होने चाहिए।</string>
|
||||
<string name="flatpakmgr_installing">%1$s इंस्टॉल हो रहा है</string>
|
||||
<string name="flatpakmgr_updating">%1$s अपडेट हो रहा है</string>
|
||||
<string name="flatpakmgr_removing">%1$s हटाया जा रहा है</string>
|
||||
|
||||
@@ -701,7 +701,6 @@
|
||||
<string name="hud_export_failed">Nem sikerült menteni a HUD-jelentést.</string>
|
||||
<string name="hud_reset">HUD-beállítások visszaállítása</string>
|
||||
<string name="hud_reset_button">Visszaállítás</string>
|
||||
<string name="hud_credit">FusionHUD, készítette: The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Méretezési mód</string>
|
||||
<string name="drawer_scaling_sharpness">Méretezési élesség</string>
|
||||
<string name="drawer_effects">Képernyőeffektek</string>
|
||||
@@ -1699,6 +1698,8 @@
|
||||
<string name="fm_accept">Elfogadom</string>
|
||||
<string name="fm_decline">Elutasítom</string>
|
||||
<string name="fm_drive_not_readable">A %1$s csatolva van, de jelenleg nem olvasható</string>
|
||||
<string name="fm_drive_access_title">Hozzáférés engedélyezése: %1$s</string>
|
||||
<string name="fm_drive_access_text">Az Android látni engedi a DroidDecknek ezt a meghajtót, de olvasni nem. Kapcsold be a DroidDecknél az Összes fájlhoz való hozzáférést, majd gyere vissza.</string>
|
||||
<string name="fm_list_view">Listanézet</string>
|
||||
<string name="fm_grid_view">Rácsnézet</string>
|
||||
<string name="fm_search">Keresés</string>
|
||||
@@ -1800,6 +1801,7 @@
|
||||
<string name="flatpakmgr_not_ready">Előbb állítsa be a Flatpakot</string>
|
||||
<string name="flatpakmgr_starting">Indítás</string>
|
||||
<string name="flatpakmgr_exit_status">A Flatpak %1$d állapotkóddal lépett ki</string>
|
||||
<string name="flatpakmgr_wrong_arch">A(z) %1$s %2$s rendszerre készült, ezt a DroidDeck nem tudja futtatni. Az itteni Flatpak-alkalmazásoknak ARM64- vagy x86_64-változat kell.</string>
|
||||
<string name="flatpakmgr_installing">%1$s telepítése</string>
|
||||
<string name="flatpakmgr_updating">%1$s frissítése</string>
|
||||
<string name="flatpakmgr_removing">%1$s eltávolítása</string>
|
||||
|
||||
@@ -699,7 +699,6 @@
|
||||
<string name="hud_export_failed">Tidak dapat menyimpan laporan HUD.</string>
|
||||
<string name="hud_reset">Setel ulang setelan HUD</string>
|
||||
<string name="hud_reset_button">Setel ulang</string>
|
||||
<string name="hud_credit">FusionHUD oleh The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Mode penskalaan</string>
|
||||
<string name="drawer_scaling_sharpness">Ketajaman penskalaan</string>
|
||||
<string name="drawer_effects">Efek layar</string>
|
||||
@@ -1678,6 +1677,8 @@
|
||||
<string name="fm_accept">Terima</string>
|
||||
<string name="fm_decline">Tolak</string>
|
||||
<string name="fm_drive_not_readable">%1$s terpasang tetapi tidak dapat dibaca saat ini</string>
|
||||
<string name="fm_drive_access_title">Izinkan akses ke %1$s</string>
|
||||
<string name="fm_drive_access_text">Android mengizinkan DroidDeck melihat drive ini tetapi tidak membacanya. Aktifkan Akses semua file untuk DroidDeck, lalu kembali.</string>
|
||||
<string name="fm_list_view">Tampilan daftar</string>
|
||||
<string name="fm_grid_view">Tampilan kisi</string>
|
||||
<string name="fm_search">Cari</string>
|
||||
@@ -1777,6 +1778,7 @@
|
||||
<string name="flatpakmgr_not_ready">Siapkan Flatpak terlebih dahulu</string>
|
||||
<string name="flatpakmgr_starting">Memulai</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak keluar dengan status %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s dibuat untuk %2$s, yang tidak dapat dijalankan DroidDeck. Aplikasi Flatpak di sini memerlukan versi ARM64 atau x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Menginstal %1$s</string>
|
||||
<string name="flatpakmgr_updating">Memperbarui %1$s</string>
|
||||
<string name="flatpakmgr_removing">Menghapus %1$s</string>
|
||||
|
||||
@@ -703,7 +703,6 @@
|
||||
<string name="hud_export_failed">Impossibile salvare il rapporto dell\'HUD.</string>
|
||||
<string name="hud_reset">Ripristina impostazioni HUD</string>
|
||||
<string name="hud_reset_button">Ripristina</string>
|
||||
<string name="hud_credit">FusionHUD di The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Modalità di ridimensionamento</string>
|
||||
<string name="drawer_scaling_sharpness">Nitidezza del ridimensionamento</string>
|
||||
<string name="drawer_effects">Effetti schermo</string>
|
||||
@@ -1712,6 +1711,8 @@
|
||||
<string name="fm_accept">Accetta</string>
|
||||
<string name="fm_decline">Rifiuta</string>
|
||||
<string name="fm_drive_not_readable">%1$s: montata ma al momento non leggibile</string>
|
||||
<string name="fm_drive_access_title">Consenti l\'accesso a %1$s</string>
|
||||
<string name="fm_drive_access_text">Android permette a DroidDeck di vedere questa unità ma non di leggerla. Attiva Accesso a tutti i file per DroidDeck, poi torna qui.</string>
|
||||
<string name="fm_list_view">Visualizzazione elenco</string>
|
||||
<string name="fm_grid_view">Visualizzazione griglia</string>
|
||||
<string name="fm_search">Cerca</string>
|
||||
@@ -1815,6 +1816,7 @@
|
||||
<string name="flatpakmgr_not_ready">Configura prima Flatpak</string>
|
||||
<string name="flatpakmgr_starting">Avvio</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak è terminato con stato %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s è compilata per %2$s, che DroidDeck non può eseguire. Qui le app Flatpak richiedono una versione per ARM64 o x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Installazione di %1$s</string>
|
||||
<string name="flatpakmgr_updating">Aggiornamento di %1$s</string>
|
||||
<string name="flatpakmgr_removing">Rimozione di %1$s</string>
|
||||
|
||||
@@ -688,7 +688,6 @@
|
||||
<string name="hud_export_failed">HUDレポートを保存できませんでした。</string>
|
||||
<string name="hud_reset">HUD設定をリセット</string>
|
||||
<string name="hud_reset_button">リセット</string>
|
||||
<string name="hud_credit">FusionHUD 作者:The412Banner、github.com/The412Banner/FusionHUD (GPL-3.0)。</string>
|
||||
<string name="drawer_scaling">スケーリングモード</string>
|
||||
<string name="drawer_scaling_sharpness">スケーリングのシャープネス</string>
|
||||
<string name="drawer_effects">画面エフェクト</string>
|
||||
@@ -1649,6 +1648,8 @@
|
||||
<string name="fm_accept">承諾</string>
|
||||
<string name="fm_decline">拒否</string>
|
||||
<string name="fm_drive_not_readable">%1$sはマウントされていますが、現在読み取れません</string>
|
||||
<string name="fm_drive_access_title">%1$sへのアクセスを許可</string>
|
||||
<string name="fm_drive_access_text">Android では DroidDeck がこのドライブを表示できますが、読み取れません。DroidDeck の「全ファイルへのアクセス」をオンにしてから戻ってください。</string>
|
||||
<string name="fm_list_view">リスト表示</string>
|
||||
<string name="fm_grid_view">グリッド表示</string>
|
||||
<string name="fm_search">検索</string>
|
||||
@@ -1748,6 +1749,7 @@
|
||||
<string name="flatpakmgr_not_ready">先にFlatpakをセットアップしてください</string>
|
||||
<string name="flatpakmgr_starting">開始中</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpakがステータス%1$dで終了しました</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s は DroidDeck で実行できない %2$s 向けにビルドされています。ここでは Flatpak アプリに ARM64 または x86_64 版が必要です。</string>
|
||||
<string name="flatpakmgr_installing">%1$sをインストール中</string>
|
||||
<string name="flatpakmgr_updating">%1$sを更新中</string>
|
||||
<string name="flatpakmgr_removing">%1$sを削除中</string>
|
||||
|
||||
@@ -699,7 +699,6 @@
|
||||
<string name="hud_export_failed">HUD 보고서를 저장할 수 없습니다.</string>
|
||||
<string name="hud_reset">HUD 설정 초기화</string>
|
||||
<string name="hud_reset_button">초기화</string>
|
||||
<string name="hud_credit">FusionHUD 제작: The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">스케일링 모드</string>
|
||||
<string name="drawer_scaling_sharpness">스케일링 선명도</string>
|
||||
<string name="drawer_effects">화면 효과</string>
|
||||
@@ -1678,6 +1677,8 @@
|
||||
<string name="fm_accept">수락</string>
|
||||
<string name="fm_decline">거절</string>
|
||||
<string name="fm_drive_not_readable">%1$s이(가) 마운트되었지만 지금은 읽을 수 없습니다</string>
|
||||
<string name="fm_drive_access_title">%1$s 액세스 허용</string>
|
||||
<string name="fm_drive_access_text">Android에서 DroidDeck이 이 드라이브를 볼 수는 있지만 읽을 수는 없습니다. DroidDeck의 모든 파일 액세스를 켠 다음 돌아오세요.</string>
|
||||
<string name="fm_list_view">목록 보기</string>
|
||||
<string name="fm_grid_view">격자 보기</string>
|
||||
<string name="fm_search">검색</string>
|
||||
@@ -1777,6 +1778,7 @@
|
||||
<string name="flatpakmgr_not_ready">먼저 Flatpak을 설정하세요</string>
|
||||
<string name="flatpakmgr_starting">시작 중</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak이 종료되었습니다(상태 %1$d)</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s은(는) DroidDeck이 실행할 수 없는 %2$s용으로 빌드되었습니다. 여기서 Flatpak 앱은 ARM64 또는 x86_64 빌드여야 합니다.</string>
|
||||
<string name="flatpakmgr_installing">%1$s 설치 중</string>
|
||||
<string name="flatpakmgr_updating">%1$s 업데이트 중</string>
|
||||
<string name="flatpakmgr_removing">%1$s 제거 중</string>
|
||||
|
||||
@@ -699,7 +699,6 @@
|
||||
<string name="hud_export_failed">Tidak dapat menyimpan laporan HUD.</string>
|
||||
<string name="hud_reset">Set semula tetapan HUD</string>
|
||||
<string name="hud_reset_button">Set semula</string>
|
||||
<string name="hud_credit">FusionHUD oleh The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Mod penskalaan</string>
|
||||
<string name="drawer_scaling_sharpness">Ketajaman penskalaan</string>
|
||||
<string name="drawer_effects">Kesan skrin</string>
|
||||
@@ -1678,6 +1677,8 @@
|
||||
<string name="fm_accept">Terima</string>
|
||||
<string name="fm_decline">Tolak</string>
|
||||
<string name="fm_drive_not_readable">%1$s dilekapkan tetapi tidak dapat dibaca sekarang</string>
|
||||
<string name="fm_drive_access_title">Benarkan akses kepada %1$s</string>
|
||||
<string name="fm_drive_access_text">Android membenarkan DroidDeck melihat pemacu ini tetapi tidak membacanya. Hidupkan Akses semua fail untuk DroidDeck, kemudian kembali.</string>
|
||||
<string name="fm_list_view">Paparan senarai</string>
|
||||
<string name="fm_grid_view">Paparan grid</string>
|
||||
<string name="fm_search">Cari</string>
|
||||
@@ -1777,6 +1778,7 @@
|
||||
<string name="flatpakmgr_not_ready">Sediakan Flatpak dahulu</string>
|
||||
<string name="flatpakmgr_starting">Memulakan</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak keluar dengan status %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s dibina untuk %2$s, yang tidak dapat dijalankan oleh DroidDeck. Apl Flatpak di sini memerlukan binaan ARM64 atau x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Memasang %1$s</string>
|
||||
<string name="flatpakmgr_updating">Mengemas kini %1$s</string>
|
||||
<string name="flatpakmgr_removing">Mengalih keluar %1$s</string>
|
||||
|
||||
@@ -701,7 +701,6 @@
|
||||
<string name="hud_export_failed">Kunne ikke lagre HUD-rapporten.</string>
|
||||
<string name="hud_reset">Tilbakestill HUD-innstillinger</string>
|
||||
<string name="hud_reset_button">Tilbakestill</string>
|
||||
<string name="hud_credit">FusionHUD av The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Skaleringsmodus</string>
|
||||
<string name="drawer_scaling_sharpness">Skaleringsskarphet</string>
|
||||
<string name="drawer_effects">Skjermeffekter</string>
|
||||
@@ -1699,6 +1698,8 @@
|
||||
<string name="fm_accept">Godta</string>
|
||||
<string name="fm_decline">Avslå</string>
|
||||
<string name="fm_drive_not_readable">%1$s er montert, men ikke lesbar akkurat nå</string>
|
||||
<string name="fm_drive_access_title">Gi tilgang til %1$s</string>
|
||||
<string name="fm_drive_access_text">Android lar DroidDeck se denne stasjonen, men ikke lese den. Slå på Tilgang til alle filer for DroidDeck, og kom så tilbake.</string>
|
||||
<string name="fm_list_view">Listevisning</string>
|
||||
<string name="fm_grid_view">Rutenettvisning</string>
|
||||
<string name="fm_search">Søk</string>
|
||||
@@ -1800,6 +1801,7 @@
|
||||
<string name="flatpakmgr_not_ready">Sett opp Flatpak først</string>
|
||||
<string name="flatpakmgr_starting">Starter</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak avsluttet med status %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s er bygget for %2$s, som DroidDeck ikke kan kjøre. Flatpak-apper her trenger en ARM64- eller x86_64-versjon.</string>
|
||||
<string name="flatpakmgr_installing">Installerer %1$s</string>
|
||||
<string name="flatpakmgr_updating">Oppdaterer %1$s</string>
|
||||
<string name="flatpakmgr_removing">Fjerner %1$s</string>
|
||||
|
||||
@@ -701,7 +701,6 @@
|
||||
<string name="hud_export_failed">Kan het HUD-rapport niet opslaan.</string>
|
||||
<string name="hud_reset">HUD-instellingen resetten</string>
|
||||
<string name="hud_reset_button">Resetten</string>
|
||||
<string name="hud_credit">FusionHUD door The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Schaalmodus</string>
|
||||
<string name="drawer_scaling_sharpness">Schaalscherpte</string>
|
||||
<string name="drawer_effects">Schermeffecten</string>
|
||||
@@ -1699,6 +1698,8 @@
|
||||
<string name="fm_accept">Accepteren</string>
|
||||
<string name="fm_decline">Weigeren</string>
|
||||
<string name="fm_drive_not_readable">%1$s is gekoppeld, maar nu niet leesbaar</string>
|
||||
<string name="fm_drive_access_title">Toegang tot %1$s toestaan</string>
|
||||
<string name="fm_drive_access_text">Android laat DroidDeck deze schijf zien, maar niet lezen. Zet Toegang tot alle bestanden aan voor DroidDeck en kom daarna terug.</string>
|
||||
<string name="fm_list_view">Lijstweergave</string>
|
||||
<string name="fm_grid_view">Rasterweergave</string>
|
||||
<string name="fm_search">Zoeken</string>
|
||||
@@ -1800,6 +1801,7 @@
|
||||
<string name="flatpakmgr_not_ready">Stel eerst Flatpak in</string>
|
||||
<string name="flatpakmgr_starting">Starten</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak is gestopt met status %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s is gebouwd voor %2$s, wat DroidDeck niet kan draaien. Flatpak-apps hebben hier een ARM64- of x86_64-versie nodig.</string>
|
||||
<string name="flatpakmgr_installing">%1$s installeren</string>
|
||||
<string name="flatpakmgr_updating">%1$s updaten</string>
|
||||
<string name="flatpakmgr_removing">%1$s verwijderen</string>
|
||||
|
||||
@@ -705,7 +705,6 @@
|
||||
<string name="hud_export_failed">Nie udało się zapisać raportu HUD.</string>
|
||||
<string name="hud_reset">Zresetuj ustawienia HUD</string>
|
||||
<string name="hud_reset_button">Resetuj</string>
|
||||
<string name="hud_credit">FusionHUD autorstwa The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Tryb skalowania</string>
|
||||
<string name="drawer_scaling_sharpness">Ostrość skalowania</string>
|
||||
<string name="drawer_effects">Efekty ekranowe</string>
|
||||
@@ -1741,6 +1740,8 @@
|
||||
<string name="fm_accept">Akceptuj</string>
|
||||
<string name="fm_decline">Odrzuć</string>
|
||||
<string name="fm_drive_not_readable">%1$s: zamontowano, ale obecnie nie można odczytać</string>
|
||||
<string name="fm_drive_access_title">Zezwól na dostęp do %1$s</string>
|
||||
<string name="fm_drive_access_text">Android pozwala DroidDeck widzieć ten dysk, ale nie odczytywać go. Włącz dla DroidDeck dostęp do wszystkich plików, a potem wróć.</string>
|
||||
<string name="fm_list_view">Widok listy</string>
|
||||
<string name="fm_grid_view">Widok siatki</string>
|
||||
<string name="fm_search">Szukaj</string>
|
||||
@@ -1846,6 +1847,7 @@
|
||||
<string name="flatpakmgr_not_ready">Najpierw skonfiguruj Flatpak</string>
|
||||
<string name="flatpakmgr_starting">Rozpoczynanie</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak zakończył działanie z kodem %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s zbudowano dla %2$s, czego DroidDeck nie potrafi uruchomić. Aplikacje Flatpak potrzebują tu wersji dla ARM64 lub x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Instalowanie %1$s</string>
|
||||
<string name="flatpakmgr_updating">Aktualizowanie %1$s</string>
|
||||
<string name="flatpakmgr_removing">Usuwanie %1$s</string>
|
||||
|
||||
@@ -703,7 +703,6 @@
|
||||
<string name="hud_export_failed">Não foi possível guardar o relatório do HUD.</string>
|
||||
<string name="hud_reset">Repor definições do HUD</string>
|
||||
<string name="hud_reset_button">Repor</string>
|
||||
<string name="hud_credit">FusionHUD por The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Modo de escala</string>
|
||||
<string name="drawer_scaling_sharpness">Nitidez da escala</string>
|
||||
<string name="drawer_effects">Efeitos de ecrã</string>
|
||||
@@ -1712,6 +1711,8 @@
|
||||
<string name="fm_accept">Aceitar</string>
|
||||
<string name="fm_decline">Recusar</string>
|
||||
<string name="fm_drive_not_readable">%1$s está montado, mas não é possível lê-lo de momento</string>
|
||||
<string name="fm_drive_access_title">Permitir acesso a %1$s</string>
|
||||
<string name="fm_drive_access_text">O Android deixa o DroidDeck ver esta unidade, mas não lê-la. Ative o Acesso a todos os ficheiros para o DroidDeck e volte.</string>
|
||||
<string name="fm_list_view">Vista de lista</string>
|
||||
<string name="fm_grid_view">Vista de grelha</string>
|
||||
<string name="fm_search">Pesquisar</string>
|
||||
@@ -1815,6 +1816,7 @@
|
||||
<string name="flatpakmgr_not_ready">Configure primeiro o Flatpak</string>
|
||||
<string name="flatpakmgr_starting">A iniciar</string>
|
||||
<string name="flatpakmgr_exit_status">O Flatpak terminou com o código %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s foi compilado para %2$s, que o DroidDeck não consegue executar. Aqui as apps Flatpak precisam de uma versão para ARM64 ou x86_64.</string>
|
||||
<string name="flatpakmgr_installing">A instalar %1$s</string>
|
||||
<string name="flatpakmgr_updating">A atualizar %1$s</string>
|
||||
<string name="flatpakmgr_removing">A remover %1$s</string>
|
||||
|
||||
@@ -703,7 +703,6 @@
|
||||
<string name="hud_export_failed">Não foi possível salvar o relatório do HUD.</string>
|
||||
<string name="hud_reset">Redefinir configurações do HUD</string>
|
||||
<string name="hud_reset_button">Redefinir</string>
|
||||
<string name="hud_credit">FusionHUD por The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Modo de escala</string>
|
||||
<string name="drawer_scaling_sharpness">Nitidez da escala</string>
|
||||
<string name="drawer_effects">Efeitos de tela</string>
|
||||
@@ -1712,6 +1711,8 @@
|
||||
<string name="fm_accept">Aceitar</string>
|
||||
<string name="fm_decline">Recusar</string>
|
||||
<string name="fm_drive_not_readable">%1$s está montado, mas não pode ser lido agora</string>
|
||||
<string name="fm_drive_access_title">Permitir acesso a %1$s</string>
|
||||
<string name="fm_drive_access_text">O Android deixa o DroidDeck ver esta unidade, mas não ler. Ative o Acesso a todos os arquivos para o DroidDeck e volte.</string>
|
||||
<string name="fm_list_view">Visualização em lista</string>
|
||||
<string name="fm_grid_view">Visualização em grade</string>
|
||||
<string name="fm_search">Pesquisar</string>
|
||||
@@ -1815,6 +1816,7 @@
|
||||
<string name="flatpakmgr_not_ready">Configure o Flatpak primeiro</string>
|
||||
<string name="flatpakmgr_starting">Iniciando</string>
|
||||
<string name="flatpakmgr_exit_status">O Flatpak terminou com o código %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s foi compilado para %2$s, que o DroidDeck não consegue executar. Aqui os apps Flatpak precisam de uma versão para ARM64 ou x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Instalando %1$s</string>
|
||||
<string name="flatpakmgr_updating">Atualizando %1$s</string>
|
||||
<string name="flatpakmgr_removing">Removendo %1$s</string>
|
||||
|
||||
@@ -703,7 +703,6 @@
|
||||
<string name="hud_export_failed">Raportul HUD nu a putut fi salvat.</string>
|
||||
<string name="hud_reset">Resetează setările HUD</string>
|
||||
<string name="hud_reset_button">Resetează</string>
|
||||
<string name="hud_credit">FusionHUD de The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Mod de scalare</string>
|
||||
<string name="drawer_scaling_sharpness">Claritatea scalării</string>
|
||||
<string name="drawer_effects">Efecte de ecran</string>
|
||||
@@ -1720,6 +1719,8 @@
|
||||
<string name="fm_accept">Acceptă</string>
|
||||
<string name="fm_decline">Refuză</string>
|
||||
<string name="fm_drive_not_readable">%1$s este montat, dar nu poate fi citit acum</string>
|
||||
<string name="fm_drive_access_title">Permite accesul la %1$s</string>
|
||||
<string name="fm_drive_access_text">Android permite DroidDeck să vadă această unitate, dar nu să o citească. Activează Acces la toate fișierele pentru DroidDeck, apoi revino.</string>
|
||||
<string name="fm_list_view">Vizualizare listă</string>
|
||||
<string name="fm_grid_view">Vizualizare grilă</string>
|
||||
<string name="fm_search">Căutare</string>
|
||||
@@ -1823,6 +1824,7 @@
|
||||
<string name="flatpakmgr_not_ready">Configurează mai întâi Flatpak</string>
|
||||
<string name="flatpakmgr_starting">Se pornește</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak s-a închis cu starea %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s este construită pentru %2$s, pe care DroidDeck nu o poate rula. Aici aplicațiile Flatpak au nevoie de o versiune pentru ARM64 sau x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Se instalează %1$s</string>
|
||||
<string name="flatpakmgr_updating">Se actualizează %1$s</string>
|
||||
<string name="flatpakmgr_removing">Se elimină %1$s</string>
|
||||
|
||||
@@ -705,7 +705,6 @@
|
||||
<string name="hud_export_failed">Не удалось сохранить отчет HUD.</string>
|
||||
<string name="hud_reset">Сбросить настройки HUD</string>
|
||||
<string name="hud_reset_button">Сбросить</string>
|
||||
<string name="hud_credit">FusionHUD от The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Режим масштабирования</string>
|
||||
<string name="drawer_scaling_sharpness">Резкость масштабирования</string>
|
||||
<string name="drawer_effects">Экранные эффекты</string>
|
||||
@@ -1741,6 +1740,8 @@
|
||||
<string name="fm_accept">Принять</string>
|
||||
<string name="fm_decline">Отклонить</string>
|
||||
<string name="fm_drive_not_readable">%1$s: подключено, но сейчас недоступно для чтения</string>
|
||||
<string name="fm_drive_access_title">Разрешить доступ к %1$s</string>
|
||||
<string name="fm_drive_access_text">Android позволяет DroidDeck видеть этот диск, но не читать его. Включите для DroidDeck доступ ко всем файлам и вернитесь.</string>
|
||||
<string name="fm_list_view">Список</string>
|
||||
<string name="fm_grid_view">Сетка</string>
|
||||
<string name="fm_search">Поиск</string>
|
||||
@@ -1846,6 +1847,7 @@
|
||||
<string name="flatpakmgr_not_ready">Сначала настройте Flatpak</string>
|
||||
<string name="flatpakmgr_starting">Запуск</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak завершился с кодом %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s собрано для %2$s, а DroidDeck не может это запустить. Приложениям Flatpak здесь нужна сборка для ARM64 или x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Установка %1$s</string>
|
||||
<string name="flatpakmgr_updating">Обновление %1$s</string>
|
||||
<string name="flatpakmgr_removing">Удаление %1$s</string>
|
||||
|
||||
@@ -701,7 +701,6 @@
|
||||
<string name="hud_export_failed">Det gick inte att spara HUD-rapporten.</string>
|
||||
<string name="hud_reset">Återställ HUD-inställningar</string>
|
||||
<string name="hud_reset_button">Återställ</string>
|
||||
<string name="hud_credit">FusionHUD av The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Skalningsläge</string>
|
||||
<string name="drawer_scaling_sharpness">Skalningsskärpa</string>
|
||||
<string name="drawer_effects">Skärmeffekter</string>
|
||||
@@ -1699,6 +1698,8 @@
|
||||
<string name="fm_accept">Acceptera</string>
|
||||
<string name="fm_decline">Avböj</string>
|
||||
<string name="fm_drive_not_readable">%1$s är monterad men inte läsbar just nu</string>
|
||||
<string name="fm_drive_access_title">Tillåt åtkomst till %1$s</string>
|
||||
<string name="fm_drive_access_text">Android låter DroidDeck se den här enheten men inte läsa den. Slå på Åtkomst till alla filer för DroidDeck och kom sedan tillbaka.</string>
|
||||
<string name="fm_list_view">Listvy</string>
|
||||
<string name="fm_grid_view">Rutnätsvy</string>
|
||||
<string name="fm_search">Sök</string>
|
||||
@@ -1800,6 +1801,7 @@
|
||||
<string name="flatpakmgr_not_ready">Konfigurera Flatpak först</string>
|
||||
<string name="flatpakmgr_starting">Startar</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak avslutades med status %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s är byggd för %2$s, som DroidDeck inte kan köra. Flatpak-appar här behöver en ARM64- eller x86_64-version.</string>
|
||||
<string name="flatpakmgr_installing">Installerar %1$s</string>
|
||||
<string name="flatpakmgr_updating">Uppdaterar %1$s</string>
|
||||
<string name="flatpakmgr_removing">Tar bort %1$s</string>
|
||||
|
||||
@@ -699,7 +699,6 @@
|
||||
<string name="hud_export_failed">บันทึกรายงาน HUD ไม่ได้</string>
|
||||
<string name="hud_reset">รีเซ็ตการตั้งค่า HUD</string>
|
||||
<string name="hud_reset_button">รีเซ็ต</string>
|
||||
<string name="hud_credit">FusionHUD โดย The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0)</string>
|
||||
<string name="drawer_scaling">โหมดการปรับขนาด</string>
|
||||
<string name="drawer_scaling_sharpness">ความคมชัดของการปรับขนาด</string>
|
||||
<string name="drawer_effects">เอฟเฟกต์หน้าจอ</string>
|
||||
@@ -1678,6 +1677,8 @@
|
||||
<string name="fm_accept">ยอมรับ</string>
|
||||
<string name="fm_decline">ปฏิเสธ</string>
|
||||
<string name="fm_drive_not_readable">%1$s ติดตั้งอยู่แต่อ่านไม่ได้ในขณะนี้</string>
|
||||
<string name="fm_drive_access_title">อนุญาตให้เข้าถึง %1$s</string>
|
||||
<string name="fm_drive_access_text">Android ให้ DroidDeck เห็นไดรฟ์นี้แต่อ่านไม่ได้ เปิดสิทธิ์เข้าถึงไฟล์ทั้งหมดให้ DroidDeck แล้วกลับมาที่นี่</string>
|
||||
<string name="fm_list_view">มุมมองรายการ</string>
|
||||
<string name="fm_grid_view">มุมมองตาราง</string>
|
||||
<string name="fm_search">ค้นหา</string>
|
||||
@@ -1777,6 +1778,7 @@
|
||||
<string name="flatpakmgr_not_ready">ตั้งค่า Flatpak ก่อน</string>
|
||||
<string name="flatpakmgr_starting">กำลังเริ่ม</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak ออกด้วยสถานะ %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s สร้างมาสำหรับ %2$s ซึ่ง DroidDeck เรียกใช้ไม่ได้ แอป Flatpak ที่นี่ต้องเป็นเวอร์ชัน ARM64 หรือ x86_64</string>
|
||||
<string name="flatpakmgr_installing">กำลังติดตั้ง %1$s</string>
|
||||
<string name="flatpakmgr_updating">กำลังอัปเดต %1$s</string>
|
||||
<string name="flatpakmgr_removing">กำลังลบ %1$s</string>
|
||||
|
||||
@@ -701,7 +701,6 @@
|
||||
<string name="hud_export_failed">HUD raporu kaydedilemedi.</string>
|
||||
<string name="hud_reset">HUD ayarlarını sıfırla</string>
|
||||
<string name="hud_reset_button">Sıfırla</string>
|
||||
<string name="hud_credit">FusionHUD, yapımcı: The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Ölçekleme modu</string>
|
||||
<string name="drawer_scaling_sharpness">Ölçekleme keskinliği</string>
|
||||
<string name="drawer_effects">Ekran efektleri</string>
|
||||
@@ -1691,6 +1690,8 @@
|
||||
<string name="fm_accept">Kabul et</string>
|
||||
<string name="fm_decline">Reddet</string>
|
||||
<string name="fm_drive_not_readable">%1$s bağlı ancak şu anda okunamıyor</string>
|
||||
<string name="fm_drive_access_title">%1$s erişimine izin ver</string>
|
||||
<string name="fm_drive_access_text">Android, DroidDeck\'in bu sürücüyü görmesine izin veriyor ama okumasına izin vermiyor. DroidDeck için Tüm dosyalara erişimi açın, sonra geri dönün.</string>
|
||||
<string name="fm_list_view">Liste görünümü</string>
|
||||
<string name="fm_grid_view">Izgara görünümü</string>
|
||||
<string name="fm_search">Ara</string>
|
||||
@@ -1792,6 +1793,7 @@
|
||||
<string name="flatpakmgr_not_ready">Önce Flatpak\'i kurun</string>
|
||||
<string name="flatpakmgr_starting">Başlatılıyor</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak %1$d durum koduyla çıktı</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s, DroidDeck\'in çalıştıramadığı %2$s için derlenmiş. Buradaki Flatpak uygulamalarının ARM64 veya x86_64 sürümü olmalı.</string>
|
||||
<string name="flatpakmgr_installing">%1$s yükleniyor</string>
|
||||
<string name="flatpakmgr_updating">%1$s güncelleniyor</string>
|
||||
<string name="flatpakmgr_removing">%1$s kaldırılıyor</string>
|
||||
|
||||
@@ -705,7 +705,6 @@
|
||||
<string name="hud_export_failed">Не вдалося зберегти звіт HUD.</string>
|
||||
<string name="hud_reset">Скинути налаштування HUD</string>
|
||||
<string name="hud_reset_button">Скинути</string>
|
||||
<string name="hud_credit">FusionHUD від The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Режим масштабування</string>
|
||||
<string name="drawer_scaling_sharpness">Чіткість масштабування</string>
|
||||
<string name="drawer_effects">Ефекти екрана</string>
|
||||
@@ -1741,6 +1740,8 @@
|
||||
<string name="fm_accept">Прийняти</string>
|
||||
<string name="fm_decline">Відхилити</string>
|
||||
<string name="fm_drive_not_readable">%1$s: підключено, але читання зараз недоступне</string>
|
||||
<string name="fm_drive_access_title">Дозволити доступ до %1$s</string>
|
||||
<string name="fm_drive_access_text">Android дозволяє DroidDeck бачити цей диск, але не читати його. Увімкніть для DroidDeck доступ до всіх файлів і поверніться.</string>
|
||||
<string name="fm_list_view">Список</string>
|
||||
<string name="fm_grid_view">Сітка</string>
|
||||
<string name="fm_search">Пошук</string>
|
||||
@@ -1846,6 +1847,7 @@
|
||||
<string name="flatpakmgr_not_ready">Спершу налаштуйте Flatpak</string>
|
||||
<string name="flatpakmgr_starting">Запуск</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak завершився з кодом %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s зібрано для %2$s, а DroidDeck не може це запустити. Застосункам Flatpak тут потрібна збірка для ARM64 або x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Встановлення %1$s</string>
|
||||
<string name="flatpakmgr_updating">Оновлення %1$s</string>
|
||||
<string name="flatpakmgr_removing">Видалення %1$s</string>
|
||||
|
||||
@@ -699,7 +699,6 @@
|
||||
<string name="hud_export_failed">Không thể lưu báo cáo HUD.</string>
|
||||
<string name="hud_reset">Đặt lại thiết lập HUD</string>
|
||||
<string name="hud_reset_button">Đặt lại</string>
|
||||
<string name="hud_credit">FusionHUD của The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Chế độ chia tỷ lệ</string>
|
||||
<string name="drawer_scaling_sharpness">Độ sắc nét khi chia tỷ lệ</string>
|
||||
<string name="drawer_effects">Hiệu ứng màn hình</string>
|
||||
@@ -1678,6 +1677,8 @@
|
||||
<string name="fm_accept">Chấp nhận</string>
|
||||
<string name="fm_decline">Từ chối</string>
|
||||
<string name="fm_drive_not_readable">%1$s đã được gắn nhưng hiện không đọc được</string>
|
||||
<string name="fm_drive_access_title">Cho phép truy cập %1$s</string>
|
||||
<string name="fm_drive_access_text">Android cho DroidDeck thấy ổ này nhưng không đọc được. Hãy bật Quyền truy cập mọi tệp cho DroidDeck rồi quay lại.</string>
|
||||
<string name="fm_list_view">Xem dạng danh sách</string>
|
||||
<string name="fm_grid_view">Xem dạng lưới</string>
|
||||
<string name="fm_search">Tìm kiếm</string>
|
||||
@@ -1777,6 +1778,7 @@
|
||||
<string name="flatpakmgr_not_ready">Thiết lập Flatpak trước</string>
|
||||
<string name="flatpakmgr_starting">Đang khởi động</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak đã thoát với mã %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s được dựng cho %2$s, DroidDeck không chạy được. Ứng dụng Flatpak ở đây cần bản ARM64 hoặc x86_64.</string>
|
||||
<string name="flatpakmgr_installing">Đang cài %1$s</string>
|
||||
<string name="flatpakmgr_updating">Đang cập nhật %1$s</string>
|
||||
<string name="flatpakmgr_removing">Đang gỡ %1$s</string>
|
||||
|
||||
@@ -688,7 +688,6 @@
|
||||
<string name="hud_export_failed">无法保存 HUD 报告。</string>
|
||||
<string name="hud_reset">重置 HUD 设置</string>
|
||||
<string name="hud_reset_button">重置</string>
|
||||
<string name="hud_credit">FusionHUD,作者 The412Banner,github.com/The412Banner/FusionHUD (GPL-3.0)。</string>
|
||||
<string name="drawer_scaling">缩放模式</string>
|
||||
<string name="drawer_scaling_sharpness">缩放锐度</string>
|
||||
<string name="drawer_effects">屏幕效果</string>
|
||||
@@ -1726,6 +1725,8 @@
|
||||
<string name="fm_accept">接受</string>
|
||||
<string name="fm_decline">拒绝</string>
|
||||
<string name="fm_drive_not_readable">%1$s 已挂载,但当前无法读取</string>
|
||||
<string name="fm_drive_access_title">允许访问 %1$s</string>
|
||||
<string name="fm_drive_access_text">Android 允许 DroidDeck 看到此驱动器,但不允许读取。请为 DroidDeck 开启“所有文件访问权限”,然后返回。</string>
|
||||
<string name="fm_list_view">列表视图</string>
|
||||
<string name="fm_grid_view">网格视图</string>
|
||||
<string name="fm_search">搜索</string>
|
||||
@@ -1825,6 +1826,7 @@
|
||||
<string name="flatpakmgr_not_ready">请先配置 Flatpak</string>
|
||||
<string name="flatpakmgr_starting">启动中</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak 已退出,状态码 %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s 是为 %2$s 构建的,DroidDeck 无法运行。这里的 Flatpak 应用需要 ARM64 或 x86_64 版本。</string>
|
||||
<string name="flatpakmgr_installing">正在安装 %1$s</string>
|
||||
<string name="flatpakmgr_updating">正在更新 %1$s</string>
|
||||
<string name="flatpakmgr_removing">正在移除 %1$s</string>
|
||||
|
||||
@@ -688,7 +688,6 @@
|
||||
<string name="hud_export_failed">無法儲存 HUD 報告。</string>
|
||||
<string name="hud_reset">重設 HUD 設定</string>
|
||||
<string name="hud_reset_button">重設</string>
|
||||
<string name="hud_credit">FusionHUD,作者 The412Banner,github.com/The412Banner/FusionHUD (GPL-3.0)。</string>
|
||||
<string name="drawer_scaling">縮放模式</string>
|
||||
<string name="drawer_scaling_sharpness">縮放銳利度</string>
|
||||
<string name="drawer_effects">畫面效果</string>
|
||||
@@ -1649,6 +1648,8 @@
|
||||
<string name="fm_accept">接受</string>
|
||||
<string name="fm_decline">拒絕</string>
|
||||
<string name="fm_drive_not_readable">%1$s 已掛載,但目前無法讀取</string>
|
||||
<string name="fm_drive_access_title">允許存取 %1$s</string>
|
||||
<string name="fm_drive_access_text">Android 允許 DroidDeck 看到此磁碟,但不允許讀取。請為 DroidDeck 開啟「所有檔案存取權」,然後返回。</string>
|
||||
<string name="fm_list_view">清單檢視</string>
|
||||
<string name="fm_grid_view">格狀檢視</string>
|
||||
<string name="fm_search">搜尋</string>
|
||||
@@ -1748,6 +1749,7 @@
|
||||
<string name="flatpakmgr_not_ready">請先設定 Flatpak</string>
|
||||
<string name="flatpakmgr_starting">正在開始</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak 已結束,狀態為 %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s 是為 %2$s 建置的,DroidDeck 無法執行。這裡的 Flatpak 應用程式需要 ARM64 或 x86_64 版本。</string>
|
||||
<string name="flatpakmgr_installing">正在安裝 %1$s</string>
|
||||
<string name="flatpakmgr_updating">正在更新 %1$s</string>
|
||||
<string name="flatpakmgr_removing">正在移除 %1$s</string>
|
||||
|
||||
@@ -688,7 +688,6 @@
|
||||
<string name="hud_export_failed">無法儲存 HUD 報告。</string>
|
||||
<string name="hud_reset">重設 HUD 設定</string>
|
||||
<string name="hud_reset_button">重設</string>
|
||||
<string name="hud_credit">FusionHUD,作者 The412Banner,github.com/The412Banner/FusionHUD (GPL-3.0)。</string>
|
||||
<string name="drawer_scaling">縮放模式</string>
|
||||
<string name="drawer_scaling_sharpness">縮放銳利度</string>
|
||||
<string name="drawer_effects">畫面效果</string>
|
||||
@@ -1649,6 +1648,8 @@
|
||||
<string name="fm_accept">接受</string>
|
||||
<string name="fm_decline">拒絕</string>
|
||||
<string name="fm_drive_not_readable">%1$s 已掛載,但目前無法讀取</string>
|
||||
<string name="fm_drive_access_title">允許存取 %1$s</string>
|
||||
<string name="fm_drive_access_text">Android 允許 DroidDeck 看到這個磁碟,但不允許讀取。請為 DroidDeck 開啟「所有檔案存取權」,然後返回。</string>
|
||||
<string name="fm_list_view">清單檢視</string>
|
||||
<string name="fm_grid_view">格狀檢視</string>
|
||||
<string name="fm_search">搜尋</string>
|
||||
@@ -1748,6 +1749,7 @@
|
||||
<string name="flatpakmgr_not_ready">請先設定 Flatpak</string>
|
||||
<string name="flatpakmgr_starting">正在啟動</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak 已結束,狀態碼 %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s 是為 %2$s 建置的,DroidDeck 無法執行。這裡的 Flatpak 應用程式需要 ARM64 或 x86_64 版本。</string>
|
||||
<string name="flatpakmgr_installing">正在安裝 %1$s</string>
|
||||
<string name="flatpakmgr_updating">正在更新 %1$s</string>
|
||||
<string name="flatpakmgr_removing">正在移除 %1$s</string>
|
||||
|
||||
@@ -725,7 +725,6 @@
|
||||
<string name="hud_export_failed">Couldn\'t save the HUD report.</string>
|
||||
<string name="hud_reset">Reset HUD settings</string>
|
||||
<string name="hud_reset_button">Reset</string>
|
||||
<string name="hud_credit">FusionHUD by The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
|
||||
<string name="drawer_scaling">Scaling mode</string>
|
||||
<string name="drawer_scaling_sharpness">Scaling sharpness</string>
|
||||
<string name="drawer_effects">Screen effects</string>
|
||||
@@ -1792,6 +1791,8 @@
|
||||
<string name="fm_accept">Accept</string>
|
||||
<string name="fm_decline">Decline</string>
|
||||
<string name="fm_drive_not_readable">%1$s is mounted but not readable right now</string>
|
||||
<string name="fm_drive_access_title">Allow access to %1$s</string>
|
||||
<string name="fm_drive_access_text">Android lets DroidDeck see this drive but not read it. Turn on All files access for DroidDeck, then come back.</string>
|
||||
<string name="fm_list_view">List view</string>
|
||||
<string name="fm_grid_view">Grid view</string>
|
||||
<string name="fm_search">Search</string>
|
||||
@@ -1904,6 +1905,7 @@
|
||||
<string name="flatpakmgr_not_ready">Set up Flatpak first</string>
|
||||
<string name="flatpakmgr_starting">Starting</string>
|
||||
<string name="flatpakmgr_exit_status">Flatpak exited with status %1$d</string>
|
||||
<string name="flatpakmgr_wrong_arch">%1$s is built for %2$s, which DroidDeck can\'t run. Flatpak apps here need an ARM64 or x86_64 build.</string>
|
||||
<string name="flatpakmgr_installing">Installing %1$s</string>
|
||||
<string name="flatpakmgr_updating">Updating %1$s</string>
|
||||
<string name="flatpakmgr_removing">Removing %1$s</string>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.droiddeck.launcher.files
|
||||
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class AllFilesAccessTest {
|
||||
@Test
|
||||
fun androidTenAndOlderNeverAsks() {
|
||||
assertFalse(AllFilesAccess.missing(sdk = 29) { false })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun androidElevenAsksUntilGranted() {
|
||||
assertTrue(AllFilesAccess.missing(sdk = 30) { false })
|
||||
assertFalse(AllFilesAccess.missing(sdk = 30) { true })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun newerAndroidAsksUntilGranted() {
|
||||
assertTrue(AllFilesAccess.missing(sdk = 35) { false })
|
||||
assertFalse(AllFilesAccess.missing(sdk = 35) { true })
|
||||
}
|
||||
}
|
||||
+31
-16
@@ -2,7 +2,6 @@ package com.droiddeck.launcher.hud
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.os.Looper
|
||||
import android.os.SystemClock
|
||||
import android.view.MotionEvent
|
||||
@@ -22,19 +21,18 @@ import org.robolectric.annotation.GraphicsMode
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.time.Duration
|
||||
import java.util.Base64
|
||||
import kotlin.math.roundToInt
|
||||
import kotlin.math.sqrt
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [33], qualifiers = "xhdpi")
|
||||
@GraphicsMode(GraphicsMode.Mode.NATIVE)
|
||||
class FusionHudPanelTest {
|
||||
class DroidDeckHudPanelTest {
|
||||
@Test fun minimalIsTheSizeTheHudStartsWith() {
|
||||
assertEquals(FusionSize.MINIMAL, FusionSize.from(FusionHudConfig.DEFAULTS["hudSize"]))
|
||||
assertEquals(DroidDeckHudSize.MINIMAL, DroidDeckHudSize.from(DroidDeckHudConfig.DEFAULTS["hudSize"]))
|
||||
}
|
||||
|
||||
@Test fun theHudStartsLocked() {
|
||||
assertEquals("1", FusionHudConfig.DEFAULTS["hudLocked"])
|
||||
assertEquals("1", DroidDeckHudConfig.DEFAULTS["hudLocked"])
|
||||
}
|
||||
|
||||
@Test fun everySizeDrawsTheDPanelWithEverythingInsideIt() {
|
||||
@@ -46,9 +44,9 @@ class FusionHudPanelTest {
|
||||
stats.add(frametime, now)
|
||||
}
|
||||
val snapshot = SNAPSHOT
|
||||
for (size in FusionSize.values()) {
|
||||
val view = FusionHudView(RuntimeEnvironment.getApplication())
|
||||
view.applyConfig(FusionHudConfig.encode(FusionHudConfig.DEFAULTS + ("hudSize" to size.token)))
|
||||
for (size in DroidDeckHudSize.values()) {
|
||||
val view = DroidDeckHudView(RuntimeEnvironment.getApplication())
|
||||
view.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudSize" to size.token)))
|
||||
view.setFrameStats(stats)
|
||||
view.showForTest(snapshot, "DXVK", now)
|
||||
val unspecified = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
|
||||
@@ -58,7 +56,7 @@ class FusionHudPanelTest {
|
||||
view.draw(Canvas(bitmap))
|
||||
|
||||
val png = ByteArrayOutputStream().also { bitmap.compress(Bitmap.CompressFormat.PNG, 100, it) }
|
||||
println("FUSIONHUD-${size.token.uppercase()}-PNG ${Base64.getEncoder().encodeToString(png.toByteArray())}")
|
||||
println("DROIDDECKHUD-${size.token.uppercase()}-PNG ${Base64.getEncoder().encodeToString(png.toByteArray())}")
|
||||
|
||||
val panel = view.panelForTest()!!
|
||||
assertTrue("$size panel inside the view",
|
||||
@@ -69,15 +67,13 @@ class FusionHudPanelTest {
|
||||
val edge = panel.right - r + sqrt(r * r - d * d)
|
||||
assertTrue("$size graph clears the round side", graph.right <= edge)
|
||||
}
|
||||
val orb = bitmap.getPixel(panel.left.roundToInt() + 1, panel.centerY().roundToInt())
|
||||
assertTrue("$size orb on the left side", Color.blue(orb) > 200 && Color.alpha(orb) > 200)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun pillShowsEachBatteryPartOnItsOwnSwitch() {
|
||||
fun pill(vararg settings: Pair<String, String>): List<String> {
|
||||
val view = FusionHudView(RuntimeEnvironment.getApplication())
|
||||
view.applyConfig(FusionHudConfig.encode(FusionHudConfig.DEFAULTS + ("hudSize" to FusionSize.PILL.token) + settings))
|
||||
val view = DroidDeckHudView(RuntimeEnvironment.getApplication())
|
||||
view.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudSize" to DroidDeckHudSize.PILL.token) + settings))
|
||||
view.showForTest(SNAPSHOT, "DXVK", 0L)
|
||||
return view.linesForTest()
|
||||
}
|
||||
@@ -104,7 +100,7 @@ class FusionHudPanelTest {
|
||||
val under = View(app).apply {
|
||||
setOnTouchListener { _, e -> if (e.actionMasked == MotionEvent.ACTION_DOWN) reached++; true }
|
||||
}
|
||||
val hud = FusionHudView(app)
|
||||
val hud = DroidDeckHudView(app)
|
||||
val parent = FrameLayout(app)
|
||||
parent.addView(under, FrameLayout.LayoutParams(2000, 2000))
|
||||
parent.addView(hud, FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT))
|
||||
@@ -112,7 +108,7 @@ class FusionHudPanelTest {
|
||||
hud.passesTouchAt = { _, _ -> control }
|
||||
val locks = ArrayList<Boolean>()
|
||||
hud.setOnLockChangedListener { locks += it }
|
||||
hud.applyConfig(FusionHudConfig.encode(FusionHudConfig.DEFAULTS + ("hudLocked" to "0")))
|
||||
hud.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudLocked" to "0")))
|
||||
hud.showForTest(SNAPSHOT, "DXVK", 0L)
|
||||
val exactly = View.MeasureSpec.makeMeasureSpec(2000, View.MeasureSpec.EXACTLY)
|
||||
parent.measure(exactly, exactly)
|
||||
@@ -129,7 +125,7 @@ class FusionHudPanelTest {
|
||||
control = true
|
||||
touch()
|
||||
assertEquals("an unlocked HUD keeps the touch (tap, drag, long press)", 0, reached)
|
||||
hud.applyConfig(FusionHudConfig.encode(FusionHudConfig.DEFAULTS + ("hudLocked" to "1")))
|
||||
hud.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudLocked" to "1")))
|
||||
touch()
|
||||
assertEquals("a locked HUD passes it to the control under it", 1, reached)
|
||||
control = false
|
||||
@@ -139,6 +135,25 @@ class FusionHudPanelTest {
|
||||
assertEquals("a long press there unlocks it", listOf(false), locks)
|
||||
}
|
||||
|
||||
@Test fun aDockedHudIsJustTheFpsTabAndATapBringsItBack() {
|
||||
val app = RuntimeEnvironment.getApplication()
|
||||
val hud = DroidDeckHudView(app)
|
||||
hud.applyConfig(DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudSize" to "full") + ("hudDock" to "left")))
|
||||
hud.showForTest(SNAPSHOT, "DXVK", 0L)
|
||||
val unspecified = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
|
||||
hud.measure(unspecified, unspecified)
|
||||
hud.layout(0, 0, hud.measuredWidth, hud.measuredHeight)
|
||||
assertEquals(DroidDeckHudDock.LEFT, hud.dock)
|
||||
assertTrue("a tab, not the panel: ${hud.width}x${hud.height}", hud.width < 400 && hud.height < 200)
|
||||
val docks = ArrayList<String>()
|
||||
hud.setOnDockChangedListener { docks += it }
|
||||
val down = SystemClock.uptimeMillis()
|
||||
MotionEvent.obtain(down, down, MotionEvent.ACTION_DOWN, 5f, 5f, 0).also { hud.dispatchTouchEvent(it); it.recycle() }
|
||||
MotionEvent.obtain(down, down + 40, MotionEvent.ACTION_UP, 5f, 5f, 0).also { hud.dispatchTouchEvent(it); it.recycle() }
|
||||
shadowOf(Looper.getMainLooper()).idle()
|
||||
assertEquals("a locked, docked HUD still answers a tap", listOf("none"), docks)
|
||||
}
|
||||
|
||||
private companion object {
|
||||
val SNAPSHOT = HudMetrics.Snapshot(64, 52, 3302, 1050, 89, 79, 10_800_000_000L, 16_000_000_000L, 67f,
|
||||
1_800_000_000L, HudMetrics.Battery(16f, false, 79, 34, null),
|
||||
@@ -119,6 +119,27 @@ class BwrapSpawnerPlanTest {
|
||||
assertEquals("org.example.Game", plan.env["FLATPAK_ID"])
|
||||
}
|
||||
|
||||
@Test fun sandboxesStartThroughTheirOwnEnvByDefault() {
|
||||
val plan = BwrapSpawner.plan(RuntimeEnvironment.getApplication(), request(op("t" to "dir", "dest" to "/tmp")), dir)
|
||||
assertEquals("/usr/bin/env", plan.envTool)
|
||||
}
|
||||
|
||||
@Test fun fexSandboxesStartThroughTheEnvTheyBringAndSkipArmPreloads() {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
val rootfs = LinuxRuntime.rootDir(context)
|
||||
val lib = File(rootfs, "usr/local/lib/libblsession.so").apply { parentFile?.mkdirs(); writeText("") }
|
||||
val preload = File(rootfs, "etc/ld.so.preload").apply { parentFile?.mkdirs(); writeText("/usr/local/lib/libblsession.so\n") }
|
||||
try {
|
||||
val plan = BwrapSpawner.plan(context, request(op("t" to "dir", "dest" to "/tmp"))
|
||||
.put("envTool", "/run/droiddeck-fex/bin/env"), dir)
|
||||
assertEquals("/run/droiddeck-fex/bin/env", plan.envTool)
|
||||
assertFalse(plan.env.containsKey("LD_PRELOAD"))
|
||||
assertFalse(plan.binds.any { it.guest.startsWith("/run/droiddeck-preload") })
|
||||
} finally {
|
||||
listOf(lib, preload).forEach { it.delete() }
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun sandboxedAppsSeeTheSessionsNetworkLink() {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
val rootfs = LinuxRuntime.rootDir(context)
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.droiddeck.launcher.runtime
|
||||
|
||||
import org.junit.After
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
||||
class FlatpakManagerArchTest {
|
||||
private lateinit var dir: File
|
||||
|
||||
@Before fun setUp() {
|
||||
dir = Files.createTempDirectory("flatpak-arch").toFile()
|
||||
}
|
||||
|
||||
@After fun tearDown() {
|
||||
dir.deleteRecursively()
|
||||
}
|
||||
|
||||
private fun install(arch: String, branch: String) {
|
||||
File(dir, "$arch/$branch/active").mkdirs()
|
||||
}
|
||||
|
||||
@Test fun armDevicesAlsoListX86Builds() {
|
||||
assertEquals(listOf("aarch64", "x86_64"), FlatpakManager.arches("aarch64"))
|
||||
assertEquals(listOf("x86_64"), FlatpakManager.arches("x86_64"))
|
||||
}
|
||||
|
||||
@Test fun anX86OnlyInstallIsFound() {
|
||||
install("x86_64", "master")
|
||||
val (arch, branch) = FlatpakManager.installedBranch(dir, "aarch64")!!
|
||||
assertEquals("x86_64", arch)
|
||||
assertEquals("master", branch.name)
|
||||
}
|
||||
|
||||
@Test fun theNativeBuildWinsWhenBothAreInstalled() {
|
||||
install("x86_64", "master")
|
||||
install("aarch64", "stable")
|
||||
assertEquals("aarch64", FlatpakManager.installedBranch(dir, "aarch64")!!.first)
|
||||
}
|
||||
|
||||
@Test fun aBranchWithoutAnActiveDeployIsNotInstalled() {
|
||||
File(dir, "x86_64/master").mkdirs()
|
||||
assertNull(FlatpakManager.installedBranch(dir, "aarch64"))
|
||||
}
|
||||
|
||||
@Test fun x86BuildsOnArmLaunchWithTheirArch() {
|
||||
val x86 = FlatpakManager.App("io.github.ebkr.r2modman", "r2modman", null, "master", null, "x86_64")
|
||||
val arm = FlatpakManager.App("org.example.App", "App", null, "stable", null, "aarch64")
|
||||
assertEquals(listOf("--arch=x86_64", "io.github.ebkr.r2modman"), FlatpakManager.launchArgs(x86, "aarch64"))
|
||||
assertEquals(listOf("org.example.App"), FlatpakManager.launchArgs(arm, "aarch64"))
|
||||
}
|
||||
}
|
||||
@@ -40,8 +40,8 @@ class SettingsResetTest {
|
||||
SessionPrefs.setHudShowGraph(app, false)
|
||||
SessionPrefs.setHudColor(app, "amber")
|
||||
SessionPrefs.setHudOpacity(app, 40)
|
||||
SessionPrefs.setFusionHudConfig(app, "hudSize=mega,showFPSGraph=0")
|
||||
SessionPrefs.setFusionHudPosition(app, 120f, 40f)
|
||||
SessionPrefs.setDroidDeckHudConfig(app, "hudSize=mega,showFPSGraph=0")
|
||||
SessionPrefs.setDroidDeckHudPosition(app, 120f, 40f)
|
||||
ControllerPrefs.setOpacity(app, 40)
|
||||
AppUiPrefs.setScale(app, 150)
|
||||
FrameGen.set(app, FrameGen.Mode(FrameGen.ENGINE_DDFG, 3))
|
||||
@@ -66,8 +66,8 @@ class SettingsResetTest {
|
||||
assertTrue(SessionPrefs.hudShowGraph(app))
|
||||
assertEquals(SessionPrefs.HUD_COLOR_MINT, SessionPrefs.hudColor(app))
|
||||
assertEquals(SessionPrefs.HUD_OPACITY_DEFAULT, SessionPrefs.hudOpacity(app))
|
||||
assertNull(SessionPrefs.fusionHudConfig(app))
|
||||
assertNull(SessionPrefs.fusionHudPosition(app))
|
||||
assertNull(SessionPrefs.droidDeckHudConfig(app))
|
||||
assertNull(SessionPrefs.droidDeckHudPosition(app))
|
||||
assertEquals(100, ControllerPrefs.read(app).opacity)
|
||||
assertEquals(AppUiPrefs.DEFAULT_SCALE, AppUiPrefs.scale(app))
|
||||
assertEquals(FrameGen.Mode.OFF.engine, FrameGen.engine(app))
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.droiddeck.launcher.ui
|
||||
|
||||
import org.junit.After
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
@@ -29,4 +32,46 @@ class DualScreenPanelOwnerTest {
|
||||
DualScreenPanel.hide(10)
|
||||
assertEquals(-1, DualScreenPanel.shownOn)
|
||||
}
|
||||
|
||||
@Test fun aPausedLauncherIsOnlyBroughtBackWhenThePanelTookFocusItself() {
|
||||
DualScreenPanel.show(app, 2, 10)
|
||||
assertEquals(10, DualScreenPanel.focusTask(fromPanel = false))
|
||||
DualScreenPanel.ownerPaused(10, true)
|
||||
assertNull(DualScreenPanel.focusTask(fromPanel = false))
|
||||
assertEquals(10, DualScreenPanel.focusTask(fromPanel = true))
|
||||
DualScreenPanel.ownerPaused(10, false)
|
||||
assertEquals(10, DualScreenPanel.focusTask(fromPanel = false))
|
||||
}
|
||||
|
||||
@Test fun anAppTheLauncherOpenedKeepsItsScreenEvenAfterABottomScreenTouch() {
|
||||
DualScreenPanel.show(app, 2, 10)
|
||||
DualScreenPanel.yieldTo(10, true)
|
||||
DualScreenPanel.ownerPaused(10, true)
|
||||
assertNull(DualScreenPanel.focusTask(fromPanel = true))
|
||||
DualScreenPanel.yieldTo(10, false)
|
||||
assertEquals(10, DualScreenPanel.focusTask(fromPanel = true))
|
||||
}
|
||||
|
||||
@Test fun anotherTasksPauseDoesNotStopThePanelReturningFocus() {
|
||||
DualScreenPanel.show(app, 2, 10)
|
||||
DualScreenPanel.ownerPaused(11, true)
|
||||
assertEquals(10, DualScreenPanel.focusTask(fromPanel = false))
|
||||
}
|
||||
|
||||
@Test fun aNewPanelForgetsThatTheLastLauncherWasPaused() {
|
||||
DualScreenPanel.show(app, 2, 10)
|
||||
DualScreenPanel.ownerPaused(10, true)
|
||||
DualScreenPanel.hide()
|
||||
DualScreenPanel.show(app, 2, 10)
|
||||
assertEquals(10, DualScreenPanel.focusTask(fromPanel = false))
|
||||
}
|
||||
|
||||
@Test fun thePanelTookFocusWhenItJustOpenedOrWasJustTouched() {
|
||||
assertTrue(DualScreenPanel.tookFocus(fresh = true, touchedAt = Long.MIN_VALUE, now = 5_000L))
|
||||
assertTrue(DualScreenPanel.tookFocus(fresh = false, touchedAt = 4_700L, now = 5_000L))
|
||||
assertTrue(DualScreenPanel.tookFocus(fresh = false, touchedAt = 5_000L, now = 5_000L))
|
||||
assertFalse(DualScreenPanel.tookFocus(fresh = false, touchedAt = 3_500L, now = 5_000L))
|
||||
assertFalse(DualScreenPanel.tookFocus(fresh = false, touchedAt = Long.MIN_VALUE, now = 5_000L))
|
||||
assertFalse(DualScreenPanel.tookFocus(fresh = false, touchedAt = 6_000L, now = 5_000L))
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.0 MiB |
@@ -6,6 +6,7 @@ import os
|
||||
import signal
|
||||
import socket
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
SOCKET_FILE = "/etc/droiddeck/bwrap-socket"
|
||||
@@ -23,6 +24,11 @@ def socket_name():
|
||||
|
||||
|
||||
SOCKET = socket_name()
|
||||
FEX_DIR = "/run/droiddeck-fex"
|
||||
OWN_FEX = "/usr/local"
|
||||
X86_MACHINES = (3, 62)
|
||||
ARM_LIBS = "/usr/lib/aarch64-linux-gnu"
|
||||
ARM_LOADER = "/usr/lib/ld-linux-aarch64.so.1"
|
||||
VERSION = "bubblewrap 0.11.0 (droiddeck)"
|
||||
|
||||
NO_ARG = {
|
||||
@@ -91,6 +97,7 @@ class Spec:
|
||||
self.lock_files = []
|
||||
self.command = []
|
||||
self.argv0 = None
|
||||
self.env_tool = None
|
||||
|
||||
|
||||
def parse(argv):
|
||||
@@ -217,6 +224,134 @@ def host_path(s, path):
|
||||
return path
|
||||
|
||||
|
||||
def sandbox_link(s, path):
|
||||
for op in reversed(s.ops):
|
||||
if op.get("dest", "").rstrip("/") != path:
|
||||
continue
|
||||
if op["t"] == "symlink":
|
||||
return op["target"]
|
||||
if op["t"] == "bind":
|
||||
return None
|
||||
break
|
||||
here = sandbox_source(s, path)
|
||||
return os.readlink(here) if os.path.islink(here) else None
|
||||
|
||||
|
||||
def sandbox_source(s, path):
|
||||
for op in reversed(s.ops):
|
||||
if op["t"] != "bind":
|
||||
continue
|
||||
dest = op["dest"].rstrip("/")
|
||||
if path == dest or path.startswith(dest + "/"):
|
||||
return real(op["src"]).rstrip("/") + path[len(dest):]
|
||||
return path
|
||||
|
||||
|
||||
def sandbox_file(s, path):
|
||||
parts = [p for p in path.split("/") if p]
|
||||
done = "/"
|
||||
hops = 0
|
||||
i = 0
|
||||
while i < len(parts):
|
||||
step = os.path.join(done, parts[i])
|
||||
link = sandbox_link(s, step)
|
||||
if link is None:
|
||||
done = step
|
||||
i += 1
|
||||
continue
|
||||
hops += 1
|
||||
if hops > 40:
|
||||
return None
|
||||
base = "/" if link.startswith("/") else done
|
||||
parts = [p for p in os.path.normpath(os.path.join(base, link)).split("/") if p] + parts[i + 1:]
|
||||
done = "/"
|
||||
i = 0
|
||||
here = sandbox_source(s, done)
|
||||
return here if os.path.isfile(here) else None
|
||||
|
||||
|
||||
def program_path(s, program):
|
||||
if "/" in program:
|
||||
return os.path.normpath(os.path.join(s.cwd or "/", program))
|
||||
for folder in s.env.get("PATH", "/usr/bin:/bin").split(":"):
|
||||
if not folder:
|
||||
continue
|
||||
candidate = os.path.normpath(os.path.join(s.cwd or "/", folder, program))
|
||||
if sandbox_file(s, candidate):
|
||||
return candidate
|
||||
return None
|
||||
|
||||
|
||||
def machine(s, path, depth=0):
|
||||
here = sandbox_file(s, path)
|
||||
if here is None:
|
||||
return None
|
||||
try:
|
||||
with open(here, "rb") as f:
|
||||
head = f.read(256)
|
||||
except OSError:
|
||||
return None
|
||||
if head[:4] == b"\x7fELF" and len(head) >= 20:
|
||||
return struct.unpack("<H" if head[5] == 1 else ">H", head[18:20])[0]
|
||||
if head[:2] == b"#!" and depth < 4:
|
||||
words = head[2:].split(b"\n")[0].split()
|
||||
if words:
|
||||
return machine(s, words[0].decode("utf-8", "replace"), depth + 1)
|
||||
return None
|
||||
|
||||
|
||||
def own_fex():
|
||||
return all(os.access(os.path.join(OWN_FEX, "bin", name), os.X_OK) for name in ("FEX", "FEXServer")) \
|
||||
and os.path.isfile(os.path.join(OWN_FEX, "lib", "libxxhash.so.0"))
|
||||
|
||||
|
||||
def fex_ready():
|
||||
if own_fex():
|
||||
return True
|
||||
try:
|
||||
subprocess.call([os.path.join(OWN_FEX, "bin", "droiddeck-fex-update")], stdout=sys.stderr)
|
||||
except OSError:
|
||||
return False
|
||||
return own_fex()
|
||||
|
||||
|
||||
def start_fex_server():
|
||||
try:
|
||||
subprocess.Popen([os.path.join(OWN_FEX, "bin", "FEXServer"), "-p", "30"], stdin=subprocess.DEVNULL,
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, start_new_session=True)
|
||||
except OSError as e:
|
||||
sys.stderr.write("bwrap: could not start FEXServer: %s\n" % e)
|
||||
|
||||
|
||||
def through_fex(s):
|
||||
program = program_path(s, s.command[0])
|
||||
if program is None or machine(s, program) not in X86_MACHINES:
|
||||
return False
|
||||
if not fex_ready():
|
||||
sys.stderr.write("bwrap: %s is an x86 program and FEX is not installed\n" % program)
|
||||
return False
|
||||
for src, dest in ((os.path.join(OWN_FEX, "bin", "FEX"), FEX_DIR + "/bin/FEX"),
|
||||
(os.path.join(OWN_FEX, "bin", "FEXServer"), FEX_DIR + "/bin/FEXServer"),
|
||||
(os.path.join(OWN_FEX, "lib", "libxxhash.so.0"), FEX_DIR + "/lib/libxxhash.so.0"),
|
||||
("/usr/bin/env", FEX_DIR + "/bin/env"),
|
||||
(ARM_LIBS, ARM_LIBS),
|
||||
(real(ARM_LOADER), ARM_LOADER)):
|
||||
s.ops.append({"t": "bind", "src": src, "dest": dest, "try": False, "ro": True})
|
||||
data = s.env.get("XDG_CACHE_HOME") or "/tmp"
|
||||
s.env["FEX_APP_CONFIG_LOCATION"] = FEX_DIR + "/config/"
|
||||
s.env["FEX_APP_DATA_LOCATION"] = data + "/droiddeck-fex/"
|
||||
s.env["FEX_APP_CACHE_LOCATION"] = data + "/droiddeck-fex/cache/"
|
||||
for name in ("FEX_ROOTFS", "FEX_THUNKHOSTLIBS", "FEX_THUNKGUESTLIBS", "FEX_THUNKCONFIG", "FEX_PORTABLE",
|
||||
"GLIBC_TUNABLES", "MESA_LOADER_DRIVER_OVERRIDE", "GALLIUM_DRIVER", "VK_ICD_FILENAMES",
|
||||
"VK_DRIVER_FILES"):
|
||||
s.env.pop(name, None)
|
||||
s.command = [FEX_DIR + "/bin/FEX", program] + s.command[1:]
|
||||
s.argv0 = None
|
||||
s.env_tool = FEX_DIR + "/bin/env"
|
||||
start_fex_server()
|
||||
return True
|
||||
|
||||
|
||||
def hold_locks(s):
|
||||
for path in s.lock_files:
|
||||
try:
|
||||
@@ -290,6 +425,8 @@ def run_by_app(s):
|
||||
if s.argv0:
|
||||
argv[0] = s.argv0
|
||||
request = {"argv": argv, "env": s.env, "cwd": s.cwd or "/", "ops": ops}
|
||||
if s.env_tool:
|
||||
request["envTool"] = s.env_tool
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
try:
|
||||
sock.connect(SOCKET)
|
||||
@@ -333,8 +470,9 @@ def main():
|
||||
hold_locks(s)
|
||||
if remaps_nothing(s):
|
||||
run_here(s)
|
||||
else:
|
||||
run_by_app(s)
|
||||
return
|
||||
through_fex(s)
|
||||
run_by_app(s)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -109,21 +109,31 @@ def run(t, state, report_done=True):
|
||||
return 0
|
||||
|
||||
|
||||
def arches():
|
||||
native = Flatpak.get_default_arch()
|
||||
return [native, "x86_64"] if native == "aarch64" else [native]
|
||||
|
||||
|
||||
def install(app_id):
|
||||
inst = installation()
|
||||
arch = Flatpak.get_default_arch()
|
||||
if app_ref(inst, app_id) is not None:
|
||||
emit(e="done", note="already installed")
|
||||
return 0
|
||||
branch, last = None, None
|
||||
for candidate in ("stable", "master"):
|
||||
try:
|
||||
branch = inst.fetch_remote_ref_sync(REMOTE, Flatpak.RefKind.APP, app_id, arch, candidate, None).get_branch()
|
||||
arch, branch, last = None, None, None
|
||||
for candidate_arch in arches():
|
||||
for candidate in ("stable", "master"):
|
||||
try:
|
||||
branch = inst.fetch_remote_ref_sync(REMOTE, Flatpak.RefKind.APP, app_id, candidate_arch, candidate,
|
||||
None).get_branch()
|
||||
arch = candidate_arch
|
||||
break
|
||||
except GLib.Error as err:
|
||||
last = err
|
||||
if branch is not None:
|
||||
break
|
||||
except GLib.Error as err:
|
||||
last = err
|
||||
if branch is None:
|
||||
emit(e="error", message="%s is not on Flathub for %s (%s)" % (app_id, arch, last.message if last else "no branch"))
|
||||
emit(e="error", message="%s is not on Flathub for %s (%s)" % (app_id, " or ".join(arches()),
|
||||
last.message if last else "no branch"))
|
||||
return 1
|
||||
t, state = transaction(inst)
|
||||
t.add_install(REMOTE, "app/%s/%s/%s" % (app_id, arch, branch), None)
|
||||
@@ -141,10 +151,15 @@ def install_bundle(path):
|
||||
inst = installation()
|
||||
bundle = Gio.File.new_for_path(path)
|
||||
try:
|
||||
app_id = Flatpak.BundleRef.new(bundle).get_name()
|
||||
ref = Flatpak.BundleRef.new(bundle)
|
||||
app_id = ref.get_name()
|
||||
except GLib.Error as err:
|
||||
emit(e="error", message="%s is not a Flatpak bundle (%s)" % (os.path.basename(path), err.message))
|
||||
return 1
|
||||
if ref.get_arch() not in arches():
|
||||
emit(e="error", code="arch", id=app_id, arch=ref.get_arch(),
|
||||
message="%s is built for %s, not %s" % (app_id, ref.get_arch(), " or ".join(arches())))
|
||||
return 1
|
||||
if app_ref(inst, app_id) is not None:
|
||||
emit(e="done", id=app_id, note="already installed")
|
||||
return 0
|
||||
|
||||
@@ -34,7 +34,6 @@ DOTNET_FEX = {
|
||||
"FEX_MEMCPYSETTSOENABLED": "1",
|
||||
"FEX_HALFBARRIERTSOENABLED": "1",
|
||||
"FEX_X87REDUCEDPRECISION": "0",
|
||||
"FEX_MULTIBLOCK": "0",
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +84,7 @@ def is_godot(game):
|
||||
@fix
|
||||
def dotnet_memory_ordering(game):
|
||||
if "coreclr.dll" in game.files:
|
||||
return DOTNET_FEX, [], ".NET runtime: FEX with full TSO and without multiblock"
|
||||
return DOTNET_FEX, [], ".NET runtime: FEX with full TSO"
|
||||
|
||||
|
||||
@fix
|
||||
|
||||
@@ -127,6 +127,11 @@ Prototype (inert unless `PROOT_FASTPATH` is set; see `docs/development/proot-per
|
||||
IDs wrap (32768 on many Android kernels) a new child can get that ID, and PRoot aborted on the
|
||||
assertion that a new child has no state, ending the whole session. Chromium-based programs such as
|
||||
Steam's client do this. PRoot now retires the stale entry and sets the new child up from scratch.
|
||||
- `0024-execveat-absolute-path.patch` - `execveat` with an absolute path and neither `AT_EMPTY_PATH`
|
||||
nor `AT_SYMLINK_NOFOLLOW` runs as `execve`. The kernel ignores the directory descriptor for such a
|
||||
path, and PRoot refused the call unless the descriptor was `AT_FDCWD`. FEX starts every child of an
|
||||
emulated program with `execveat(fd, "/proc/self/exe")`, so x86 programs in a Flatpak sandbox, which
|
||||
does not carry the session's preloads, could not start other programs.
|
||||
|
||||
Old kernel fixes:
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From 968f450754f97907d72a756add5010f6be746b6a Mon Sep 17 00:00:00 2001
|
||||
From: maxjivi05 <maxjividen@gmail.com>
|
||||
Date: Fri, 30 Oct 2026 20:21:28 -0400
|
||||
Subject: [PATCH] syscall: run an execveat with an absolute path like execve
|
||||
|
||||
The kernel ignores the directory descriptor of execveat when the path is
|
||||
absolute, so such a call is an execve with flags. FEX runs every child
|
||||
of an emulated program through execveat(fd, "/proc/self/exe"), which
|
||||
proot refused unless the descriptor was AT_FDCWD.
|
||||
---
|
||||
src/syscall/enter.c | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/syscall/enter.c b/src/syscall/enter.c
|
||||
index f8ce2e7..98241bd 100644
|
||||
--- a/src/syscall/enter.c
|
||||
+++ b/src/syscall/enter.c
|
||||
@@ -129,8 +129,13 @@ int translate_syscall_enter(Tracee *tracee)
|
||||
status = translate_execve_enter(tracee);
|
||||
break;
|
||||
|
||||
- case PR_execveat:
|
||||
- if ((int) peek_reg(tracee, CURRENT, SYSARG_1) == AT_FDCWD) {
|
||||
+ case PR_execveat: {
|
||||
+ word_t flags = peek_reg(tracee, CURRENT, SYSARG_5);
|
||||
+ char first = '\0';
|
||||
+ bool absolute = (flags & (AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW)) == 0
|
||||
+ && read_data(tracee, &first, peek_reg(tracee, CURRENT, SYSARG_2), 1) == 0
|
||||
+ && first == '/';
|
||||
+ if ((int) peek_reg(tracee, CURRENT, SYSARG_1) == AT_FDCWD || absolute) {
|
||||
set_sysnum(tracee, PR_execve);
|
||||
poke_reg(tracee, SYSARG_1, peek_reg(tracee, CURRENT, SYSARG_2));
|
||||
poke_reg(tracee, SYSARG_2, peek_reg(tracee, CURRENT, SYSARG_3));
|
||||
@@ -142,6 +147,7 @@ int translate_syscall_enter(Tracee *tracee)
|
||||
}
|
||||
status = translate_execve_enter(tracee);
|
||||
break;
|
||||
+ }
|
||||
|
||||
case PR_ptrace:
|
||||
status = translate_ptrace_enter(tracee);
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
import os
|
||||
import runpy
|
||||
import shutil
|
||||
import struct
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
BWRAP = Path(__file__).resolve().parents[1] / "linuxfs/overlay/usr/local/bin/droiddeck-bwrap"
|
||||
|
||||
|
||||
def elf(path, machine):
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_bytes(b"\x7fELF\x02\x01\x01" + bytes(11) + struct.pack("<H", machine) + bytes(64))
|
||||
path.chmod(0o755)
|
||||
|
||||
|
||||
class BwrapFexTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.dir = Path(tempfile.mkdtemp())
|
||||
self.addCleanup(shutil.rmtree, self.dir, True)
|
||||
self.shim = runpy.run_path(str(BWRAP))
|
||||
self.fex = self.dir / "fex"
|
||||
for name in ("bin/FEX", "bin/FEXServer", "lib/libxxhash.so.0"):
|
||||
elf(self.fex / name, 183)
|
||||
self.shim["through_fex"].__globals__["OWN_FEX"] = str(self.fex)
|
||||
self.runtime = self.dir / "runtime"
|
||||
self.app = self.dir / "app"
|
||||
elf(self.runtime / "bin/ldconfig", 62)
|
||||
elf(self.runtime / "bin/bash", 62)
|
||||
os.symlink("bash", self.runtime / "bin/sh")
|
||||
elf(self.runtime / "bin/arm-tool", 183)
|
||||
(self.app / "bin").mkdir(parents=True)
|
||||
(self.app / "bin/r2modman").write_text("#!/bin/sh\nexec /app/r2modman \"$@\"\n")
|
||||
|
||||
def spec(self, command, path="/app/bin:/usr/bin"):
|
||||
s = self.shim["Spec"]()
|
||||
s.env = {"PATH": path, "XDG_CACHE_HOME": "/home/user/.var/app/x/cache", "FEX_ROOTFS": "/sniper"}
|
||||
s.ops = [
|
||||
{"t": "bind", "src": str(self.runtime), "dest": "/usr", "try": False, "ro": True},
|
||||
{"t": "bind", "src": str(self.app), "dest": "/app", "try": False, "ro": True},
|
||||
{"t": "symlink", "target": "usr/bin", "dest": "/bin"},
|
||||
]
|
||||
s.command = command
|
||||
return s
|
||||
|
||||
def test_an_x86_64_program_found_on_path_runs_through_fex(self):
|
||||
s = self.spec(["ldconfig", "-X", "-C", "/run/cache"])
|
||||
self.assertTrue(self.shim["through_fex"](s))
|
||||
self.assertEqual(["/run/droiddeck-fex/bin/FEX", "/usr/bin/ldconfig", "-X", "-C", "/run/cache"], s.command)
|
||||
dests = {op["dest"]: op["src"] for op in s.ops if op["t"] == "bind"}
|
||||
self.assertEqual(str(self.fex / "bin/FEX"), dests["/run/droiddeck-fex/bin/FEX"])
|
||||
self.assertEqual(str(self.fex / "lib/libxxhash.so.0"), dests["/run/droiddeck-fex/lib/libxxhash.so.0"])
|
||||
self.assertIn("/usr/lib/aarch64-linux-gnu", dests)
|
||||
self.assertIn("/usr/lib/ld-linux-aarch64.so.1", dests)
|
||||
self.assertNotIn("FEX_ROOTFS", s.env)
|
||||
self.assertEqual("/home/user/.var/app/x/cache/droiddeck-fex/", s.env["FEX_APP_DATA_LOCATION"])
|
||||
|
||||
def test_a_script_whose_interpreter_is_x86_64_runs_through_fex(self):
|
||||
s = self.spec(["r2modman", "--flag"])
|
||||
self.assertTrue(self.shim["through_fex"](s))
|
||||
self.assertEqual(["/run/droiddeck-fex/bin/FEX", "/app/bin/r2modman", "--flag"], s.command)
|
||||
|
||||
def test_a_program_reached_through_a_sandbox_symlink_is_checked(self):
|
||||
s = self.spec(["/bin/sh", "-c", "true"])
|
||||
self.assertTrue(self.shim["through_fex"](s))
|
||||
self.assertEqual("/bin/sh", s.command[1])
|
||||
|
||||
def test_a_bind_whose_source_is_a_symlink_resolves_from_the_source(self):
|
||||
real = self.dir / "store" / "tool-real"
|
||||
elf(real, 62)
|
||||
os.symlink("tool-real", self.dir / "store" / "tool-link")
|
||||
s = self.spec(["/opt/tool"])
|
||||
s.ops.append({"t": "bind", "src": str(self.dir / "store" / "tool-link"), "dest": "/opt/tool", "try": False,
|
||||
"ro": True})
|
||||
self.assertTrue(self.shim["through_fex"](s))
|
||||
self.assertEqual("/opt/tool", s.command[1])
|
||||
|
||||
def test_a_relative_path_entry_is_searched_from_the_working_directory(self):
|
||||
s = self.spec(["r2modman"], path="bin")
|
||||
s.cwd = "/app"
|
||||
self.assertTrue(self.shim["through_fex"](s))
|
||||
self.assertEqual("/app/bin/r2modman", s.command[1])
|
||||
|
||||
def test_an_arm64_program_runs_as_it_is(self):
|
||||
s = self.spec(["arm-tool"])
|
||||
self.assertFalse(self.shim["through_fex"](s))
|
||||
self.assertEqual(["arm-tool"], s.command)
|
||||
self.assertEqual(3, len(s.ops))
|
||||
|
||||
def test_a_missing_program_is_left_alone(self):
|
||||
s = self.spec(["nothing-here"])
|
||||
self.assertFalse(self.shim["through_fex"](s))
|
||||
self.assertEqual(["nothing-here"], s.command)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,136 @@
|
||||
import importlib.machinery
|
||||
import importlib.util
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import types
|
||||
import unittest
|
||||
from contextlib import redirect_stdout
|
||||
|
||||
SCRIPT = Path(__file__).resolve().parents[1] / "linuxfs/overlay/usr/local/bin/droiddeck-flatpak"
|
||||
|
||||
|
||||
class FakeRef:
|
||||
def __init__(self, arch):
|
||||
self.arch = arch
|
||||
|
||||
def get_name(self):
|
||||
return "io.github.ebkr.r2modman"
|
||||
|
||||
def get_arch(self):
|
||||
return self.arch
|
||||
|
||||
|
||||
def load(bundle_arch, installs):
|
||||
flatpak = types.SimpleNamespace(
|
||||
get_default_arch=lambda: "aarch64",
|
||||
BundleRef=types.SimpleNamespace(new=lambda bundle: FakeRef(bundle_arch)),
|
||||
)
|
||||
repository = types.ModuleType("gi.repository")
|
||||
repository.Flatpak = flatpak
|
||||
repository.Gio = types.SimpleNamespace(File=types.SimpleNamespace(new_for_path=lambda path: path))
|
||||
repository.GLib = types.SimpleNamespace(Error=RuntimeError)
|
||||
gi = types.ModuleType("gi")
|
||||
gi.require_version = lambda *args: None
|
||||
gi.repository = repository
|
||||
saved = {name: sys.modules.get(name) for name in ("gi", "gi.repository")}
|
||||
sys.modules["gi"] = gi
|
||||
sys.modules["gi.repository"] = repository
|
||||
try:
|
||||
loader = importlib.machinery.SourceFileLoader("droiddeck_flatpak", str(SCRIPT))
|
||||
module = importlib.util.module_from_spec(importlib.util.spec_from_loader(loader.name, loader))
|
||||
loader.exec_module(module)
|
||||
finally:
|
||||
for name, value in saved.items():
|
||||
if value is None:
|
||||
sys.modules.pop(name, None)
|
||||
else:
|
||||
sys.modules[name] = value
|
||||
module.installation = lambda: object()
|
||||
module.app_ref = lambda inst, app_id: None
|
||||
|
||||
def transaction(inst):
|
||||
installs.append("bundle")
|
||||
raise AssertionError("the bundle reached a transaction")
|
||||
|
||||
module.transaction = transaction
|
||||
return module
|
||||
|
||||
|
||||
class FlatpakBundleArchTest(unittest.TestCase):
|
||||
def run_install(self, arch):
|
||||
installs = []
|
||||
module = load(arch, installs)
|
||||
out = io.StringIO()
|
||||
with redirect_stdout(out):
|
||||
try:
|
||||
rc = module.install_bundle("/tmp/r2modman.flatpak")
|
||||
except AssertionError:
|
||||
rc = None
|
||||
return rc, [json.loads(line) for line in out.getvalue().splitlines()], installs
|
||||
|
||||
def test_a_bundle_for_an_architecture_fex_cannot_run_is_refused_before_installing(self):
|
||||
rc, events, installs = self.run_install("riscv64")
|
||||
self.assertEqual(rc, 1)
|
||||
self.assertEqual(installs, [])
|
||||
self.assertEqual(events[0]["e"], "error")
|
||||
self.assertEqual(events[0]["code"], "arch")
|
||||
self.assertEqual(events[0]["arch"], "riscv64")
|
||||
self.assertEqual(events[0]["id"], "io.github.ebkr.r2modman")
|
||||
|
||||
def test_a_bundle_for_this_device_goes_on_to_install(self):
|
||||
rc, events, installs = self.run_install("aarch64")
|
||||
self.assertEqual(installs, ["bundle"])
|
||||
self.assertEqual(events, [])
|
||||
|
||||
def test_an_x86_64_bundle_goes_on_to_install_for_fex(self):
|
||||
rc, events, installs = self.run_install("x86_64")
|
||||
self.assertEqual(installs, ["bundle"])
|
||||
self.assertEqual(events, [])
|
||||
|
||||
def test_flathub_falls_back_to_the_x86_64_build(self):
|
||||
module = load("aarch64", [])
|
||||
asked = []
|
||||
|
||||
class Remote:
|
||||
def __init__(self, branch):
|
||||
self.branch = branch
|
||||
|
||||
def get_branch(self):
|
||||
return self.branch
|
||||
|
||||
class Installation:
|
||||
def fetch_remote_ref_sync(self, remote, kind, app_id, arch, branch, cancellable):
|
||||
asked.append((arch, branch))
|
||||
if arch == "x86_64" and branch == "stable":
|
||||
return Remote("stable")
|
||||
raise RuntimeError("not found")
|
||||
|
||||
added = []
|
||||
|
||||
class Transaction:
|
||||
def add_install(self, remote, ref, subpaths):
|
||||
added.append(ref)
|
||||
|
||||
module.Flatpak.RefKind = types.SimpleNamespace(APP=0)
|
||||
module.installation = lambda: Installation()
|
||||
installed = []
|
||||
module.app_ref = lambda inst, app_id: (installed[0] if installed else None)
|
||||
module.transaction = lambda inst: (Transaction(), {})
|
||||
|
||||
def run(t, state, report_done=True):
|
||||
installed.append(object())
|
||||
return 0
|
||||
|
||||
module.run = run
|
||||
out = io.StringIO()
|
||||
with redirect_stdout(out):
|
||||
rc = module.install("io.github.ebkr.r2modman")
|
||||
self.assertEqual(rc, 0)
|
||||
self.assertEqual(asked, [("aarch64", "stable"), ("aarch64", "master"), ("x86_64", "stable")])
|
||||
self.assertEqual(added, ["app/io.github.ebkr.r2modman/x86_64/stable"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -452,7 +452,7 @@ class GameEnvironmentTest(unittest.TestCase):
|
||||
(game / name).touch()
|
||||
env, extra, notes = MODULE["engine_fixes"](str(game / "Game.exe"), [])
|
||||
self.assertEqual(env["FEX_TSOENABLED"], "1")
|
||||
self.assertEqual(env["FEX_MULTIBLOCK"], "0")
|
||||
self.assertNotIn("FEX_MULTIBLOCK", env)
|
||||
self.assertEqual(env["WINEDLLOVERRIDES"], "libsentry.windows.release.x86_64=d")
|
||||
self.assertEqual(extra, ["--rendering-driver", "vulkan"])
|
||||
self.assertEqual(MODULE["engine_fixes"](str(game / "Game.exe"), ["--rendering-driver", "opengl3"])[1], [])
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
SRC = ROOT / 'app' / 'src' / 'main' / 'cpp' / 'waylandcomp' / 'src'
|
||||
|
||||
|
||||
def spirv_words(header):
|
||||
return re.findall(r'0x[0-9a-fA-F]{8}', header)
|
||||
|
||||
|
||||
@unittest.skipUnless(shutil.which('glslangValidator'), 'needs glslangValidator')
|
||||
class RotateShaderTest(unittest.TestCase):
|
||||
def test_committed_spirv_matches_the_glsl(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
out = Path(folder) / 'rotate_vert.h'
|
||||
subprocess.run(['glslangValidator', '-V', '--vn', 'rotate_vert_code', '-o', str(out),
|
||||
str(SRC / 'rotate.vert')], check=True, capture_output=True)
|
||||
self.assertEqual(spirv_words(out.read_text()), spirv_words((SRC / 'rotate_vert.h').read_text()))
|
||||
|
||||
def test_push_constants_match_the_blend_pass(self):
|
||||
rotate = (SRC / 'rotate.vert').read_text()
|
||||
blend = (SRC / 'blend.vert').read_text()
|
||||
pattern = r'uniform PC \{[^}]*\}'
|
||||
self.assertEqual(re.search(pattern, blend).group(0), re.search(pattern, rotate).group(0))
|
||||
|
||||
|
||||
class PanelRotationSourceTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.present = (SRC / 'vk_present.c').read_text()
|
||||
|
||||
def function(self, name):
|
||||
start = self.present.index(name)
|
||||
return self.present[start:self.present.index('\n}\n', start)]
|
||||
|
||||
def test_only_the_final_pass_touches_swapchain_images_while_rotating(self):
|
||||
for name in ('static void record_screen_blit(', 'static int render_impl('):
|
||||
self.assertNotIn('g_images[img]', self.function(name), name)
|
||||
|
||||
def test_rotation_is_limited_to_quarter_turns_and_can_be_switched_off(self):
|
||||
body = self.function('static int prerotate_degrees(')
|
||||
self.assertIn('debug.droiddeck.prerotate', body)
|
||||
self.assertIn('ROTATE_90_BIT_KHR) return 90', body)
|
||||
self.assertIn('ROTATE_270_BIT_KHR) return 270', body)
|
||||
self.assertNotIn('ROTATE_180', body)
|
||||
self.assertIn('if (g_prerot_failed) return 0;', body)
|
||||
|
||||
def test_a_refused_rotated_swapchain_falls_back_to_the_display_rotating(self):
|
||||
body = self.function('static int swap_init_locked(void) {')
|
||||
self.assertIn('cr != VK_SUCCESS && g_prerot', body)
|
||||
self.assertIn('sci.imageExtent = g_extent;', body)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user