Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46f99b9e08 | ||
|
|
dcb1a3001b | ||
|
|
dbfcd764f3 | ||
|
|
96e4bd4eab | ||
|
|
d788afc126 | ||
|
|
50a7b1b9f5 | ||
|
|
79027970e1 | ||
|
|
6e9853add5 | ||
|
|
07f2dc8e8f | ||
|
|
0f924aebb0 | ||
|
|
8ec499ae3f | ||
|
|
53c1933ac8 | ||
|
|
4df3f775e1 | ||
|
|
6b570c573b | ||
|
|
d164749a7f | ||
|
|
50c5fd79f7 | ||
|
|
c6169cba80 | ||
|
|
017c1c6b31 | ||
|
|
a8df9a7ae1 | ||
|
|
d38fd373f0 | ||
|
|
a6fe10d8ff | ||
|
|
953549704a | ||
|
|
19d8819137 | ||
|
|
1b80b506cb | ||
|
|
4b289a4802 | ||
|
|
238ef76c5c | ||
|
|
906e66e3cf | ||
|
|
c0d14f9632 | ||
|
|
70bda85dd5 |
No files matched your search
@@ -754,12 +754,17 @@ jobs:
|
||||
ln -sfn "$(cd "$jars" && pwd)" "$m2"
|
||||
echo "cache=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
- name: Cache Robolectric's Android jars
|
||||
- name: Restore Robolectric's Android jars
|
||||
id: robolectric-cache
|
||||
if: steps.robolectric-jars.outputs.cache == 'true'
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ../robolectric-jars
|
||||
key: robolectric-android-all-v2-${{ steps.robolectric.outputs.version }}
|
||||
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
||||
restore-keys: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-
|
||||
- name: Count the restored Robolectric jars
|
||||
if: steps.robolectric-jars.outputs.cache == 'true'
|
||||
run: echo "ROBOLECTRIC_JARS_BEFORE=$(find "$GITHUB_WORKSPACE/../robolectric-jars" -name '*.jar' | wc -l)" >> "$GITHUB_ENV"
|
||||
- name: Unit tests
|
||||
id: unit-tests
|
||||
env:
|
||||
@@ -770,6 +775,34 @@ jobs:
|
||||
mkdir -p app/build
|
||||
./gradlew testReleaseUnitTest --console=plain --info --stacktrace -Drobolectric.logging=stderr -PndkVersion="$NDK_VERSION" 2>&1 | tee app/build/unit-tests.log
|
||||
|
||||
# actions/cache only saves when the job succeeds, so a run whose tests died on a Maven 429 never filled the cache.
|
||||
# Save the complete jars even after a failed test step, when this run added some; a partial download is dropped first.
|
||||
- name: Save Robolectric's Android jars
|
||||
id: robolectric-jars-final
|
||||
if: always() && steps.robolectric-jars.outputs.cache == 'true'
|
||||
run: |
|
||||
python3 - <<'PY'
|
||||
import glob, os, zipfile
|
||||
root = os.path.join(os.environ['GITHUB_WORKSPACE'], '..', 'robolectric-jars')
|
||||
for f in glob.glob(os.path.join(root, '**', '*'), recursive=True):
|
||||
if not os.path.isfile(f):
|
||||
continue
|
||||
try:
|
||||
ok = f.endswith('.jar') and zipfile.ZipFile(f).testzip() is None
|
||||
except Exception:
|
||||
ok = False
|
||||
if not ok:
|
||||
os.remove(f)
|
||||
PY
|
||||
after=$(find "$GITHUB_WORKSPACE/../robolectric-jars" -name '*.jar' | wc -l)
|
||||
[ "$after" -gt "${ROBOLECTRIC_JARS_BEFORE:-0}" ] && echo "save=true" >> "$GITHUB_OUTPUT" || true
|
||||
- name: Store Robolectric's Android jars
|
||||
if: always() && steps.robolectric-jars-final.outputs.save == 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ../robolectric-jars
|
||||
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
||||
|
||||
- name: Upload unit test diagnostics
|
||||
id: unit-test-diagnostics
|
||||
if: always() && steps.unit-tests.outcome != 'skipped'
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
DroidDeck brings the SteamOS experience to Android: Steam Gaming Mode, full Linux desktop, integration with GOG, Epic Games, Xbox, and other storefronts, Steam VR, and more!
|
||||
|
||||
<p align="center"><b>100% open source. No ads. No telemetry. No proprietary components. No source withheld.</b></p>
|
||||
<p align="center"><b>100% open source. No ads. No Subscriptions. No telemetry. No proprietary components. No source withheld.</b></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/Droid-Deck/DroidDeck/releases/download/0.7.1/DroidDeck-0.7.1.apk"><img src="https://img.shields.io/badge/Download-DroidDeck%200.7.1%20APK-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Download DroidDeck 0.7.1"></a>
|
||||
<a href="https://github.com/Droid-Deck/DroidDeck/releases/download/0.7.11/DroidDeck-0.7.11.apk"><img src="https://img.shields.io/badge/Download-DroidDeck%200.7.11%20APK-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Download DroidDeck 0.7.11"></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>
|
||||
|
||||
@@ -23,7 +23,7 @@ DroidDeck brings the SteamOS experience to Android: Steam Gaming Mode, full Linu
|
||||
<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/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>
|
||||
<p align="center"><a href="https://www.youtube.com/watch?v=ruaTSm_7a2c"><img src="docs/media/droiddeck-showcase.gif" width="60%" alt="A table of handhelds and phones all running DroidDeck, one waking to the Steam menu, the AYN Thor's bottom screen used as a touchpad, and scrolling around Steam on a phone before swiping to the home screen. Footage from Cyber Dopamine's video, linked."></a></p>
|
||||
|
||||
> The official website is [droid-deck.dev](https://droid-deck.dev). Only download DroidDeck from this repository's [Releases](https://github.com/Droid-Deck/DroidDeck/releases).
|
||||
|
||||
@@ -38,7 +38,7 @@ DroidDeck brings the SteamOS experience to Android: Steam Gaming Mode, full Linu
|
||||
|
||||
1. Android 9 or newer on Adreno 730 or newer, or any 8xx. Adreno 6xx, Mali, Xclipse and PowerVR are experimental. Adreno 710 is currently 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.7.1/DroidDeck-0.7.1.apk), install the Linux runtime, press **Play** and sign in to Steam.
|
||||
3. Install the [APK](https://github.com/Droid-Deck/DroidDeck/releases/download/0.7.11/DroidDeck-0.7.11.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.
|
||||
|
||||
Smart glasses setup is in the [support matrix](docs/smart-glasses-support.md). Release notes are in [docs/releases](docs/releases).
|
||||
@@ -57,9 +57,6 @@ The APK lands in `app/build/outputs/apk/release/`. Install it with `tools/deploy
|
||||
|
||||
On Windows, see `tools/run_windows.ps1` and `tools/prepare_windows_runtime.py`.
|
||||
|
||||
## Limits
|
||||
|
||||
Compatibility and performance vary by device. Desktop compositing is software rendered, and Firefox sandboxing is reduced under proot.
|
||||
|
||||
## Credits and licence
|
||||
|
||||
@@ -71,6 +68,7 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
||||
- 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), and its GL thunk hands X errors to the program's own error handler. FEX's code disk cache was checked in its source. The fix for host stack left behind when a program leaves a signal handler without returning follows the approach suggested in [FEX-Emu/FEX#2487](https://github.com/FEX-Emu/FEX/issues/2487). The host stack fix for system calls that end a block is a backport of Ryan Houdek's [FEX-Emu/FEX#6122](https://github.com/FEX-Emu/FEX/pull/6122).
|
||||
- x86-64 programs on Wayland reach the GPU through FEX's Wayland client, wayland-egl and EGL thunks. The guest `wl_list` and `wl_array` helpers follow [libwayland](https://gitlab.freedesktop.org/wayland/wayland)'s `src/wayland-util.c` (MIT). The EGL extension table comes from the [Khronos EGL registry](https://github.com/KhronosGroup/EGL-Registry) (Apache-2.0) and Mesa's `egl_other.xml` (MIT).
|
||||
- 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.
|
||||
- DwarFS AppImages are unpacked without proot by `dwarfsextract` from [DwarFS](https://github.com/mhx/dwarfs) by Marcus Holland-Moritz (MIT), the release binary uruntime embeds, taken out of its self-extracting wrapper and shipped 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.
|
||||
|
||||
@@ -132,8 +132,8 @@ android {
|
||||
applicationId "com.droiddeck.launcher"
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 34
|
||||
versionCode 19
|
||||
versionName "0.7.1"
|
||||
versionCode 20
|
||||
versionName "0.7.11"
|
||||
buildConfigField "String", "BUILD_LABEL", "\"${escapedBuildLabel}\""
|
||||
buildConfigField "String", "SOURCE_COMMIT", "\"${sourceCommit}\""
|
||||
buildConfigField "int", "PR_NUMBER", "${prNumber}"
|
||||
|
||||
@@ -58,6 +58,59 @@
|
||||
|
||||
#define EXPORT extern "C" __attribute__((visibility("default")))
|
||||
|
||||
struct SymbolSlot {
|
||||
std::atomic<void *> fn{nullptr};
|
||||
std::atomic<bool> resolved{false};
|
||||
};
|
||||
|
||||
template <typename Fn> static Fn resolved_symbol(SymbolSlot &slot, void *handle, const char *name) {
|
||||
if (!slot.resolved.load(std::memory_order_acquire)) {
|
||||
slot.fn.store(dlsym(handle, name), std::memory_order_relaxed);
|
||||
slot.resolved.store(true, std::memory_order_release);
|
||||
}
|
||||
return reinterpret_cast<Fn>(slot.fn.load(std::memory_order_relaxed));
|
||||
}
|
||||
|
||||
enum class Next : size_t {
|
||||
open,
|
||||
openat,
|
||||
close,
|
||||
write,
|
||||
ioctl,
|
||||
poll,
|
||||
ppoll,
|
||||
select,
|
||||
stat,
|
||||
stat64,
|
||||
fstat,
|
||||
fstat64,
|
||||
xstat,
|
||||
xstat64,
|
||||
fxstat,
|
||||
fxstat64,
|
||||
statx,
|
||||
statfs,
|
||||
fstatfs,
|
||||
access,
|
||||
faccessat,
|
||||
opendir,
|
||||
scandir,
|
||||
inotify_add_watch,
|
||||
count
|
||||
};
|
||||
|
||||
static const char *const next_names[] = {"open", "openat", "close", "write", "ioctl", "poll", "ppoll", "select", "stat", "stat64", "fstat", "fstat64", "__xstat", "__xstat64", "__fxstat", "__fxstat64", "statx", "statfs", "fstatfs", "access", "faccessat", "opendir", "scandir", "inotify_add_watch"};
|
||||
static_assert(sizeof(next_names) / sizeof(next_names[0]) == static_cast<size_t>(Next::count), "next_names");
|
||||
static SymbolSlot next_slots[static_cast<size_t>(Next::count)];
|
||||
|
||||
template <typename Fn> static Fn next_symbol(Next which) {
|
||||
return resolved_symbol<Fn>(next_slots[static_cast<size_t>(which)], RTLD_NEXT, next_names[static_cast<size_t>(which)]);
|
||||
}
|
||||
|
||||
static void resolve_next_symbols() {
|
||||
for (size_t i = 0; i < static_cast<size_t>(Next::count); i++) next_symbol<void *>(static_cast<Next>(i));
|
||||
}
|
||||
|
||||
#ifdef __GLIBC__
|
||||
typedef unsigned long ioctl_request_t;
|
||||
#else
|
||||
@@ -442,6 +495,7 @@ void log(const char *message, ...) {
|
||||
}
|
||||
|
||||
__attribute__((constructor)) static void library_init() {
|
||||
resolve_next_symbols();
|
||||
config();
|
||||
controller_mutex();
|
||||
controller_map();
|
||||
@@ -733,7 +787,7 @@ open_fake_input_ring(const char *event, int flags) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
|
||||
int fd = my_open(ring_path.c_str(), O_RDWR | (flags & (O_NONBLOCK | O_CLOEXEC)));
|
||||
if (fd < 0)
|
||||
@@ -1000,7 +1054,7 @@ __attribute__((visibility("hidden"))) static void unpublish_uinput(UinputWriter
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static int claim_uinput_node(int *fd_out) {
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
for (int node = UINPUT_EVENT_BASE; node < UINPUT_EVENT_LIMIT; node++) {
|
||||
std::string path = uinput_ring_path(node);
|
||||
int fd = my_open(path.c_str(), O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC, 0644);
|
||||
@@ -1027,7 +1081,7 @@ __attribute__((visibility("hidden"))) static int claim_uinput_node(int *fd_out)
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static int publish_uinput(UinputWriter &w) {
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
int fd = -1;
|
||||
int node = claim_uinput_node(&fd);
|
||||
if (node < 0) return -1;
|
||||
@@ -1440,7 +1494,7 @@ __attribute__((visibility("hidden"))) static const uint8_t *ring_blocks() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
if ((mapped = block.load(std::memory_order_acquire))) return mapped;
|
||||
tries.fetch_add(1, std::memory_order_relaxed);
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
std::string path = get_ring_path_for_slot(0);
|
||||
int fd = path.empty() ? -1 : my_open(path.c_str(), O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0) return nullptr;
|
||||
@@ -1793,7 +1847,7 @@ __attribute__((visibility("hidden"))) static void *sony_report_thread(void *arg)
|
||||
|
||||
__attribute__((visibility("hidden"))) static int open_deck_hidraw(int flags, uint8_t sony = 0) {
|
||||
const char *path = sony == 4 ? DS4_HIDRAW_PATH : sony == 5 ? DUALSENSE_HIDRAW_PATH : DECK_HIDRAW_PATH;
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
if (!process_reads_pads()) {
|
||||
Logger::log("deck: %s refused: not the Steam client\n", path);
|
||||
errno = ENOENT;
|
||||
@@ -2002,7 +2056,7 @@ __attribute__((visibility("hidden"))) static void *triton_pad_thread(void *arg)
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static int open_triton_hidraw(int flags, bool emulated) {
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
if (!process_reads_pads()) {
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
@@ -2121,7 +2175,7 @@ __attribute__((visibility("hidden"))) static TouchRingFile *touch_ring() {
|
||||
std::call_once(once, [] {
|
||||
const char *path = getenv("FAKE_TOUCHCTL_RING");
|
||||
if (!path || !*path || !fake_deck_enabled()) return;
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
int fd = my_open(path, O_RDWR | O_CLOEXEC);
|
||||
if (fd < 0) {
|
||||
Logger::log("touch: %s not openable (%s)\n", path, strerror(errno));
|
||||
@@ -2338,7 +2392,8 @@ __attribute__((visibility("hidden"))) static int inject_uevent(const char *actio
|
||||
const char *subsystem, const char *devname,
|
||||
unsigned major, unsigned minor) {
|
||||
using inject_fn = int (*)(const char *, const char *, const char *, const char *, unsigned, unsigned);
|
||||
static auto inject = reinterpret_cast<inject_fn>(dlsym(RTLD_DEFAULT, "dd_udevmon_inject"));
|
||||
static SymbolSlot inject_slot;
|
||||
const auto inject = resolved_symbol<inject_fn>(inject_slot, RTLD_DEFAULT, "dd_udevmon_inject");
|
||||
return inject ? inject(action, devpath, subsystem, devname, major, minor) : -1;
|
||||
}
|
||||
|
||||
@@ -2496,7 +2551,7 @@ __attribute__((visibility("hidden"))) static void note_deck_sysfs(const char *ho
|
||||
}
|
||||
|
||||
EXPORT int fstatfs(int fd, struct statfs *buf) {
|
||||
static auto real = reinterpret_cast<int (*)(int, struct statfs *)>(dlsym(RTLD_NEXT, "fstatfs"));
|
||||
const auto real = next_symbol<int (*)(int, struct statfs *)>(Next::fstatfs);
|
||||
int result = real(fd, buf);
|
||||
if (fake_deck_enabled() && is_deck_sysfs_fd(fd)) {
|
||||
note_deck_sysfs("fstatfs", result);
|
||||
@@ -2506,7 +2561,7 @@ EXPORT int fstatfs(int fd, struct statfs *buf) {
|
||||
}
|
||||
|
||||
EXPORT int statfs(const char *path, struct statfs *buf) {
|
||||
static auto real = reinterpret_cast<int (*)(const char *, struct statfs *)>(dlsym(RTLD_NEXT, "statfs"));
|
||||
const auto real = next_symbol<int (*)(const char *, struct statfs *)>(Next::statfs);
|
||||
int result = real(path, buf);
|
||||
if (fake_deck_enabled() && is_deck_sysfs_path(path)) {
|
||||
note_deck_sysfs(path, result);
|
||||
@@ -2555,7 +2610,7 @@ __attribute__((visibility("hidden"))) static int deck_imu_mode_change(const uint
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static void publish_imu_mode(const DeckHidraw &deck, int mode) {
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
if (deck.mapping_size < FAKE_INPUT_RING_SIZE + DECK_IMU_BLOCK_SIZE) return;
|
||||
std::string path = get_ring_path_for_slot(0);
|
||||
int fd = path.empty() ? -1 : my_open(path.c_str(), O_WRONLY | O_CLOEXEC);
|
||||
@@ -3064,7 +3119,7 @@ static int real_fstat(int fd, struct stat *buf);
|
||||
|
||||
__attribute__((visibility("hidden"))) static bool deck_mount_id_from_fdinfo(
|
||||
int dirfd, const char *path, int flags, struct statx *buf) {
|
||||
static auto real_openat = reinterpret_cast<decltype(&::openat)>(dlsym(RTLD_NEXT, "openat"));
|
||||
const auto real_openat = next_symbol<decltype(&::openat)>(Next::openat);
|
||||
int target;
|
||||
if (!path || !*path) {
|
||||
if (!(flags & AT_EMPTY_PATH)) return false;
|
||||
@@ -3102,7 +3157,7 @@ __attribute__((visibility("hidden"))) static bool deck_mount_id_from_fdinfo(
|
||||
}
|
||||
|
||||
EXPORT int statx(int dirfd, const char *path, int flags, unsigned mask, struct statx *buf) {
|
||||
static auto real = reinterpret_cast<decltype(&::statx)>(dlsym(RTLD_NEXT, "statx"));
|
||||
const auto real = next_symbol<decltype(&::statx)>(Next::statx);
|
||||
int result = real(dirfd, path, flags, mask, buf);
|
||||
int saved_errno = errno;
|
||||
constexpr unsigned unique_mount_id = 0x4000;
|
||||
@@ -3123,7 +3178,7 @@ EXPORT int statx(int dirfd, const char *path, int flags, unsigned mask, struct s
|
||||
#endif
|
||||
|
||||
EXPORT DIR *opendir(const char *name) {
|
||||
static auto real = reinterpret_cast<DIR *(*)(const char *)>(dlsym(RTLD_NEXT, "opendir"));
|
||||
const auto real = next_symbol<DIR *(*)(const char *)>(Next::opendir);
|
||||
DIR *dir = real(name);
|
||||
if (!dir) {
|
||||
note_sys_failure(AT_FDCWD, name);
|
||||
@@ -3153,7 +3208,7 @@ EXPORT int open(const char *pathname, int flags, ...) {
|
||||
|
||||
va_end(va);
|
||||
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
|
||||
if (fake_uinput_enabled() && is_uinput_path(pathname)) return open_uinput(flags);
|
||||
if (is_deck_hidraw_path(pathname)) return open_deck_hidraw(flags);
|
||||
@@ -3231,7 +3286,7 @@ EXPORT int openat(int dirfd, const char *pathname, int flags, ...) {
|
||||
|
||||
va_end(va);
|
||||
|
||||
static auto my_openat = reinterpret_cast<int (*)(int, const char *, int, ...)>(dlsym(RTLD_NEXT, "openat"));
|
||||
const auto my_openat = next_symbol<int (*)(int, const char *, int, ...)>(Next::openat);
|
||||
|
||||
if (fake_uinput_enabled() && is_uinput_path(pathname)) return open_uinput(flags);
|
||||
if (is_deck_hidraw_path(pathname)) return open_deck_hidraw(flags);
|
||||
@@ -3390,10 +3445,10 @@ static int fake_stat_fd(int fd, S *buf, Real real) {
|
||||
}
|
||||
|
||||
static int real_stat(const char *pathname, struct stat *statbuf) {
|
||||
static auto fn = reinterpret_cast<int (*)(const char *, struct stat *)>(dlsym(RTLD_NEXT, "stat"));
|
||||
const auto fn = next_symbol<int (*)(const char *, struct stat *)>(Next::stat);
|
||||
if (fn) return fn(pathname, statbuf);
|
||||
#ifdef _STAT_VER
|
||||
static auto xfn = reinterpret_cast<int (*)(int, const char *, struct stat *)>(dlsym(RTLD_NEXT, "__xstat"));
|
||||
const auto xfn = next_symbol<int (*)(int, const char *, struct stat *)>(Next::xstat);
|
||||
if (xfn) return xfn(_STAT_VER, pathname, statbuf);
|
||||
#endif
|
||||
errno = ENOSYS;
|
||||
@@ -3401,10 +3456,10 @@ static int real_stat(const char *pathname, struct stat *statbuf) {
|
||||
}
|
||||
|
||||
static int real_fstat(int fd, struct stat *buf) {
|
||||
static auto fn = reinterpret_cast<int (*)(int, struct stat *)>(dlsym(RTLD_NEXT, "fstat"));
|
||||
const auto fn = next_symbol<int (*)(int, struct stat *)>(Next::fstat);
|
||||
if (fn) return fn(fd, buf);
|
||||
#ifdef _STAT_VER
|
||||
static auto xfn = reinterpret_cast<int (*)(int, int, struct stat *)>(dlsym(RTLD_NEXT, "__fxstat"));
|
||||
const auto xfn = next_symbol<int (*)(int, int, struct stat *)>(Next::fxstat);
|
||||
if (xfn) return xfn(_STAT_VER, fd, buf);
|
||||
#endif
|
||||
errno = ENOSYS;
|
||||
@@ -3420,7 +3475,7 @@ EXPORT int fstat(int fd, struct stat *buf) {
|
||||
}
|
||||
|
||||
EXPORT int access(const char *pathname, int mode) {
|
||||
static auto my_access = reinterpret_cast<decltype(&::access)>(dlsym(RTLD_NEXT, "access"));
|
||||
const auto my_access = next_symbol<decltype(&::access)>(Next::access);
|
||||
if (fake_uinput_enabled() && is_uinput_path(pathname)) return 0;
|
||||
if (is_deck_hidraw_path(pathname) && process_reads_pads()) return 0;
|
||||
if ((is_triton_hidraw_path(pathname) || is_triton_pad_path(pathname) || sony_pad_path(pathname)) &&
|
||||
@@ -3461,7 +3516,7 @@ EXPORT int access(const char *pathname, int mode) {
|
||||
}
|
||||
|
||||
EXPORT int faccessat(int dirfd, const char *pathname, int mode, int flags) {
|
||||
static auto my_faccessat = reinterpret_cast<decltype(&::faccessat)>(dlsym(RTLD_NEXT, "faccessat"));
|
||||
const auto my_faccessat = next_symbol<decltype(&::faccessat)>(Next::faccessat);
|
||||
if (fake_uinput_enabled() && is_uinput_path(pathname)) return 0;
|
||||
if (is_deck_hidraw_path(pathname) && process_reads_pads()) return 0;
|
||||
if ((is_triton_hidraw_path(pathname) || is_triton_pad_path(pathname) || sony_pad_path(pathname)) &&
|
||||
@@ -3505,7 +3560,7 @@ EXPORT int scandir(const char *dirp, struct dirent ***namelist,
|
||||
int (*filter)(const struct dirent *),
|
||||
int (*compar)(const struct dirent **,
|
||||
const struct dirent **)) {
|
||||
static auto my_scandir = reinterpret_cast<decltype(&::scandir)>(dlsym(RTLD_NEXT, "scandir"));
|
||||
const auto my_scandir = next_symbol<decltype(&::scandir)>(Next::scandir);
|
||||
|
||||
if (dirp) {
|
||||
if (!strcmp(dirp, "/dev/input")) {
|
||||
@@ -3519,7 +3574,7 @@ EXPORT int scandir(const char *dirp, struct dirent ***namelist,
|
||||
}
|
||||
|
||||
EXPORT int inotify_add_watch(int fd, const char *pathname, uint32_t mask) {
|
||||
static auto my_inotify_add_watch = reinterpret_cast<decltype(&::inotify_add_watch)>(dlsym(RTLD_NEXT, "inotify_add_watch"));
|
||||
const auto my_inotify_add_watch = next_symbol<decltype(&::inotify_add_watch)>(Next::inotify_add_watch);
|
||||
|
||||
char *fake_path = nullptr;
|
||||
if (pathname) {
|
||||
@@ -3658,7 +3713,7 @@ static bool wait_snapshot(std::shared_ptr<FakeController> fake,
|
||||
|
||||
static int forward_ioctl(int fd, ioctl_request_t op, void *argp) {
|
||||
using ioctl_fn = int (*)(int, ioctl_request_t, ...);
|
||||
static const auto next = reinterpret_cast<ioctl_fn>(dlsym(RTLD_NEXT, "ioctl"));
|
||||
const auto next = next_symbol<ioctl_fn>(Next::ioctl);
|
||||
return next ? next(fd, op, argp) : static_cast<int>(syscall(SYS_ioctl, fd, op, argp));
|
||||
}
|
||||
|
||||
@@ -3897,7 +3952,7 @@ EXPORT int ioctl(int fd, ioctl_request_t op, ...) {
|
||||
}
|
||||
|
||||
EXPORT int close(int fd) {
|
||||
static auto my_close = reinterpret_cast<decltype(&::close)>(dlsym(RTLD_NEXT, "close"));
|
||||
const auto my_close = next_symbol<decltype(&::close)>(Next::close);
|
||||
|
||||
if (!watched(fd)) return my_close(fd);
|
||||
close_uinput(fd);
|
||||
@@ -4085,7 +4140,7 @@ EXPORT ssize_t readv(int fd, const struct iovec *iov, int iovcnt) {
|
||||
}
|
||||
|
||||
EXPORT ssize_t write(int fd, const void *buf, size_t count) {
|
||||
static auto my_write = reinterpret_cast<decltype(&::write)>(dlsym(RTLD_NEXT, "write"));
|
||||
const auto my_write = next_symbol<decltype(&::write)>(Next::write);
|
||||
|
||||
if (!watched(fd)) return my_write(fd, buf, count);
|
||||
std::unique_lock<std::recursive_mutex> guard(controller_mutex());
|
||||
@@ -4160,8 +4215,8 @@ EXPORT ssize_t writev(int fd, const struct iovec *iov, int iovcnt) {
|
||||
|
||||
static int poll_fake(struct pollfd *fds, nfds_t nfds, int timeout,
|
||||
const sigset_t *sigmask) {
|
||||
static auto my_poll = reinterpret_cast<decltype(&::poll)>(dlsym(RTLD_NEXT, "poll"));
|
||||
static auto my_ppoll = reinterpret_cast<decltype(&::ppoll)>(dlsym(RTLD_NEXT, "ppoll"));
|
||||
const auto my_poll = next_symbol<decltype(&::poll)>(Next::poll);
|
||||
const auto my_ppoll = next_symbol<decltype(&::ppoll)>(Next::ppoll);
|
||||
|
||||
nfds_t first = 0;
|
||||
while (first < nfds && !watched(fds[first].fd)) first++;
|
||||
@@ -4265,7 +4320,7 @@ EXPORT int poll(struct pollfd *fds, nfds_t nfds, int timeout) {
|
||||
|
||||
EXPORT int ppoll(struct pollfd *fds, nfds_t nfds,
|
||||
const struct timespec *timeout, const sigset_t *sigmask) {
|
||||
static auto my_ppoll = reinterpret_cast<decltype(&::ppoll)>(dlsym(RTLD_NEXT, "ppoll"));
|
||||
const auto my_ppoll = next_symbol<decltype(&::ppoll)>(Next::ppoll);
|
||||
if (timeout && (timeout->tv_sec < 0 || timeout->tv_nsec < 0 || timeout->tv_nsec >= 1000000000L)) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
@@ -4292,7 +4347,7 @@ EXPORT int ppoll(struct pollfd *fds, nfds_t nfds,
|
||||
|
||||
EXPORT int select(int nfds, fd_set *readfds, fd_set *writefds,
|
||||
fd_set *exceptfds, struct timeval *timeout) {
|
||||
static auto my_select = reinterpret_cast<decltype(&::select)>(dlsym(RTLD_NEXT, "select"));
|
||||
const auto my_select = next_symbol<decltype(&::select)>(Next::select);
|
||||
|
||||
fd_set original_readfds;
|
||||
fd_set original_writefds;
|
||||
@@ -4454,10 +4509,10 @@ EXPORT int openat64(int dirfd, const char *pathname, int flags, ...) {
|
||||
}
|
||||
|
||||
static int real_stat64(const char *pathname, struct stat64 *statbuf) {
|
||||
static auto fn = reinterpret_cast<int (*)(const char *, struct stat64 *)>(dlsym(RTLD_NEXT, "stat64"));
|
||||
const auto fn = next_symbol<int (*)(const char *, struct stat64 *)>(Next::stat64);
|
||||
if (fn) return fn(pathname, statbuf);
|
||||
#ifdef _STAT_VER
|
||||
static auto xfn = reinterpret_cast<int (*)(int, const char *, struct stat64 *)>(dlsym(RTLD_NEXT, "__xstat64"));
|
||||
const auto xfn = next_symbol<int (*)(int, const char *, struct stat64 *)>(Next::xstat64);
|
||||
if (xfn) return xfn(_STAT_VER, pathname, statbuf);
|
||||
#endif
|
||||
errno = ENOSYS;
|
||||
@@ -4465,10 +4520,10 @@ static int real_stat64(const char *pathname, struct stat64 *statbuf) {
|
||||
}
|
||||
|
||||
static int real_fstat64(int fd, struct stat64 *buf) {
|
||||
static auto fn = reinterpret_cast<int (*)(int, struct stat64 *)>(dlsym(RTLD_NEXT, "fstat64"));
|
||||
const auto fn = next_symbol<int (*)(int, struct stat64 *)>(Next::fstat64);
|
||||
if (fn) return fn(fd, buf);
|
||||
#ifdef _STAT_VER
|
||||
static auto xfn = reinterpret_cast<int (*)(int, int, struct stat64 *)>(dlsym(RTLD_NEXT, "__fxstat64"));
|
||||
const auto xfn = next_symbol<int (*)(int, int, struct stat64 *)>(Next::fxstat64);
|
||||
if (xfn) return xfn(_STAT_VER, fd, buf);
|
||||
#endif
|
||||
errno = ENOSYS;
|
||||
@@ -4484,27 +4539,27 @@ EXPORT int fstat64(int fd, struct stat64 *buf) {
|
||||
}
|
||||
|
||||
EXPORT int __xstat(int version, const char *pathname, struct stat *statbuf) {
|
||||
static auto real = reinterpret_cast<int (*)(int, const char *, struct stat *)>(dlsym(RTLD_NEXT, "__xstat"));
|
||||
const auto real = next_symbol<int (*)(int, const char *, struct stat *)>(Next::xstat);
|
||||
if (!real) return stat(pathname, statbuf);
|
||||
return fake_stat_path(pathname, statbuf, [version](const char *path, struct stat *buf) { return real(version, path, buf); });
|
||||
return fake_stat_path(pathname, statbuf, [version, real](const char *path, struct stat *buf) { return real(version, path, buf); });
|
||||
}
|
||||
|
||||
EXPORT int __xstat64(int version, const char *pathname, struct stat64 *statbuf) {
|
||||
static auto real = reinterpret_cast<int (*)(int, const char *, struct stat64 *)>(dlsym(RTLD_NEXT, "__xstat64"));
|
||||
const auto real = next_symbol<int (*)(int, const char *, struct stat64 *)>(Next::xstat64);
|
||||
if (!real) return stat64(pathname, statbuf);
|
||||
return fake_stat_path(pathname, statbuf, [version](const char *path, struct stat64 *buf) { return real(version, path, buf); });
|
||||
return fake_stat_path(pathname, statbuf, [version, real](const char *path, struct stat64 *buf) { return real(version, path, buf); });
|
||||
}
|
||||
|
||||
EXPORT int __fxstat(int version, int fd, struct stat *buf) {
|
||||
static auto real = reinterpret_cast<int (*)(int, int, struct stat *)>(dlsym(RTLD_NEXT, "__fxstat"));
|
||||
const auto real = next_symbol<int (*)(int, int, struct stat *)>(Next::fxstat);
|
||||
if (!real) return fstat(fd, buf);
|
||||
return fake_stat_fd(fd, buf, [version](int f, struct stat *b) { return real(version, f, b); });
|
||||
return fake_stat_fd(fd, buf, [version, real](int f, struct stat *b) { return real(version, f, b); });
|
||||
}
|
||||
|
||||
EXPORT int __fxstat64(int version, int fd, struct stat64 *buf) {
|
||||
static auto real = reinterpret_cast<int (*)(int, int, struct stat64 *)>(dlsym(RTLD_NEXT, "__fxstat64"));
|
||||
const auto real = next_symbol<int (*)(int, int, struct stat64 *)>(Next::fxstat64);
|
||||
if (!real) return fstat64(fd, buf);
|
||||
return fake_stat_fd(fd, buf, [version](int f, struct stat64 *b) { return real(version, f, b); });
|
||||
return fake_stat_fd(fd, buf, [version, real](int f, struct stat64 *b) { return real(version, f, b); });
|
||||
}
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
@@ -4518,18 +4573,37 @@ static const char *const interposed_names[] = {
|
||||
};
|
||||
|
||||
static dlsym_fn next_dlsym() {
|
||||
static const dlsym_fn fn = [] {
|
||||
static std::atomic<dlsym_fn> fn{nullptr};
|
||||
static std::atomic<bool> resolved{false};
|
||||
if (!resolved.load(std::memory_order_acquire)) {
|
||||
#ifdef __x86_64__
|
||||
const char *base = "GLIBC_2.2.5";
|
||||
#else
|
||||
const char *base = "GLIBC_2.0";
|
||||
#endif
|
||||
dlsym_fn found{};
|
||||
for (const char *version : {base, "GLIBC_2.34"}) {
|
||||
if (auto found = reinterpret_cast<dlsym_fn>(dlvsym(RTLD_NEXT, "dlsym", version))) return found;
|
||||
if ((found = reinterpret_cast<dlsym_fn>(dlvsym(RTLD_NEXT, "dlsym", version)))) break;
|
||||
}
|
||||
return dlsym_fn{};
|
||||
}();
|
||||
return fn;
|
||||
fn.store(found, std::memory_order_relaxed);
|
||||
resolved.store(true, std::memory_order_release);
|
||||
}
|
||||
return fn.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
static void *libc_handle() {
|
||||
static std::atomic<void *> handle{nullptr};
|
||||
static std::atomic<bool> resolved{false};
|
||||
if (!resolved.load(std::memory_order_acquire)) {
|
||||
handle.store(dlopen(LIBC_SO, RTLD_LAZY | RTLD_NOLOAD), std::memory_order_relaxed);
|
||||
resolved.store(true, std::memory_order_release);
|
||||
}
|
||||
return handle.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
__attribute__((constructor)) static void resolve_dlsym_targets() {
|
||||
next_dlsym();
|
||||
libc_handle();
|
||||
}
|
||||
|
||||
static void *global_dlsym(void *, const char *name) { return next_dlsym()(RTLD_DEFAULT, name); }
|
||||
@@ -4547,8 +4621,7 @@ extern "C" __attribute__((visibility("hidden"), used)) void *fakeinput_dlsym_tar
|
||||
dlsym_fn next = next_dlsym();
|
||||
if (!next) return reinterpret_cast<void *>(missing_dlsym);
|
||||
if (handle == RTLD_DEFAULT || handle == RTLD_NEXT || name == nullptr) return reinterpret_cast<void *>(next);
|
||||
static void *const libc = dlopen(LIBC_SO, RTLD_LAZY | RTLD_NOLOAD);
|
||||
if (handle != libc || !interposed(name)) return reinterpret_cast<void *>(next);
|
||||
if (handle != libc_handle() || !interposed(name)) return reinterpret_cast<void *>(next);
|
||||
return reinterpret_cast<void *>(global_dlsym);
|
||||
}
|
||||
|
||||
|
||||
@@ -620,7 +620,8 @@ static void cursor_publish_shown(void) {
|
||||
|
||||
static void cursor_publish_hidden(void) {
|
||||
pthread_mutex_lock(&g_cursor_lock);
|
||||
if (!g_cursor_hidden) { g_cursor_hidden = 1; g_cursor_serial++; }
|
||||
// A client that hides the cursor before ever showing one (gamescope drawing its own) must still be reported.
|
||||
if (!g_cursor_hidden || g_cursor_serial == 0) { g_cursor_hidden = 1; g_cursor_serial++; }
|
||||
pthread_mutex_unlock(&g_cursor_lock);
|
||||
}
|
||||
|
||||
|
||||
@@ -141,6 +141,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var glThread by mutableStateOf(true)
|
||||
private var noGlError by mutableStateOf(true)
|
||||
private var returnAfterGame by mutableStateOf(true)
|
||||
private var valveProtonOnDemand by mutableStateOf(true)
|
||||
private var shaderPrecache by mutableStateOf<Boolean?>(null)
|
||||
private var steamRepairQueued by mutableStateOf(false)
|
||||
private var mangoapp by mutableStateOf(true)
|
||||
@@ -168,6 +169,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var battleNetInstalled by mutableStateOf(false)
|
||||
private var offlineAccount by mutableStateOf<String?>(null)
|
||||
private var offline by mutableStateOf(false)
|
||||
private var offlineAuto by mutableStateOf(true)
|
||||
private var showPerformance by mutableStateOf(false)
|
||||
private var clientOverride by mutableStateOf(false)
|
||||
private var clientCores by mutableStateOf<Set<Int>>(emptySet())
|
||||
@@ -190,7 +192,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var prootNoSeccomp by mutableStateOf(false)
|
||||
private var prootFastPath by mutableStateOf(true)
|
||||
private var nativeUserland by mutableStateOf(true)
|
||||
private var cursorComposite by mutableStateOf(false)
|
||||
private var cursorComposite by mutableStateOf(true)
|
||||
private var guestHostname by mutableStateOf(SessionPrefs.DEFAULT_GUEST_HOSTNAME)
|
||||
private var phantomWarning by mutableStateOf<String?>(null)
|
||||
private var phantomProcessStatus by mutableStateOf(PhantomProcessStatus.NOT_APPLICABLE)
|
||||
@@ -1415,7 +1417,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
gameSyncFolder = gameSyncFolder,
|
||||
busy = busy, stage = stage, percent = percent,
|
||||
desktopInstalled = desktopInstalled, desktopPresent = desktopPresent,
|
||||
offlineAccount = offlineAccount, offline = offline,
|
||||
offlineAccount = offlineAccount, offline = offline, offlineAuto = offlineAuto,
|
||||
frameGenLabel = frameGenLabel, romsDir = romsDir, logsEnabled = logsEnabled,
|
||||
enhancedDiagnosticsArmed = enhancedDiagnosticsArmed,
|
||||
gameDebugLogsEnabled = gameDebugLogsEnabled, gameDebugLogsNeedsRestart = gameDebugLogsNeedsRestart,
|
||||
@@ -1753,6 +1755,11 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
OfflineMode.setEnabled(this, !OfflineMode.enabled(this))
|
||||
offline = OfflineMode.enabled(this)
|
||||
},
|
||||
onOfflineAuto = {
|
||||
OfflineMode.setAuto(this, !OfflineMode.auto(this))
|
||||
offlineAuto = OfflineMode.auto(this)
|
||||
offline = OfflineMode.enabled(this)
|
||||
},
|
||||
onPageBack = { showPerformance = false; showComponents = false; showMapping = false },
|
||||
onSoundtracksIngame = { on ->
|
||||
SessionPrefs.setSoundtracksIngame(this, on)
|
||||
@@ -2384,6 +2391,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
homeScreenEnabled = HomeApp.isHomeScreenEnabled(this)
|
||||
homeAppSelected = homeScreenEnabled && HomeApp.isDefault(this)
|
||||
defaultHomeLabel = HomeApp.defaultLabel(this)
|
||||
com.droiddeck.launcher.ui.NavTabs.syncHomeApps(this, homeAppSelected)
|
||||
refreshAndroidApps()
|
||||
integrationState = readIntegration()
|
||||
}
|
||||
@@ -2784,6 +2792,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
steamClientArch = if (mode == SessionService.MODE_STEAM) steamClientArch else null,
|
||||
returnAfterGame = if (mode == SessionService.MODE_STEAM) returnAfterGame else null,
|
||||
shaderPrecache = if (mode == SessionService.MODE_STEAM) shaderPrecache else null,
|
||||
valveProtonOnDemand = if (mode == SessionService.MODE_STEAM) valveProtonOnDemand else null,
|
||||
steamRepairQueued = steamRepairQueued,
|
||||
mangoapp = mangoapp,
|
||||
steamController = if (mode == SessionService.MODE_STEAM) steamController else null,
|
||||
@@ -2891,6 +2900,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
onMangoapp = { on -> SessionPrefs.setMangoapp(this, on); mangoapp = on },
|
||||
onReturnAfterGame = { on -> SessionPrefs.setReturnAfterGame(this, on); returnAfterGame = on },
|
||||
onShaderPrecache = { on -> SessionPrefs.setShaderPrecache(this, on); shaderPrecache = on },
|
||||
onValveProtonOnDemand = { on -> SessionPrefs.setValveProtonOnDemand(this, on); valveProtonOnDemand = on },
|
||||
onSteamController = { id -> SessionPrefs.setSteamController(this, id); steamController = id },
|
||||
onStartupSession = { id ->
|
||||
SessionPrefs.setStartupSession(this, id)
|
||||
@@ -3163,6 +3173,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
steamRepairQueued = SteamRepair.queued(this)
|
||||
mangoapp = SessionPrefs.mangoapp(this)
|
||||
returnAfterGame = SessionPrefs.returnAfterGame(this)
|
||||
valveProtonOnDemand = SessionPrefs.valveProtonOnDemand(this)
|
||||
loadShaderPrecache(mode)
|
||||
steamController = SessionPrefs.steamController(this)
|
||||
startupSession = SessionPrefs.startupSession(this)
|
||||
@@ -3314,6 +3325,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
battleNetInstalled = com.droiddeck.launcher.runtime.BattleNet.installed(this)
|
||||
offlineAccount = OfflineMode.account(this)
|
||||
offline = OfflineMode.enabled(this)
|
||||
offlineAuto = OfflineMode.auto(this)
|
||||
installed = LinuxRuntimeInstaller.installedVersion(this)
|
||||
ready = LinuxRuntime.isInstalled(this)
|
||||
vkBridge = SessionPrefs.vkBridge(this)
|
||||
|
||||
@@ -49,7 +49,7 @@ internal class ProtonMenu(
|
||||
@VisibleForTesting internal var latestCheck: (Boolean) -> Boolean = { force -> ProtonExtras.checkLatest(activity, force) }
|
||||
@VisibleForTesting internal var experimentalRefresh: () -> List<ExperimentalProtons.Release>? = { ExperimentalProtons.refresh(activity) }
|
||||
@VisibleForTesting internal var installer: (ProtonExtras.Tool, (String, Int) -> Unit) -> String? =
|
||||
{ tool, progress -> ProtonExtras.install(activity, tool, progress) }
|
||||
{ tool, progress -> ProtonExtras.install(activity, tool, onProgress = progress) }
|
||||
|
||||
fun installProton(id: String, automatic: Boolean = false) {
|
||||
val tool = ProtonExtras.tools.firstOrNull { it.id == id } ?: return
|
||||
|
||||
@@ -2834,6 +2834,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
|
||||
private fun installProton(): String? {
|
||||
uiHandler.post { loading.percent = -1; loading.say(getString(PROTON_LINES.downloading), PROTON_LINES.topic, readable = true) }
|
||||
if (com.droiddeck.launcher.session.SessionPrefs.ownProtonFirst(this)) return installOwnProton()
|
||||
val catalog = com.droiddeck.launcher.runtime.DesktopCatalog
|
||||
val cancellation = com.droiddeck.launcher.core.Downloader.Cancellation { SessionState.stopRequested }
|
||||
SessionState.installCancellation = cancellation
|
||||
@@ -2846,6 +2847,24 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
}
|
||||
|
||||
private fun installOwnProton(): String? {
|
||||
val extras = com.droiddeck.launcher.session.ProtonExtras
|
||||
while ((extras.prefetching || extras.installInProgress) && !SessionState.stopRequested) {
|
||||
try { Thread.sleep(250) } catch (_: InterruptedException) { Thread.currentThread().interrupt(); return "interrupted" }
|
||||
}
|
||||
if (SessionState.stopRequested) return "cancelled"
|
||||
if (!com.droiddeck.launcher.runtime.DesktopCatalog.ownProtonMissing(this)) return null
|
||||
val cancellation = com.droiddeck.launcher.core.Downloader.Cancellation { SessionState.stopRequested }
|
||||
SessionState.installCancellation = cancellation
|
||||
return try {
|
||||
extras.install(this, extras.tools.first { it.id == extras.OWN }, cancellation) { label, percent ->
|
||||
uiHandler.post { loading.percent = percent; loading.say(label, PROTON_LINES.topic, readable = true) }
|
||||
}.also { if (it == null) com.droiddeck.launcher.session.Onboarding.recheck(this) }
|
||||
} finally {
|
||||
if (SessionState.installCancellation === cancellation) SessionState.installCancellation = null
|
||||
}
|
||||
}
|
||||
|
||||
override fun surfaceCreated(holder: SurfaceHolder) {
|
||||
if (holder !== outputHolder()) return
|
||||
if (installingRuntime || SessionState.stopRequested || ended) return
|
||||
@@ -3395,8 +3414,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
if (status == 0) SessionState.takeRelaunch()?.let { next ->
|
||||
next.putExtra(EXTRA_RETURN_HOME, intent.getBooleanExtra(EXTRA_RETURN_HOME, false))
|
||||
next.putExtra(EXTRA_LINK_TASK, intent.getIntExtra(EXTRA_LINK_TASK, -1))
|
||||
setIntent(next)
|
||||
recreate()
|
||||
relaunch(next)
|
||||
return@runOnUiThread
|
||||
}
|
||||
showEnded(status, hint)
|
||||
@@ -3404,6 +3422,16 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}, "session-end-hint").start()
|
||||
}
|
||||
|
||||
// recreate() keeps this window, and Compose content added to it afterwards never recomposes, so the
|
||||
// loading screen of the next session stays up over a running session. A new instance gets its own window.
|
||||
// This instance finishes first because the activity is singleTask and would otherwise take the intent itself.
|
||||
private fun relaunch(next: Intent) {
|
||||
closeAtOnce = true
|
||||
super.finish()
|
||||
startActivity(next)
|
||||
overridePendingTransition(0, 0)
|
||||
}
|
||||
|
||||
private fun showEnded(status: Int, hint: EndHint?) {
|
||||
if (status == 0 && hint?.evenOnSuccess != true) {
|
||||
finish()
|
||||
@@ -6031,8 +6059,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
Log.w(TAG, "ignoring agent start while session phase is ${SessionState.phase}")
|
||||
return
|
||||
}
|
||||
setIntent(intent)
|
||||
recreate()
|
||||
relaunch(android.content.Intent(intent).setClass(this, SessionActivity::class.java))
|
||||
return
|
||||
}
|
||||
if (this.intent.getBooleanExtra(EXTRA_RETURN_HOME, false)) intent.putExtra(EXTRA_RETURN_HOME, true)
|
||||
|
||||
@@ -293,6 +293,7 @@ object DeviceReport {
|
||||
k("Stretch 16:9 to panel", SessionPrefs.stretch16x9(context))
|
||||
k("Avoid notch", SessionPrefs.avoidNotch(context))
|
||||
k("Return to launcher after a game", SessionPrefs.returnAfterGame(context))
|
||||
k("Valve Proton only when needed", SessionPrefs.valveProtonOnDemand(context))
|
||||
k("Microphone", SessionPrefs.micEnabled(context))
|
||||
k("On-screen controls", SessionPrefs.oscMode(context))
|
||||
k("Touch mode", SessionPrefs.touchMode(context))
|
||||
|
||||
@@ -239,6 +239,7 @@ object AddedGames {
|
||||
for (entry in AddedExes.list(context)) {
|
||||
val folder = File(entry.folder)
|
||||
if (folder.path in removed || !folder.isDirectory) continue
|
||||
if (StoreGameSidecar.read(folder)?.isInstalled == false) continue
|
||||
scanGame(context, folder, out, single = entry, reuse = true)
|
||||
}
|
||||
for (folder in libraryDepotInstalls(context)) if (folder.path !in removed) scanGame(context, folder, out, reuse = true)
|
||||
@@ -337,9 +338,10 @@ object AddedGames {
|
||||
val owner = ownerFolder(app, exe)
|
||||
if (owner != null && owner.path !in SessionPrefs.removedAddedGames(app)) {
|
||||
single(app, owner.path)?.takeIf { canonical(it.exe) == path }?.let {
|
||||
if (guestPath(app, it.exe) != null) {
|
||||
SessionPrefs.setAddedGameExe(app, owner.path, it.exe.path)
|
||||
AddedExes.put(app, AddedExes.Entry(owner.path, it.exe.path))
|
||||
val keep = listOf(it.exe, exe).firstOrNull { f -> guestPath(app, f) != null }
|
||||
if (keep != null) {
|
||||
SessionPrefs.setAddedGameExe(app, owner.path, keep.path)
|
||||
AddedExes.put(app, AddedExes.Entry(owner.path, keep.path))
|
||||
}
|
||||
return AddResult.Existing(it)
|
||||
}
|
||||
|
||||
@@ -33,6 +33,13 @@ object SocNames {
|
||||
fun name(model: String, platform: String = GpuInfo.systemProperty("ro.board.platform")): String? =
|
||||
MODELS[normalizedModel(model)] ?: PLATFORMS[platform.lowercase()]?.let { "$it family" }
|
||||
|
||||
// Without label's platform-family guess: a rebadged chip such as the Duo's CQ7790S reports a platform it is not.
|
||||
fun plainName(model: String = model(), maker: String = manufacturer()): String =
|
||||
MODELS[normalizedModel(model)]?.let { "$it ($model)" } ?: "$maker $model".trim()
|
||||
|
||||
private fun manufacturer(): String =
|
||||
if (Build.VERSION.SDK_INT >= 31) Build.SOC_MANUFACTURER.takeIf { it != Build.UNKNOWN }.orEmpty() else ""
|
||||
|
||||
fun label(model: String = model(), platform: String = GpuInfo.systemProperty("ro.board.platform")): String {
|
||||
val name = name(model, platform)
|
||||
return when {
|
||||
|
||||
@@ -207,7 +207,8 @@ object BattleNet {
|
||||
val taken = HashSet<File>()
|
||||
fun options(title: Title, folder: File) = listOfNotNull(folder, title.flavor?.let { File(folder, it) }?.takeIf { it.isDirectory })
|
||||
for ((code, game) in games) {
|
||||
val keep = saved[code]?.let(::File)?.takeIf { it in options(game.first, game.second) && it !in taken } ?: continue
|
||||
val want = saved[code]?.let { runCatching { File(it).canonicalFile }.getOrNull() } ?: continue
|
||||
val keep = options(game.first, game.second).firstOrNull { runCatching { it.canonicalFile }.getOrNull() == want }?.takeIf { it !in taken } ?: continue
|
||||
out[code] = keep
|
||||
taken.add(keep)
|
||||
}
|
||||
@@ -244,6 +245,14 @@ object BattleNet {
|
||||
"/" + rootfs.relativize(resolved).joinToString("/")
|
||||
}
|
||||
}.trimEnd('/')
|
||||
if (mapped?.startsWith("/") == true) {
|
||||
val rootfs = LinuxRuntime.rootDir(context)
|
||||
runCatching {
|
||||
val home = rootfs.canonicalFile.toPath()
|
||||
val host = File("$target/$relative").canonicalFile.toPath()
|
||||
if (host.startsWith(home)) File(rootfs, home.relativize(host).toString()) else null
|
||||
}.getOrNull()?.let { return it }
|
||||
}
|
||||
return com.droiddeck.launcher.frontend.AddedGames.hostPath(context, "$target/$relative")
|
||||
}
|
||||
|
||||
|
||||
@@ -109,9 +109,15 @@ object DesktopCatalog {
|
||||
FileUtils.readString(marker(context, id))?.trim()?.takeIf { it.isNotEmpty() }
|
||||
|
||||
fun protonSeedNeeded(context: Context): Boolean =
|
||||
installed(context, PROTON_SEED_ID) == null &&
|
||||
if (com.droiddeck.launcher.session.SessionPrefs.ownProtonFirst(context)) ownProtonMissing(context)
|
||||
else installed(context, PROTON_SEED_ID) == null &&
|
||||
!File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/steamapps/appmanifest_4427310.acf").isFile
|
||||
|
||||
fun ownProtonMissing(context: Context): Boolean {
|
||||
val extras = com.droiddeck.launcher.session.ProtonExtras
|
||||
return extras.installedAll(context, extras.tools.first { it.id == extras.OWN }).isEmpty()
|
||||
}
|
||||
|
||||
const val DESKTOP_ID = "desktop-kde"
|
||||
const val EMULATORS_ID = "emulators"
|
||||
private const val EMULATORS_SCRIPT = "/usr/local/bin/droiddeck-emulators"
|
||||
|
||||
@@ -22,7 +22,7 @@ class RuntimeInstallService : Service() {
|
||||
if (intent?.action == ACTION_PACKAGE) return holdPackage(startId)
|
||||
val removal = intent?.action == ACTION_REMOVE
|
||||
val release = intent?.let(::releaseFrom)
|
||||
startForeground(NOTIFICATION_ID, notification(getString(if (LinuxRuntimeInstaller.isMaintaining()) R.string.desktop_removing else if (removal) R.string.rtinst_removing else R.string.user_apps_starting), -1))
|
||||
val foreground = enterForeground(notification(getString(if (LinuxRuntimeInstaller.isMaintaining()) R.string.desktop_removing else if (removal) R.string.rtinst_removing else R.string.user_apps_starting), -1))
|
||||
if (release == null && !removal) {
|
||||
stopSelf(startId)
|
||||
return START_NOT_STICKY
|
||||
@@ -31,7 +31,7 @@ class RuntimeInstallService : Service() {
|
||||
val manager = getSystemService(NotificationManager::class.java)
|
||||
var shown = ""
|
||||
val progress = LinuxRuntimeInstaller.ProgressListener { stage, percent ->
|
||||
if ("$stage:$percent" != shown) {
|
||||
if (foreground && "$stage:$percent" != shown) {
|
||||
shown = "$stage:$percent"
|
||||
manager?.notify(NOTIFICATION_ID, notification(stage, percent))
|
||||
}
|
||||
@@ -46,7 +46,10 @@ class RuntimeInstallService : Service() {
|
||||
}
|
||||
|
||||
private fun holdPackage(startId: Int): Int {
|
||||
startForeground(NOTIFICATION_ID, notification(packageStage, packagePercent, packageTitle))
|
||||
if (!enterForeground(notification(packageStage, packagePercent, packageTitle))) {
|
||||
stopSelf(startId)
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
Thread({
|
||||
val manager = getSystemService(NotificationManager::class.java)
|
||||
var shown = ""
|
||||
@@ -65,6 +68,15 @@ class RuntimeInstallService : Service() {
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
|
||||
/** Android 12+ refuses a foreground start while the app is in the background; the work then goes on without the notification. */
|
||||
private fun enterForeground(notification: Notification): Boolean = try {
|
||||
startForeground(NOTIFICATION_ID, notification)
|
||||
true
|
||||
} catch (e: IllegalStateException) {
|
||||
android.util.Log.w("RuntimeInstallService", "running without a foreground service: $e")
|
||||
false
|
||||
}
|
||||
|
||||
private fun notification(stage: String, percent: Int, title: String? = null): Notification {
|
||||
val manager = getSystemService(NotificationManager::class.java)
|
||||
manager?.createNotificationChannel(NotificationChannel(CHANNEL_ID, getString(R.string.setup_runtime),
|
||||
|
||||
@@ -2,16 +2,20 @@ package com.droiddeck.launcher.session
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.agent.AgentGuest
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import java.io.File
|
||||
|
||||
object OfflineMode {
|
||||
private const val TAG = "OfflineMode"
|
||||
private const val KEY = "steam_offline"
|
||||
private const val AUTO_KEY = "steam_offline_auto"
|
||||
private const val NETWORK_KEY = "steam_offline_by_network"
|
||||
private val WANTS = Regex("""^(\s*"WantsOfflineMode"\s*")([01])(".*)$""")
|
||||
private val SKIP = Regex("""^(\s*"SkipOfflineModeWarning"\s*")([01])(".*)$""")
|
||||
private val REMEMBER = Regex(""""RememberPassword"\s*"1"""")
|
||||
private val PERSONA = Regex(""""PersonaName"\s*"([^"]*)"""")
|
||||
private const val EVAL_TIMEOUT_MS = 10_000L
|
||||
|
||||
private fun prefs(context: Context) = context.getSharedPreferences("session", Context.MODE_PRIVATE)
|
||||
|
||||
@@ -19,10 +23,12 @@ object OfflineMode {
|
||||
|
||||
private fun x64LoginUsers(root: File) = File(root, "root/.droiddeck-x64/.local/share/Steam/config/loginusers.vdf")
|
||||
|
||||
fun account(context: Context): String? {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val file = x64LoginUsers(root).takeIf { SessionPrefs.activeSteamClientArch(context) == "x86_64" && it.isFile }
|
||||
private fun activeLoginUsers(context: Context, root: File) =
|
||||
x64LoginUsers(root).takeIf { SessionPrefs.activeSteamClientArch(context) == "x86_64" && it.isFile }
|
||||
?: loginUsers(root)
|
||||
|
||||
fun account(context: Context): String? {
|
||||
val file = activeLoginUsers(context, LinuxRuntime.rootDir(context))
|
||||
val text = try {
|
||||
if (file.isFile) file.readText() else return null
|
||||
} catch (e: Exception) {
|
||||
@@ -32,21 +38,114 @@ object OfflineMode {
|
||||
return PERSONA.find(text)?.groupValues?.get(1)?.takeIf { it.isNotBlank() }.orEmpty()
|
||||
}
|
||||
|
||||
fun enabled(context: Context): Boolean = prefs(context).getBoolean(KEY, false)
|
||||
private fun steamWants(context: Context, root: File): Boolean? {
|
||||
val file = activeLoginUsers(context, root)
|
||||
val lines = try {
|
||||
if (file.isFile) file.readLines() else return null
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "could not read loginusers.vdf", e); return null
|
||||
}
|
||||
val values = lines.mapNotNull { WANTS.matchEntire(it)?.groupValues?.get(2) }
|
||||
return if (values.isEmpty()) null else "1" in values
|
||||
}
|
||||
|
||||
internal fun manual(steamWants: Boolean?, automatic: Boolean, saved: Boolean): Boolean =
|
||||
if (steamWants == null) saved else steamWants && !automatic
|
||||
|
||||
internal fun offline(manual: Boolean, online: Boolean, auto: Boolean = true): Boolean = manual || (auto && !online)
|
||||
|
||||
internal fun afterNetworkChange(manual: Boolean, online: Boolean): Boolean = manual && !online
|
||||
|
||||
fun auto(context: Context): Boolean = prefs(context).getBoolean(AUTO_KEY, true)
|
||||
|
||||
fun enabled(context: Context): Boolean = saved(context, LinuxRuntime.rootDir(context))
|
||||
|
||||
fun active(context: Context): Boolean =
|
||||
offline(enabled(context), isOnline(context), auto(context))
|
||||
|
||||
@Synchronized
|
||||
fun setEnabled(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean(KEY, on).apply()
|
||||
apply(context, LinuxRuntime.rootDir(context))
|
||||
write(context, LinuxRuntime.rootDir(context), on)
|
||||
SteamOfflineFollow.request()
|
||||
}
|
||||
|
||||
fun apply(context: Context, root: File) {
|
||||
applyTo(context, loginUsers(root))
|
||||
applyTo(context, x64LoginUsers(root))
|
||||
@Synchronized
|
||||
fun setAuto(context: Context, on: Boolean) {
|
||||
val manual = if (on) false else steamWants(context, LinuxRuntime.rootDir(context)) ?: active(context)
|
||||
prefs(context).edit().putBoolean(AUTO_KEY, on).commit()
|
||||
setEnabled(context, manual)
|
||||
}
|
||||
|
||||
private fun applyTo(context: Context, file: File) {
|
||||
fun apply(context: Context, root: File): Boolean = write(context, root, saved(context, root))
|
||||
|
||||
fun sync(context: Context): Boolean? {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val offline = synchronized(this) { write(context, root, saved(context, root)) }
|
||||
return switchLive(context, offline)
|
||||
}
|
||||
|
||||
fun follow(context: Context): Boolean? {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val (byNetwork, offline) = synchronized(this) {
|
||||
if (!auto(context)) return false
|
||||
prefs(context).getBoolean(NETWORK_KEY, false) to
|
||||
write(context, root, afterNetworkChange(saved(context, root), isOnline(context)))
|
||||
}
|
||||
val result = switchLive(context, offline)
|
||||
if (result == null && !offline && byNetwork) restoreNetworkOffline(context)
|
||||
return result
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
internal fun restoreNetworkOffline(context: Context) {
|
||||
val prefs = prefs(context)
|
||||
if (!auto(context) || prefs.getBoolean(KEY, false) || prefs.getBoolean(NETWORK_KEY, false)) return
|
||||
prefs.edit().putBoolean(NETWORK_KEY, true).apply()
|
||||
}
|
||||
|
||||
private fun isOnline(context: Context) = com.droiddeck.launcher.frontend.AutoComponents.isOnline(context)
|
||||
|
||||
private fun saved(context: Context, root: File): Boolean {
|
||||
val prefs = prefs(context)
|
||||
return manual(steamWants(context, root), prefs.getBoolean(NETWORK_KEY, false), prefs.getBoolean(KEY, false))
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
private fun remember(context: Context, manual: Boolean): Boolean {
|
||||
val online = isOnline(context)
|
||||
val auto = auto(context)
|
||||
val offline = offline(manual, online, auto)
|
||||
prefs(context).edit().putBoolean(KEY, manual).putBoolean(NETWORK_KEY, offline && !manual).apply()
|
||||
Log.i(TAG, "auto=$auto manual=$manual online=$online offline=$offline")
|
||||
return offline
|
||||
}
|
||||
|
||||
private fun switchLive(context: Context, offline: Boolean): Boolean? {
|
||||
val answer = try {
|
||||
AgentGuest.steamEval(context, "$SWITCH($offline)", EVAL_TIMEOUT_MS)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "steam not reachable: ${e.javaClass.simpleName}: ${e.message}")
|
||||
return null
|
||||
}
|
||||
val result = if (answer.optBoolean("ok")) answer.optString("value") else answer.optJSONObject("error")?.optString("message")
|
||||
Log.i(TAG, "live offline=$offline: $result")
|
||||
return when (result) {
|
||||
"switched" -> true
|
||||
"same" -> false
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
private fun write(context: Context, root: File, manual: Boolean): Boolean {
|
||||
val offline = remember(context, manual)
|
||||
applyTo(loginUsers(root), offline)
|
||||
applyTo(x64LoginUsers(root), offline)
|
||||
return offline
|
||||
}
|
||||
|
||||
private fun applyTo(file: File, offline: Boolean) {
|
||||
if (!file.isFile) return
|
||||
val want = if (enabled(context)) "1" else "0"
|
||||
val want = if (offline) "1" else "0"
|
||||
try {
|
||||
val lines = file.readLines()
|
||||
val out = ArrayList<String>(lines.size + 4)
|
||||
@@ -94,4 +193,25 @@ object OfflineMode {
|
||||
Log.w(TAG, "could not write loginusers.vdf", e)
|
||||
}
|
||||
}
|
||||
|
||||
private val SWITCH = """(async want => {
|
||||
const user = globalThis.SteamClient?.User;
|
||||
if (typeof user?.GoOffline !== 'function' || typeof user?.GoOnline !== 'function') return "missing";
|
||||
const seen = globalThis.__droiddeckSteamOffline ??= { value: null };
|
||||
seen.want = want;
|
||||
if (!seen.registered) {
|
||||
seen.registered = true;
|
||||
user.RegisterForCurrentUserChanges(u => { seen.value = !!u?.bIsOfflineMode; });
|
||||
globalThis.SteamClient.GameSessions?.RegisterForAppLifetimeNotifications?.(n => {
|
||||
if (n?.bRunning) return;
|
||||
setTimeout(() => { if (seen.want === true && seen.value === false) user.GoOffline(); }, 2000);
|
||||
});
|
||||
}
|
||||
for (let waited = 0; seen.value === null && waited < 4000; waited += 100) await new Promise(done => setTimeout(done, 100));
|
||||
const current = seen.value;
|
||||
if (current === null) return "unknown";
|
||||
if (current === want) return "same";
|
||||
if (want) user.GoOffline(); else user.GoOnline();
|
||||
return "switched";
|
||||
})"""
|
||||
}
|
||||
@@ -249,21 +249,24 @@ object ProtonExtras {
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun install(context: Context, tool: Tool, onProgress: (String, Int) -> Unit): String? {
|
||||
fun install(context: Context, tool: Tool, cancelled: java.util.function.BooleanSupplier? = null,
|
||||
onProgress: (String, Int) -> Unit): String? {
|
||||
if (installInProgress || prefetching) return context.getString(R.string.pextra_busy)
|
||||
installInProgress = true
|
||||
return try { installNow(context, tool, onProgress) } finally { installInProgress = false }
|
||||
return try { installNow(context, tool, cancelled, onProgress) } finally { installInProgress = false }
|
||||
}
|
||||
|
||||
private fun fetchArchive(context: Context, tool: Tool, asset: Asset, archive: File, onProgress: (String, Int) -> Unit): String? {
|
||||
private fun fetchArchive(context: Context, tool: Tool, asset: Asset, archive: File, onProgress: (String, Int) -> Unit,
|
||||
cancelled: java.util.function.BooleanSupplier? = null): String? {
|
||||
val downloading = context.getString(R.string.pextra_downloading, tool.name, asset.tag)
|
||||
onProgress(downloading, 0)
|
||||
var downloaded = false
|
||||
for (attempt in 0 until 5) {
|
||||
downloaded = Downloader.downloadFile(asset.url, archive, true, asset.sha256) { fraction ->
|
||||
downloaded = Downloader.downloadFile(asset.url, archive, true, asset.sha256, cancelled) { fraction ->
|
||||
onProgress(downloading, if (fraction < 0) -1 else (fraction * 100f).toInt().coerceIn(0, 100))
|
||||
}
|
||||
if (downloaded) break
|
||||
if (cancelled?.asBoolean == true) return context.getString(R.string.pextra_interrupted)
|
||||
if (attempt < 4) {
|
||||
onProgress(context.getString(R.string.pextra_retrying, attempt + 2, 5), -1)
|
||||
try { Thread.sleep(3_000) } catch (_: InterruptedException) {
|
||||
@@ -297,7 +300,8 @@ object ProtonExtras {
|
||||
return problem
|
||||
}
|
||||
|
||||
private fun installNow(context: Context, tool: Tool, onProgress: (String, Int) -> Unit): String? {
|
||||
private fun installNow(context: Context, tool: Tool, cancelled: java.util.function.BooleanSupplier?,
|
||||
onProgress: (String, Int) -> Unit): String? {
|
||||
if (SessionState.running) return context.getString(R.string.pextra_stop_session)
|
||||
if (!LinuxRuntime.isInstalled(context)) return context.getString(R.string.user_apps_runtime_required)
|
||||
|
||||
@@ -312,7 +316,7 @@ object ProtonExtras {
|
||||
|
||||
val checked = asset.sha256 != null && asset.size > 0 && checkedArchive == fingerprint(archive) &&
|
||||
checkedDigest.equals(asset.sha256, ignoreCase = true)
|
||||
if (!checked) fetchArchive(context, tool, asset, archive, onProgress)?.let { return it }
|
||||
if (!checked) fetchArchive(context, tool, asset, archive, onProgress, cancelled)?.let { return it }
|
||||
if (asset.size > 0 && archive.length() != asset.size) {
|
||||
if (archive.length() > asset.size) {
|
||||
archive.delete()
|
||||
|
||||
@@ -28,12 +28,14 @@ object SessionFiles {
|
||||
"usr/local/bin/droiddeck-bottom-desktop" to "usr/local/bin/droiddeck-bottom-desktop",
|
||||
"usr/local/bin/droiddeck-gpu" to "usr/local/bin/droiddeck-gpu",
|
||||
"usr/local/bin/droiddeck-desktop-gpu" to "usr/local/bin/droiddeck-desktop-gpu",
|
||||
"usr/local/bin/droiddeck-device-info" to "usr/local/bin/droiddeck-device-info",
|
||||
"usr/local/bin/droiddeck-desktop-window-rules" to "usr/local/bin/droiddeck-desktop-window-rules",
|
||||
"usr/local/bin/droiddeck-library-perms" to "usr/local/bin/droiddeck-library-perms",
|
||||
"usr/local/bin/droiddeck-ime" to "usr/local/bin/droiddeck-ime",
|
||||
"usr/local/bin/kwin_wayland_wrapper" to "usr/local/bin/kwin_wayland_wrapper",
|
||||
"usr/lib/firefox/defaults/pref/droiddeck.js" to "usr/lib/firefox/defaults/pref/droiddeck.js",
|
||||
"etc/xdg/autostart/droiddeck-clipboard.desktop" to "etc/xdg/autostart/droiddeck-clipboard.desktop",
|
||||
"etc/xdg/fastfetch/config.jsonc" to "etc/xdg/fastfetch/config.jsonc",
|
||||
)
|
||||
|
||||
private val SERVICE_PACKS = mapOf(
|
||||
@@ -143,6 +145,7 @@ object SessionFiles {
|
||||
"usr/local/bin/droiddeck-proton-extra" to "usr/local/bin/droiddeck-proton-extra",
|
||||
"usr/local/bin/droiddeck-netmanager" to "usr/local/bin/droiddeck-netmanager",
|
||||
"usr/local/bin/droiddeck-login1" to "usr/local/bin/droiddeck-login1",
|
||||
"usr/local/bin/droiddeck-documents" to "usr/local/bin/droiddeck-documents",
|
||||
"usr/local/bin/droiddeck-steam-launch" to "usr/local/bin/droiddeck-steam-launch",
|
||||
"usr/local/bin/droiddeck-desktop-games" to "usr/local/bin/droiddeck-desktop-games",
|
||||
"usr/local/bin/droiddeck-desktop-programs" to "usr/local/bin/droiddeck-desktop-programs",
|
||||
|
||||
@@ -448,6 +448,13 @@ object SessionPrefs {
|
||||
prefs(context).edit().putString("navTabHidden", keys.joinToString(",")).apply()
|
||||
}
|
||||
|
||||
fun appsTabHomeSeen(context: Context): Boolean? =
|
||||
prefs(context).takeIf { it.contains("appsTabHomeSeen") }?.getBoolean("appsTabHomeSeen", false)
|
||||
|
||||
fun setAppsTabHomeSeen(context: Context, seen: Boolean) {
|
||||
prefs(context).edit().putBoolean("appsTabHomeSeen", seen).apply()
|
||||
}
|
||||
|
||||
private fun idList(raw: String?): List<String> = raw.orEmpty().split(',').map { it.trim() }.filter { it.isNotEmpty() }
|
||||
|
||||
val STORES_SORTS = listOf("lastPlayed", "recentlyInstalled", "titleAsc", "titleDesc", "sizeDesc", "sizeAsc", "releaseDateDesc")
|
||||
@@ -838,6 +845,15 @@ object SessionPrefs {
|
||||
|
||||
fun returnAfterGame(context: Context): Boolean = prefs(context).getBoolean("returnAfterGame", true)
|
||||
|
||||
fun valveProtonOnDemand(context: Context): Boolean = prefs(context).getBoolean("valveProtonOnDemand", true)
|
||||
|
||||
fun setValveProtonOnDemand(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("valveProtonOnDemand", on).apply()
|
||||
}
|
||||
|
||||
/** DroidDeck-Proton is the Proton placed before the client starts; Valve's ARM64 Proton waits for a title that needs it. */
|
||||
fun ownProtonFirst(context: Context): Boolean = valveProtonOnDemand(context) && !ProtonExtras.declined(context)
|
||||
|
||||
fun setReturnAfterGame(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("returnAfterGame", on).apply()
|
||||
}
|
||||
@@ -1042,7 +1058,7 @@ object SessionPrefs {
|
||||
prefs(context).edit().putBoolean("prootFastPath", on).apply()
|
||||
}
|
||||
|
||||
fun cursorComposite(context: Context): Boolean = prefs(context).getBoolean("cursorComposite", false)
|
||||
fun cursorComposite(context: Context): Boolean = prefs(context).getBoolean("cursorComposite", true)
|
||||
|
||||
fun setCursorComposite(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("cursorComposite", on).apply()
|
||||
|
||||
@@ -669,6 +669,8 @@ class SessionService : Service() {
|
||||
guest.add("DROIDDECK_WSI_BYPASS_CHECK_MS=100")
|
||||
guest.add("WINE_OFFSCREEN_CHECK_MS=100")
|
||||
guest.add("DD_REFRESH=" + Math.round(SessionState.refreshHz))
|
||||
guest.add("DD_DEVICE_NAME=" + android.os.Build.MODEL)
|
||||
com.droiddeck.launcher.gpu.SocNames.plainName().takeIf { it.isNotEmpty() }?.let { guest.add("DD_SOC_NAME=$it") }
|
||||
guest.add("DD_LOG=" + sessionLog.path)
|
||||
guest.add("DD_DEBUG_DIR=" + sessionDir.path)
|
||||
if (EnhancedDiagnostics.isActive(this, sessionDir)) guest.add("DROIDDECK_ENHANCED_DIAGNOSTICS=1")
|
||||
@@ -694,7 +696,7 @@ class SessionService : Service() {
|
||||
val added = SessionEvents.step("added-games-scan") { com.droiddeck.launcher.frontend.AddedGames.scan(this) }
|
||||
val listing = SessionEvents.step("added-games-listing") { com.droiddeck.launcher.frontend.AddedGames.writeListing(this, added) }
|
||||
guest.add("DD_ADDED_GAMES=" + listing.path)
|
||||
if (OfflineMode.enabled(this)) guest.add("DD_STEAM_OFFLINE=1")
|
||||
if (OfflineMode.active(this)) guest.add("DD_STEAM_OFFLINE=1")
|
||||
if (com.droiddeck.launcher.gpu.Lossless.owned(this)) guest.add("DD_LOSSLESS_OWNED=1")
|
||||
if (added.isNotEmpty()) Log.i(TAG, "added games: " + added.joinToString { "${it.name} (${it.exe.name})" })
|
||||
}
|
||||
@@ -813,6 +815,11 @@ class SessionService : Service() {
|
||||
.onFailure { Log.w(TAG, "desktop language pack: $it") }
|
||||
}
|
||||
|
||||
if (SessionState.mode == MODE_STEAM || SessionState.mode == MODE_DESKTOP) {
|
||||
val steamOffline = SteamOfflineFollow()
|
||||
steamOffline.attach(this)
|
||||
components.add(steamOffline)
|
||||
}
|
||||
val networkLink = LinuxNetworkLinkComponent(this, root)
|
||||
networkLink.attach(this)
|
||||
networkLink.publish()
|
||||
@@ -1002,6 +1009,7 @@ class SessionService : Service() {
|
||||
))
|
||||
guest.add("TZ=" + java.util.TimeZone.getDefault().id)
|
||||
if (SessionState.mode == MODE_STEAM) SessionPrefs.pendingShaderPrecache(this)?.let { guest.add("DD_SHADER_PRECACHE=" + if (it) "1" else "0") }
|
||||
guest.add("DD_VALVE_PROTON=" + if (SessionPrefs.ownProtonFirst(this)) "0" else "1")
|
||||
guest.add("XDG_RUNTIME_DIR=" + LinuxRuntime.GUEST_RUNTIME_DIR)
|
||||
guest.add("XDG_SESSION_TYPE=wayland")
|
||||
guest.add("WAYLAND_DISPLAY=wayland-0")
|
||||
|
||||
@@ -25,7 +25,7 @@ object SettingsReset {
|
||||
"noXalia", "fastSync", "fsyncFirst", "syncFallback", "prootNoSeccomp", "prootFastPath", "nativeUserland", "cursorComposite",
|
||||
"guestHostname", "fexPreset", "forceSsbs", "logs", "gameDebugLogsEnabled", "enhancedDiagnosticsNext", "storageDiagnostics", "buildWatermark",
|
||||
"upscaler", "upscaleSharpness", "screenEffects", "blackFrameInsertion", "textureAnisotropy", "textureLodBias",
|
||||
"steamDownloadsInBackground", "steam_offline", "bootMovie", "bootMovieSound", "bootMovieVolume", "bootMovieSeconds", "skipBootMovie",
|
||||
"steamDownloadsInBackground", "steam_offline", "steam_offline_auto", "steam_offline_by_network", "bootMovie", "bootMovieSound", "bootMovieVolume", "bootMovieSeconds", "skipBootMovie",
|
||||
"bootMovieApplyNext", "bootMovieSteamSeen", "bootMovieShuffle",
|
||||
"questDefaultsV1", "telemetryAuto", "telemetryOff", "statsStrip", "statsHud", "bottomHud", "bottomStripMetrics", "bottomStripTabs", "statsDash", "statsSpeedUnit",
|
||||
)
|
||||
@@ -67,7 +67,7 @@ object SettingsReset {
|
||||
}
|
||||
|
||||
QuestExperimental.initialize(context)
|
||||
runCatching { OfflineMode.apply(context, LinuxRuntime.rootDir(context)) }
|
||||
runCatching { OfflineMode.setEnabled(context, false) }
|
||||
.onFailure { ok = false; Log.w(TAG, "Could not turn offline mode off", it) }
|
||||
runCatching { GameEnvironmentStore.publish(context) }
|
||||
.onFailure { ok = false; Log.w(TAG, "Could not update game environment", it) }
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import android.net.ConnectivityManager
|
||||
import android.net.Network
|
||||
import android.net.NetworkCapabilities
|
||||
import android.os.Handler
|
||||
import android.os.HandlerThread
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.core.SessionPart
|
||||
import com.droiddeck.launcher.frontend.AutoComponents
|
||||
|
||||
class SteamOfflineFollow : SessionPart() {
|
||||
private var thread: HandlerThread? = null
|
||||
@Volatile private var handler: Handler? = null
|
||||
private var callback: ConnectivityManager.NetworkCallback? = null
|
||||
private var online: Boolean? = null
|
||||
private var retries = 0
|
||||
private var requested = false
|
||||
|
||||
private val check = object : Runnable {
|
||||
override fun run() {
|
||||
val handler = handler ?: return
|
||||
if (SessionState.running && SessionState.suspended) {
|
||||
handler.postDelayed(this, SUSPENDED_POLL_MS)
|
||||
return
|
||||
}
|
||||
val result = if (requested) OfflineMode.sync(app()) else OfflineMode.follow(app())
|
||||
if (result != null) requested = false
|
||||
if (result == null && retries < MAX_RETRIES) {
|
||||
retries++
|
||||
handler.postDelayed(this, RETRY_MS)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun start() {
|
||||
val started = HandlerThread("steam-offline").also { it.start() }
|
||||
val handler = Handler(started.looper)
|
||||
thread = started
|
||||
this.handler = handler
|
||||
val registered = object : ConnectivityManager.NetworkCallback() {
|
||||
override fun onCapabilitiesChanged(network: Network, capabilities: NetworkCapabilities) =
|
||||
changed(capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) &&
|
||||
capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED))
|
||||
override fun onLost(network: Network) = changed(false)
|
||||
}
|
||||
callback = registered
|
||||
active = this
|
||||
online = AutoComponents.isOnline(app())
|
||||
app().getSystemService(ConnectivityManager::class.java).registerDefaultNetworkCallback(registered, handler)
|
||||
sync()
|
||||
}
|
||||
|
||||
private fun changed(now: Boolean) {
|
||||
val handler = handler ?: return
|
||||
if (now == online) return
|
||||
online = now
|
||||
handler.removeCallbacks(check)
|
||||
retries = 0
|
||||
if (OfflineMode.auto(app())) requested = false
|
||||
handler.postDelayed(check, if (now) ONLINE_DELAY_MS else OFFLINE_DELAY_MS)
|
||||
}
|
||||
|
||||
private fun sync() {
|
||||
handler?.post {
|
||||
val handler = handler ?: return@post
|
||||
handler.removeCallbacks(check)
|
||||
retries = 0
|
||||
requested = true
|
||||
handler.post(check)
|
||||
}
|
||||
}
|
||||
|
||||
override fun stop() {
|
||||
if (active === this) active = null
|
||||
val registered = callback
|
||||
callback = null
|
||||
if (registered != null) {
|
||||
try {
|
||||
app().getSystemService(ConnectivityManager::class.java).unregisterNetworkCallback(registered)
|
||||
} catch (e: IllegalArgumentException) {
|
||||
Log.w(TAG, "network callback was already gone", e)
|
||||
}
|
||||
}
|
||||
handler?.removeCallbacksAndMessages(null)
|
||||
handler = null
|
||||
thread?.quitSafely()
|
||||
thread = null
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "SteamOfflineFollow"
|
||||
@Volatile private var active: SteamOfflineFollow? = null
|
||||
const val ONLINE_DELAY_MS = 2_000L
|
||||
const val OFFLINE_DELAY_MS = 10_000L
|
||||
const val RETRY_MS = 15_000L
|
||||
const val MAX_RETRIES = 8
|
||||
const val SUSPENDED_POLL_MS = 1_000L
|
||||
|
||||
fun request() {
|
||||
active?.sync()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,6 +103,7 @@ class FrontEndState(
|
||||
val desktopPresent: Boolean = desktopInstalled,
|
||||
val offlineAccount: String?,
|
||||
val offline: Boolean,
|
||||
val offlineAuto: Boolean = true,
|
||||
val frameGenLabel: String,
|
||||
val romsDir: String?,
|
||||
val logsEnabled: Boolean,
|
||||
@@ -273,6 +274,7 @@ class FrontEndActions(
|
||||
val onClearLogs: () -> Unit = {},
|
||||
val onResetSettings: () -> Unit = {},
|
||||
val onOffline: () -> Unit,
|
||||
val onOfflineAuto: () -> Unit = {},
|
||||
val onPageBack: () -> Unit = {},
|
||||
val onTheme: (String) -> Unit = {},
|
||||
val onLanguage: (String) -> Unit = {},
|
||||
|
||||
@@ -93,6 +93,7 @@ class ModeSettings(
|
||||
val steamClientArch: String? = null,
|
||||
val returnAfterGame: Boolean? = null,
|
||||
val shaderPrecache: Boolean? = null,
|
||||
val valveProtonOnDemand: Boolean? = null,
|
||||
val steamRepairQueued: Boolean = false,
|
||||
val mangoapp: Boolean = true,
|
||||
val steamController: String? = null,
|
||||
@@ -158,6 +159,7 @@ class ModeSettingsActions(
|
||||
val onMangoapp: (Boolean) -> Unit = {},
|
||||
val onReturnAfterGame: (Boolean) -> Unit = {},
|
||||
val onShaderPrecache: (Boolean) -> Unit = {},
|
||||
val onValveProtonOnDemand: (Boolean) -> Unit = {},
|
||||
val onSteamController: (String) -> Unit = {},
|
||||
val onUnfoldedControls: (Boolean) -> Unit = {},
|
||||
val onUnfoldedControlsWithController: (Boolean) -> Unit = {},
|
||||
@@ -534,6 +536,10 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras:
|
||||
stringResource(R.string.mode_shader_precache_hint),
|
||||
s.shaderPrecache, onChange = a.onShaderPrecache,
|
||||
)
|
||||
if (s.valveProtonOnDemand != null) ToggleRow(
|
||||
host, "valveprotonondemand", stringResource(R.string.mode_valve_proton_on_demand), null,
|
||||
s.valveProtonOnDemand, onChange = a.onValveProtonOnDemand,
|
||||
)
|
||||
SettingsRow(
|
||||
stringResource(R.string.mode_steam_repair),
|
||||
stringResource(if (s.steamRepairQueued) R.string.mode_steam_repair_queued else R.string.mode_steam_repair_hint),
|
||||
|
||||
@@ -27,9 +27,9 @@ internal object DeveloperTools {
|
||||
internal object NavTabs {
|
||||
const val MORE = "more"
|
||||
val ALL = listOf("steam", "desktop", "games", "downloads", "setup", "updates", "stores", "soundtracks", "components", "storage", "sync", "decky", "boot-movies", "android-apps", "agent")
|
||||
val DEFAULT_SHELVED = setOf("soundtracks", "components", "storage", "sync", "decky", "boot-movies", "android-apps", "agent")
|
||||
val DEFAULT_SHELVED = setOf("soundtracks", "components", "storage", "sync", "decky", "boot-movies", "agent")
|
||||
val DEFAULT_HIDDEN = setOf("android-apps", "agent")
|
||||
private val SHELVED_WHEN_NEW = setOf("storage", "sync", "decky", "boot-movies", "android-apps", "agent")
|
||||
private val SHELVED_WHEN_NEW = setOf("storage", "sync", "decky", "boot-movies", "agent")
|
||||
private val OLD_ORDER = listOf("steam", "games", "soundtracks", "stores", "downloads", "desktop", "agent", "components", "android-apps", "storage", "sync", "setup", "updates")
|
||||
private val OLD_SHELVED = setOf("soundtracks", "agent", "storage", "sync")
|
||||
private const val LAYOUT_VERSION = 2
|
||||
@@ -95,6 +95,15 @@ internal object NavTabs {
|
||||
else -> true
|
||||
}
|
||||
|
||||
// Apps only has content when DroidDeck is the home app, so it follows that state on each change and
|
||||
// otherwise stays wherever the user put it.
|
||||
fun syncHomeApps(context: Context, homeSelected: Boolean) {
|
||||
val seen = SessionPrefs.appsTabHomeSeen(context)
|
||||
SessionPrefs.setAppsTabHomeSeen(context, homeSelected)
|
||||
if (seen == homeSelected || (seen == null && !homeSelected)) return
|
||||
setHidden(context, "android-apps", !homeSelected)
|
||||
}
|
||||
|
||||
fun hideable(key: String) = key != "setup"
|
||||
|
||||
fun place(s: FrontEndState, key: String): TabPlace = when {
|
||||
|
||||
@@ -115,10 +115,11 @@ internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier)
|
||||
account = { host ->
|
||||
SettingsGroup(stringResource(R.string.setup_account)) {
|
||||
ToggleRow(
|
||||
host, "offline", stringResource(R.string.setup_offline),
|
||||
host, "offline-auto", stringResource(R.string.setup_offline_auto),
|
||||
s.offlineAccount?.let { if (it.isEmpty()) stringResource(R.string.setup_signed_in_unnamed) else stringResource(R.string.setup_signed_in, it) } ?: stringResource(R.string.setup_sign_in_first),
|
||||
s.offline, enabled = s.offlineAccount != null,
|
||||
) { a.onOffline() }
|
||||
s.offlineAuto, enabled = s.offlineAccount != null,
|
||||
) { a.onOfflineAuto() }
|
||||
if (!s.offlineAuto) ToggleRow(host, "offline", stringResource(R.string.setup_offline), null, s.offline, enabled = s.offlineAccount != null) { a.onOffline() }
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
@@ -934,6 +934,7 @@
|
||||
<string name="setup_reset_settings_session_running">أوقف الجلسة قبل إعادة تعيين الإعدادات.</string>
|
||||
<string name="setup_reset_settings_partial">أُعيد تعيين الإعدادات، لكن ليس كلها. التفاصيل في السجلات.</string>
|
||||
<string name="setup_offline">وضع عدم الاتصال</string>
|
||||
<string name="setup_offline_auto">وضع عدم الاتصال التلقائي</string>
|
||||
<string name="setup_sign_in_first">سجّل الدخول إلى Steam أولًا</string>
|
||||
<string name="setup_launcher">المشغّل</string>
|
||||
<string name="setup_language">اللغة</string>
|
||||
|
||||
@@ -952,6 +952,7 @@
|
||||
<string name="setup_reset_settings_session_running">Detén la sesión antes de restablecer los ajustes.</string>
|
||||
<string name="setup_reset_settings_partial">Los ajustes se restablecieron, pero algunas partes no se pudieron restablecer. Los registros tienen los detalles.</string>
|
||||
<string name="setup_offline">Modo sin conexión</string>
|
||||
<string name="setup_offline_auto">Modo sin conexión automático</string>
|
||||
<string name="setup_sign_in_first">Inicia sesión en Steam primero</string>
|
||||
<string name="setup_launcher">Launcher</string>
|
||||
<string name="setup_language">Idioma</string>
|
||||
|
||||
@@ -922,6 +922,7 @@
|
||||
<string name="setup_reset_settings_session_running">Спри сесията, преди да нулираш настройките.</string>
|
||||
<string name="setup_reset_settings_partial">Настройките са нулирани, но не всички. Подробностите са в логовете.</string>
|
||||
<string name="setup_offline">Офлайн режим</string>
|
||||
<string name="setup_offline_auto">Автоматичен офлайн режим</string>
|
||||
<string name="setup_sign_in_first">Първо влезте в Steam</string>
|
||||
<string name="setup_launcher">Лаунчър</string>
|
||||
<string name="setup_language">Език</string>
|
||||
|
||||
@@ -928,6 +928,7 @@
|
||||
<string name="setup_reset_settings_session_running">Před obnovením nastavení zastav relaci.</string>
|
||||
<string name="setup_reset_settings_partial">Nastavení byla obnovena, ale ne všechna. Podrobnosti jsou v logech.</string>
|
||||
<string name="setup_offline">Režim offline</string>
|
||||
<string name="setup_offline_auto">Automatický režim offline</string>
|
||||
<string name="setup_sign_in_first">Nejprve se přihlaste ke Steamu</string>
|
||||
<string name="setup_launcher">Spouštěč</string>
|
||||
<string name="setup_language">Jazyk</string>
|
||||
|
||||
@@ -922,6 +922,7 @@
|
||||
<string name="setup_reset_settings_session_running">Stop sessionen, før du nulstiller indstillinger.</string>
|
||||
<string name="setup_reset_settings_partial">Indstillingerne blev nulstillet, men ikke alle. Detaljerne står i loggen.</string>
|
||||
<string name="setup_offline">Offlinetilstand</string>
|
||||
<string name="setup_offline_auto">Automatisk offlinetilstand</string>
|
||||
<string name="setup_sign_in_first">Log ind på Steam først</string>
|
||||
<string name="setup_launcher">Launcher</string>
|
||||
<string name="setup_language">Sprog</string>
|
||||
|
||||
@@ -914,6 +914,7 @@
|
||||
<string name="setup_log_export_failed">Sitzungsprotokolle konnten nicht gespeichert werden.</string>
|
||||
<string name="setup_log_delete_failed">Sitzungsprotokolle konnten nicht gelöscht werden.</string>
|
||||
<string name="setup_offline">Offlinemodus</string>
|
||||
<string name="setup_offline_auto">Automatischer Offlinemodus</string>
|
||||
<string name="setup_sign_in_first">Melde dich zuerst bei Steam an</string>
|
||||
<string name="setup_launcher">Launcher</string>
|
||||
<string name="setup_language">Sprache</string>
|
||||
|
||||
@@ -922,6 +922,7 @@
|
||||
<string name="setup_reset_settings_session_running">Σταμάτησε τη συνεδρία πριν κάνεις επαναφορά ρυθμίσεων.</string>
|
||||
<string name="setup_reset_settings_partial">Οι ρυθμίσεις επαναφέρθηκαν, αλλά όχι όλες. Οι λεπτομέρειες είναι στα αρχεία καταγραφής.</string>
|
||||
<string name="setup_offline">Λειτουργία εκτός σύνδεσης</string>
|
||||
<string name="setup_offline_auto">Αυτόματη λειτουργία εκτός σύνδεσης</string>
|
||||
<string name="setup_sign_in_first">Συνδεθείτε πρώτα στο Steam</string>
|
||||
<string name="setup_launcher">Εκκινητής</string>
|
||||
<string name="setup_language">Γλώσσα</string>
|
||||
|
||||
@@ -925,6 +925,7 @@
|
||||
<string name="setup_reset_settings_session_running">Detén la sesión antes de restablecer los ajustes.</string>
|
||||
<string name="setup_reset_settings_partial">Los ajustes se restablecieron, pero algunas partes no se pudieron restablecer. Los registros tienen los detalles.</string>
|
||||
<string name="setup_offline">Modo sin conexión</string>
|
||||
<string name="setup_offline_auto">Modo sin conexión automático</string>
|
||||
<string name="setup_sign_in_first">Inicia sesión en Steam primero</string>
|
||||
<string name="setup_launcher">Launcher</string>
|
||||
<string name="setup_language">Idioma</string>
|
||||
|
||||
@@ -922,6 +922,7 @@
|
||||
<string name="setup_reset_settings_session_running">Pysäytä istunto ennen asetusten palauttamista.</string>
|
||||
<string name="setup_reset_settings_partial">Asetukset palautettiin, mutta ei kaikkia. Tiedot ovat lokeissa.</string>
|
||||
<string name="setup_offline">Offline-tila</string>
|
||||
<string name="setup_offline_auto">Automaattinen offline-tila</string>
|
||||
<string name="setup_sign_in_first">Kirjaudu Steamiin ensin</string>
|
||||
<string name="setup_launcher">Käynnistin</string>
|
||||
<string name="setup_language">Kieli</string>
|
||||
|
||||
@@ -925,6 +925,7 @@
|
||||
<string name="setup_reset_settings_session_running">Arrêtez la session avant de réinitialiser les paramètres.</string>
|
||||
<string name="setup_reset_settings_partial">Les paramètres ont été réinitialisés, mais certaines parties n\'ont pas pu l\'être. Les journaux contiennent les détails.</string>
|
||||
<string name="setup_offline">Mode hors ligne</string>
|
||||
<string name="setup_offline_auto">Mode hors ligne automatique</string>
|
||||
<string name="setup_sign_in_first">Veuillez d\'abord vous connecter à Steam</string>
|
||||
<string name="setup_launcher">Lanceur</string>
|
||||
<string name="setup_language">Langue</string>
|
||||
|
||||
@@ -922,6 +922,7 @@
|
||||
<string name="setup_reset_settings_session_running">सेटिंग रीसेट करने से पहले सेशन रोकें।</string>
|
||||
<string name="setup_reset_settings_partial">सेटिंग रीसेट हुईं, पर सभी नहीं। विवरण लॉग में हैं।</string>
|
||||
<string name="setup_offline">ऑफ़लाइन मोड</string>
|
||||
<string name="setup_offline_auto">स्वचालित ऑफ़लाइन मोड</string>
|
||||
<string name="setup_sign_in_first">पहले Steam में साइन इन करें</string>
|
||||
<string name="setup_launcher">लॉन्चर</string>
|
||||
<string name="setup_language">भाषा</string>
|
||||
|
||||
@@ -922,6 +922,7 @@
|
||||
<string name="setup_reset_settings_session_running">A beállítások visszaállítása előtt állítsd le a munkamenetet.</string>
|
||||
<string name="setup_reset_settings_partial">A beállítások visszaálltak, de nem mindegyik. A részletek a naplókban vannak.</string>
|
||||
<string name="setup_offline">Offline mód</string>
|
||||
<string name="setup_offline_auto">Automatikus offline mód</string>
|
||||
<string name="setup_sign_in_first">Előbb jelentkezzen be a Steambe</string>
|
||||
<string name="setup_launcher">Indítóalkalmazás</string>
|
||||
<string name="setup_language">Nyelv</string>
|
||||
|
||||
@@ -919,6 +919,7 @@
|
||||
<string name="setup_reset_settings_session_running">Hentikan sesi sebelum menyetel ulang setelan.</string>
|
||||
<string name="setup_reset_settings_partial">Setelan disetel ulang, tetapi tidak semuanya. Rinciannya ada di log.</string>
|
||||
<string name="setup_offline">Mode luring</string>
|
||||
<string name="setup_offline_auto">Mode luring otomatis</string>
|
||||
<string name="setup_sign_in_first">Masuk ke Steam terlebih dahulu</string>
|
||||
<string name="setup_launcher">Peluncur</string>
|
||||
<string name="setup_language">Bahasa</string>
|
||||
|
||||
@@ -917,6 +917,7 @@
|
||||
<string name="setup_log_export_failed">Impossibile salvare i log di sessione.</string>
|
||||
<string name="setup_log_delete_failed">Impossibile eliminare i log di sessione.</string>
|
||||
<string name="setup_offline">Modalità offline</string>
|
||||
<string name="setup_offline_auto">Modalità offline automatica</string>
|
||||
<string name="setup_sign_in_first">Accedi prima a Steam</string>
|
||||
<string name="setup_launcher">Launcher</string>
|
||||
<string name="setup_language">Lingua</string>
|
||||
|
||||
@@ -919,6 +919,7 @@
|
||||
<string name="setup_reset_settings_session_running">設定をリセットする前にセッションを停止してください。</string>
|
||||
<string name="setup_reset_settings_partial">設定はリセットされましたが、一部をリセットできませんでした。詳細はログを確認してください。</string>
|
||||
<string name="setup_offline">オフラインモード</string>
|
||||
<string name="setup_offline_auto">自動オフラインモード</string>
|
||||
<string name="setup_sign_in_first">先にSteamにログインしてください</string>
|
||||
<string name="setup_launcher">ランチャー</string>
|
||||
<string name="setup_language">言語</string>
|
||||
|
||||
@@ -919,6 +919,7 @@
|
||||
<string name="setup_reset_settings_session_running">설정을 초기화하기 전에 세션을 중지하세요.</string>
|
||||
<string name="setup_reset_settings_partial">설정이 초기화되었지만 일부는 초기화하지 못했습니다. 자세한 내용은 로그를 확인하세요.</string>
|
||||
<string name="setup_offline">오프라인 모드</string>
|
||||
<string name="setup_offline_auto">자동 오프라인 모드</string>
|
||||
<string name="setup_sign_in_first">먼저 Steam에 로그인하세요</string>
|
||||
<string name="setup_launcher">런처</string>
|
||||
<string name="setup_language">언어</string>
|
||||
|
||||
@@ -919,6 +919,7 @@
|
||||
<string name="setup_reset_settings_session_running">Hentikan sesi sebelum menetap semula tetapan.</string>
|
||||
<string name="setup_reset_settings_partial">Tetapan telah ditetap semula, tetapi bukan semuanya. Butirannya ada dalam log.</string>
|
||||
<string name="setup_offline">Mod luar talian</string>
|
||||
<string name="setup_offline_auto">Mod luar talian automatik</string>
|
||||
<string name="setup_sign_in_first">Log masuk ke Steam dahulu</string>
|
||||
<string name="setup_launcher">Pelancar</string>
|
||||
<string name="setup_language">Bahasa</string>
|
||||
|
||||
@@ -922,6 +922,7 @@
|
||||
<string name="setup_reset_settings_session_running">Stopp økten før du tilbakestiller innstillinger.</string>
|
||||
<string name="setup_reset_settings_partial">Innstillingene ble tilbakestilt, men ikke alle. Detaljene står i loggen.</string>
|
||||
<string name="setup_offline">Frakoblet modus</string>
|
||||
<string name="setup_offline_auto">Automatisk frakoblet modus</string>
|
||||
<string name="setup_sign_in_first">Logg inn på Steam først</string>
|
||||
<string name="setup_launcher">Launcher</string>
|
||||
<string name="setup_language">Språk</string>
|
||||
|
||||
@@ -922,6 +922,7 @@
|
||||
<string name="setup_reset_settings_session_running">Stop de sessie voordat je instellingen reset.</string>
|
||||
<string name="setup_reset_settings_partial">De instellingen zijn gereset, maar niet alles. De details staan in de logs.</string>
|
||||
<string name="setup_offline">Offlinemodus</string>
|
||||
<string name="setup_offline_auto">Automatische offlinemodus</string>
|
||||
<string name="setup_sign_in_first">Meld je eerst aan bij Steam</string>
|
||||
<string name="setup_launcher">Launcher</string>
|
||||
<string name="setup_language">Taal</string>
|
||||
|
||||
@@ -928,6 +928,7 @@
|
||||
<string name="setup_reset_settings_session_running">Zatrzymaj sesję, zanim zresetujesz ustawienia.</string>
|
||||
<string name="setup_reset_settings_partial">Ustawienia zostały zresetowane, ale nie wszystkie. Szczegóły są w logach.</string>
|
||||
<string name="setup_offline">Tryb offline</string>
|
||||
<string name="setup_offline_auto">Automatyczny tryb offline</string>
|
||||
<string name="setup_sign_in_first">Najpierw zaloguj się do Steam</string>
|
||||
<string name="setup_launcher">Aplikacja</string>
|
||||
<string name="setup_language">Język</string>
|
||||
|
||||
@@ -917,6 +917,7 @@
|
||||
<string name="setup_log_export_failed">Não foi possível guardar os registos de sessão.</string>
|
||||
<string name="setup_log_delete_failed">Não foi possível eliminar os registos de sessão.</string>
|
||||
<string name="setup_offline">Modo offline</string>
|
||||
<string name="setup_offline_auto">Modo offline automático</string>
|
||||
<string name="setup_sign_in_first">Inicie sessão no Steam primeiro</string>
|
||||
<string name="setup_launcher">Iniciador</string>
|
||||
<string name="setup_language">Idioma</string>
|
||||
|
||||
@@ -924,6 +924,7 @@
|
||||
<string name="setup_log_export_failed">Não foi possível salvar os registros de sessão.</string>
|
||||
<string name="setup_log_delete_failed">Não foi possível excluir os registros de sessão.</string>
|
||||
<string name="setup_offline">Modo offline</string>
|
||||
<string name="setup_offline_auto">Modo offline automático</string>
|
||||
<string name="setup_sign_in_first">Inicie sessão na Steam primeiro</string>
|
||||
<string name="setup_launcher">Inicializador</string>
|
||||
<string name="setup_language">Idioma</string>
|
||||
|
||||
@@ -925,6 +925,7 @@
|
||||
<string name="setup_reset_settings_session_running">Oprește sesiunea înainte de a reseta setările.</string>
|
||||
<string name="setup_reset_settings_partial">Setările au fost resetate, dar nu toate. Detaliile sunt în jurnale.</string>
|
||||
<string name="setup_offline">Mod offline</string>
|
||||
<string name="setup_offline_auto">Mod offline automat</string>
|
||||
<string name="setup_sign_in_first">Autentifică-te mai întâi în Steam</string>
|
||||
<string name="setup_launcher">Launcher</string>
|
||||
<string name="setup_language">Limbă</string>
|
||||
|
||||
@@ -928,6 +928,7 @@
|
||||
<string name="setup_reset_settings_session_running">Остановите сессию перед сбросом настроек.</string>
|
||||
<string name="setup_reset_settings_partial">Настройки сброшены, но некоторые части сбросить не удалось. Подробности в журналах.</string>
|
||||
<string name="setup_offline">Автономный режим</string>
|
||||
<string name="setup_offline_auto">Автоматический автономный режим</string>
|
||||
<string name="setup_sign_in_first">Сначала войдите в Steam</string>
|
||||
<string name="setup_launcher">Лаунчер</string>
|
||||
<string name="setup_language">Язык</string>
|
||||
|
||||
@@ -922,6 +922,7 @@
|
||||
<string name="setup_reset_settings_session_running">Stoppa sessionen innan du återställer inställningar.</string>
|
||||
<string name="setup_reset_settings_partial">Inställningarna återställdes, men inte alla. Detaljerna finns i loggen.</string>
|
||||
<string name="setup_offline">Offlineläge</string>
|
||||
<string name="setup_offline_auto">Automatiskt offlineläge</string>
|
||||
<string name="setup_sign_in_first">Logga in på Steam först</string>
|
||||
<string name="setup_launcher">Startprogram</string>
|
||||
<string name="setup_language">Språk</string>
|
||||
|
||||
@@ -919,6 +919,7 @@
|
||||
<string name="setup_reset_settings_session_running">หยุดเซสชันก่อนรีเซ็ตการตั้งค่า</string>
|
||||
<string name="setup_reset_settings_partial">รีเซ็ตการตั้งค่าแล้ว แต่ไม่ทั้งหมด รายละเอียดอยู่ในล็อก</string>
|
||||
<string name="setup_offline">โหมดออฟไลน์</string>
|
||||
<string name="setup_offline_auto">โหมดออฟไลน์อัตโนมัติ</string>
|
||||
<string name="setup_sign_in_first">ลงชื่อเข้าใช้ Steam ก่อน</string>
|
||||
<string name="setup_launcher">ตัวเปิดแอป</string>
|
||||
<string name="setup_language">ภาษา</string>
|
||||
|
||||
@@ -914,6 +914,7 @@
|
||||
<string name="setup_log_export_failed">Oturum günlükleri kaydedilemedi.</string>
|
||||
<string name="setup_log_delete_failed">Oturum günlükleri silinemedi.</string>
|
||||
<string name="setup_offline">Çevrimdışı mod</string>
|
||||
<string name="setup_offline_auto">Otomatik çevrimdışı mod</string>
|
||||
<string name="setup_sign_in_first">Önce Steam\'de oturum açın</string>
|
||||
<string name="setup_launcher">Başlatıcı</string>
|
||||
<string name="setup_language">Dil</string>
|
||||
|
||||
@@ -928,6 +928,7 @@
|
||||
<string name="setup_reset_settings_session_running">Зупиніть сеанс перед скиданням налаштувань.</string>
|
||||
<string name="setup_reset_settings_partial">Налаштування скинуто, але не всі. Подробиці в журналах.</string>
|
||||
<string name="setup_offline">Офлайн-режим</string>
|
||||
<string name="setup_offline_auto">Автоматичний офлайн-режим</string>
|
||||
<string name="setup_sign_in_first">Спершу увійдіть у Steam</string>
|
||||
<string name="setup_launcher">Лаунчер</string>
|
||||
<string name="setup_language">Мова</string>
|
||||
|
||||
@@ -919,6 +919,7 @@
|
||||
<string name="setup_reset_settings_session_running">Dừng phiên trước khi đặt lại thiết lập.</string>
|
||||
<string name="setup_reset_settings_partial">Đã đặt lại thiết lập, nhưng chưa phải tất cả. Chi tiết có trong log.</string>
|
||||
<string name="setup_offline">Chế độ ngoại tuyến</string>
|
||||
<string name="setup_offline_auto">Chế độ ngoại tuyến tự động</string>
|
||||
<string name="setup_sign_in_first">Đăng nhập Steam trước</string>
|
||||
<string name="setup_launcher">Launcher</string>
|
||||
<string name="setup_language">Ngôn ngữ</string>
|
||||
|
||||
@@ -919,6 +919,7 @@
|
||||
<string name="setup_reset_settings_session_running">请先停止会话再重置设置。</string>
|
||||
<string name="setup_reset_settings_partial">设置已重置,但部分内容未能重置。详情请查看日志。</string>
|
||||
<string name="setup_offline">离线模式</string>
|
||||
<string name="setup_offline_auto">自动离线模式</string>
|
||||
<string name="setup_sign_in_first">请先登录 Steam</string>
|
||||
<string name="setup_launcher">启动器</string>
|
||||
<string name="setup_language">语言</string>
|
||||
|
||||
@@ -918,6 +918,7 @@
|
||||
<string name="setup_reset_settings_session_running">請先停止會話再重設設定。</string>
|
||||
<string name="setup_reset_settings_partial">設定已重設,但部分項目未能重設。詳情請查看記錄。</string>
|
||||
<string name="setup_offline">離線模式</string>
|
||||
<string name="setup_offline_auto">自動離線模式</string>
|
||||
<string name="setup_sign_in_first">請先登入 Steam</string>
|
||||
<string name="setup_launcher">啟動器</string>
|
||||
<string name="setup_language">語言</string>
|
||||
|
||||
@@ -918,6 +918,7 @@
|
||||
<string name="setup_reset_settings_session_running">請先停止工作階段再重設設定。</string>
|
||||
<string name="setup_reset_settings_partial">設定已重設,但部分項目無法重設。詳細資訊請查看日誌。</string>
|
||||
<string name="setup_offline">離線模式</string>
|
||||
<string name="setup_offline_auto">自動離線模式</string>
|
||||
<string name="setup_sign_in_first">請先登入 Steam</string>
|
||||
<string name="setup_launcher">啟動器</string>
|
||||
<string name="setup_language">語言</string>
|
||||
|
||||
@@ -383,6 +383,7 @@
|
||||
<string name="mode_return_after_game">Return to DroidDeck after a game</string>
|
||||
<string name="mode_return_after_game_hint">When a game you started from DroidDeck or another launcher closes, Steam exits cleanly (cloud saves finish first) and you go back there. Off: stay in Steam.</string>
|
||||
<string name="mode_shader_precache">Shader pre-caching</string>
|
||||
<string name="mode_valve_proton_on_demand">Valve Proton only when needed</string>
|
||||
<string name="mode_shader_precache_hint">Steam downloads shaders prebuilt for your games and processes them in the background, so games stutter less. Off saves data, storage and battery; games build shaders as they play instead. The same setting as Steam’s Downloads > Shader Pre-Caching. Applies next session.</string>
|
||||
<string name="mode_steam_repair">Repair Steam client</string>
|
||||
<string name="mode_steam_repair_hint">Downloads the Steam client again the next time Steam starts. Use it if Steam stays on its loading screen. Games, sign-in and settings are kept.</string>
|
||||
@@ -672,7 +673,7 @@
|
||||
<string name="perf_fastpath_needs_seccomp">Needs proot\'s seccomp filter.</string>
|
||||
<string name="perf_fastpath_hint">Faster file lookups and less stutter. Turn off if a program can\'t find its files.</string>
|
||||
<string name="perf_cursor_composite">Draw the cursor inside gamescope</string>
|
||||
<string name="perf_cursor_composite_hint">Gamescope paints the pointer itself instead of handing it to Android. Turn on for a controller-driven cursor. Off is faster on a phone. Applies next session.</string>
|
||||
<string name="perf_cursor_composite_hint">Gamescope paints the pointer itself instead of handing it to Android. Applies next session.</string>
|
||||
<string name="perf_identity">Session identity</string>
|
||||
<string name="perf_hostname">Host name</string>
|
||||
<string name="perf_hostname_hint">The name Steam sees for this device. Blank restores %1$s.</string>
|
||||
@@ -1003,6 +1004,7 @@
|
||||
<string name="setup_reset_settings_session_running">Stop the session before resetting settings.</string>
|
||||
<string name="setup_reset_settings_partial">Settings were reset, but some parts could not be. The logs have the details.</string>
|
||||
<string name="setup_offline">Offline mode</string>
|
||||
<string name="setup_offline_auto">Auto offline mode</string>
|
||||
<string name="setup_sign_in_first">Sign in to Steam first</string>
|
||||
<string name="setup_launcher">Launcher</string>
|
||||
<string name="setup_language">Language</string>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.droiddeck.launcher
|
||||
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
|
||||
class SessionRelaunchTest {
|
||||
// recreate() keeps the window, and Compose content set on it afterwards never recomposes (#2668):
|
||||
// a session relaunched that way kept its loading screen up over a running desktop.
|
||||
@Test fun sessionAndLauncherActivitiesNeverRecreateThemselves() {
|
||||
listOf("SessionActivity.kt", "FrontEndActivity.kt").forEach { name ->
|
||||
val code = File("src/main/java/com/droiddeck/launcher/$name").readLines()
|
||||
.map { it.substringBefore("//") }
|
||||
val calls = code.withIndex().filter { (_, line) -> Regex("""\brecreate\(\)""").containsMatchIn(line) }
|
||||
assertTrue("$name calls recreate() at line(s) ${calls.map { it.index + 1 }}", calls.isEmpty())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,4 +137,30 @@ class AddedGamesStoreScanTest {
|
||||
val game = AddedGames.scan(app).single { it.folder.absolutePath == folder.absolutePath }
|
||||
assertEquals("/root/Games/Stores/GOG/Witcher Game", game.guestDir)
|
||||
}
|
||||
|
||||
@Test fun aStoreGameThatIsUpdatingIsNotListedThroughItsSavedExe() {
|
||||
val folder = install(Store.GOG, "upd", "Updating GOG", "Binaries/Game.exe", launcher = true)
|
||||
val own = File(folder, "Binaries/Game.exe")
|
||||
assertTrue(AddedGames.addExe(app, own) is AddedGames.AddResult.Existing)
|
||||
assertTrue(AddedGames.scan(app).any { it.folder.absolutePath == folder.absolutePath })
|
||||
StoreGameSidecar.read(folder)!!.copy(state = StoreGameSidecar.STATE_UPDATING).write(folder)
|
||||
assertTrue(AddedGames.scan(app).none { it.folder.absolutePath == folder.absolutePath })
|
||||
}
|
||||
|
||||
@Test fun reselectingTheMappedExeReplacesAnUnmappedAliasOfIt() {
|
||||
val folder = install(Store.EPIC, "alias", "Alias Epic", "Binaries/Game.exe", launcher = true)
|
||||
val own = File(folder, "Binaries/Game.exe")
|
||||
val alias = File(java.nio.file.Files.createTempDirectory("alias").toFile(), "bin")
|
||||
try {
|
||||
java.nio.file.Files.createSymbolicLink(alias.toPath(), File(folder, "Binaries").toPath())
|
||||
} catch (e: Exception) {
|
||||
org.junit.Assume.assumeNoException(e)
|
||||
}
|
||||
val aliased = File(alias, "Game.exe")
|
||||
assertNull(AddedGames.guestPath(app, aliased))
|
||||
SessionPrefs.setAddedGameExe(app, folder.path, aliased.path)
|
||||
assertTrue(AddedGames.addExe(app, own) is AddedGames.AddResult.Existing)
|
||||
assertEquals(own.path, SessionPrefs.addedGameExe(app, folder.path))
|
||||
assertEquals(own.path, AddedExes.list(app).single { it.folder == folder.path }.exe)
|
||||
}
|
||||
}
|
||||
@@ -32,4 +32,9 @@ class SocNamesTest {
|
||||
assertNull(SocNames.name("SM8975-PRO", ""))
|
||||
assertNull(SocNames.name("Qualcomm SM8975", ""))
|
||||
}
|
||||
@Test fun plainNameNeverGuessesFromThePlatform() {
|
||||
assertEquals("Snapdragon 8 Gen 2 (SM8550)", SocNames.plainName("SM8550", "QTI"))
|
||||
assertEquals("Moorechip CQ7790S", SocNames.plainName("CQ7790S", "Moorechip"))
|
||||
assertEquals("CQ7790S", SocNames.plainName("CQ7790S", ""))
|
||||
}
|
||||
}
|
||||
@@ -216,6 +216,41 @@ class BattleNetTest {
|
||||
assertNull(BattleNet.hostFolder(context, "G:\\etc\\passwd"))
|
||||
}
|
||||
|
||||
@Test fun aDriveAtTheAppDataFolderHoldingTheRuntimeListsTheGamesInside() {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val data = context.filesDir.parentFile!!
|
||||
val pfx = File(BattleNet.prefix(context), "pfx")
|
||||
val devices = File(pfx, "dosdevices").apply { mkdirs() }
|
||||
java.nio.file.Files.createSymbolicLink(File(devices, "d:").toPath(), data.absoluteFile.toPath())
|
||||
java.nio.file.Files.createSymbolicLink(File(devices, "e:").toPath(), java.nio.file.Paths.get("/root/Games/Card"))
|
||||
val wow = File(root, "root/Games/Stores/Battle.net/World of Warcraft").apply { mkdirs() }
|
||||
File(wow, "_forever_").mkdirs()
|
||||
val drive = "D:/" + data.absoluteFile.toPath().relativize(wow.absoluteFile.toPath()).joinToString("/")
|
||||
File(pfx, "drive_c/ProgramData/Battle.net/Agent").mkdirs()
|
||||
File(pfx, "drive_c/ProgramData/Battle.net/Agent/product.db").writeBytes(message(
|
||||
field(1, message(field(1, "wowf"), field(2, "wowf"), field(3, message(field(1, drive))))),
|
||||
))
|
||||
assertEquals(wow, BattleNet.hostFolder(context, drive))
|
||||
assertEquals(wow, BattleNet.games(context).single().folder)
|
||||
assertEquals(File(root, "root/Games/Card/Battle.net/X"), BattleNet.hostFolder(context, "E:\\Battle.net\\X"))
|
||||
assertNull(BattleNet.hostFolder(context, "D:\\..\\etc"))
|
||||
}
|
||||
|
||||
@Test fun aDriveAtAnAliasOfTheAppDataFolderListsTheGameUnderTheRuntimePath() {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val data = context.filesDir.parentFile!!
|
||||
val alias = File(data.parentFile, "alias-" + data.name)
|
||||
java.nio.file.Files.createSymbolicLink(alias.toPath(), data.absoluteFile.toPath())
|
||||
try {
|
||||
val devices = File(BattleNet.prefix(context), "pfx/dosdevices").apply { mkdirs() }
|
||||
java.nio.file.Files.createSymbolicLink(File(devices, "d:").toPath(), alias.absoluteFile.toPath())
|
||||
val game = File(root, "root/Games/Stores/Battle.net/StarCraft").apply { mkdirs() }
|
||||
val drive = "D:\\" + data.absoluteFile.toPath().relativize(game.absoluteFile.toPath()).joinToString("\\")
|
||||
assertEquals(game.path, BattleNet.hostFolder(context, drive)?.path)
|
||||
} finally {
|
||||
java.nio.file.Files.delete(alias.toPath())
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun wowForeverIsListedBesideRetailInTheSharedWorldOfWarcraftFolder() {
|
||||
val pfx = File(BattleNet.prefix(context), "pfx").apply { mkdirs() }
|
||||
@@ -274,6 +309,21 @@ class BattleNetTest {
|
||||
assertEquals(mapOf("WoWF" to root), BattleNet.ownFolders(mapOf("WoWF" to (forever to root)), mapOf("WoWF" to "/elsewhere")))
|
||||
}
|
||||
|
||||
@Test fun aFolderSavedThroughAnAliasOfTheAppDataFolderIsKept() {
|
||||
val data = context.filesDir.parentFile!!
|
||||
val root = File(context.filesDir, "World of Warcraft").apply { mkdirs() }
|
||||
val foreverDir = File(root, "_forever_").apply { mkdirs() }
|
||||
val forever = BattleNet.title("wow_forever")!!
|
||||
val alias = File(data.parentFile, "alias-" + data.name)
|
||||
java.nio.file.Files.createSymbolicLink(alias.toPath(), data.absoluteFile.toPath())
|
||||
try {
|
||||
val saved = File(alias, data.absoluteFile.toPath().relativize(foreverDir.absoluteFile.toPath()).toString()).path
|
||||
assertEquals(mapOf("WoWF" to foreverDir), BattleNet.ownFolders(mapOf("WoWF" to (forever to root)), mapOf("WoWF" to saved)))
|
||||
} finally {
|
||||
java.nio.file.Files.delete(alias.toPath())
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun theListedFolderIsRememberedAcrossScans() {
|
||||
val pfx = File(BattleNet.prefix(context), "pfx").apply { mkdirs() }
|
||||
val wow = File(pfx, "drive_c/Program Files (x86)/World of Warcraft").apply { mkdirs() }
|
||||
|
||||
@@ -61,9 +61,11 @@ class BwrapSpawnerTest {
|
||||
"DDNATV_ROOT" to rootfs, "DDNATV_BINDS" to "/dev:/dev", "HOME" to "/root",
|
||||
"SPA_PLUGIN_DIR" to "/usr/local/lib/droiddeck-pipewire/lib/spa-0.2",
|
||||
"LD_PRELOAD" to "/run/droiddeck-preload/libddsession.so:$rootfs/usr/local/lib/libddsession.so:$rootfs/usr/lib/libddnatv-hook.so",
|
||||
"DROIDDECK_FDS" to "droiddeck-fds-1",
|
||||
)
|
||||
BwrapSpawner.withoutRootfsSettings(env, rootfs)
|
||||
assertEquals(mapOf("HOME" to "/root", "LD_PRELOAD" to "/run/droiddeck-preload/libddsession.so"), env)
|
||||
assertEquals(mapOf("HOME" to "/root", "LD_PRELOAD" to "/run/droiddeck-preload/libddsession.so",
|
||||
"DROIDDECK_FDS" to "droiddeck-fds-1"), env)
|
||||
val onlySession = mutableMapOf("LD_PRELOAD" to "$rootfs/usr/lib/libddnatv-hook.so")
|
||||
BwrapSpawner.withoutRootfsSettings(onlySession, rootfs)
|
||||
assertTrue(onlySession.isEmpty())
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import android.content.Context
|
||||
import android.net.ConnectivityManager
|
||||
import android.net.NetworkCapabilities
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.Shadows.shadowOf
|
||||
import org.robolectric.annotation.Config
|
||||
import org.robolectric.shadows.ShadowNetworkCapabilities
|
||||
import java.io.File
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [33])
|
||||
class OfflineModeTest {
|
||||
private val context: Context = RuntimeEnvironment.getApplication()
|
||||
private val root get() = LinuxRuntime.rootDir(context)
|
||||
private val vdf get() = File(root, "root/.local/share/Steam/config/loginusers.vdf")
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
context.getSharedPreferences("session", Context.MODE_PRIVATE).edit().clear().commit()
|
||||
vdf.parentFile!!.mkdirs()
|
||||
writeSteam("0")
|
||||
network(online = true)
|
||||
}
|
||||
|
||||
private fun writeSteam(wants: String) {
|
||||
vdf.writeText(
|
||||
"\"users\"\n{\n\t\"7656\"\n\t{\n\t\t\"AccountName\"\t\t\"player\"\n" +
|
||||
"\t\t\"RememberPassword\"\t\t\"1\"\n\t\t\"WantsOfflineMode\"\t\t\"$wants\"\n" +
|
||||
"\t\t\"SkipOfflineModeWarning\"\t\t\"$wants\"\n\t}\n}\n"
|
||||
)
|
||||
}
|
||||
|
||||
private fun steamWants(): String =
|
||||
Regex(""""WantsOfflineMode"\s*"([01])"""").find(vdf.readText())!!.groupValues[1]
|
||||
|
||||
private fun network(online: Boolean) {
|
||||
val cm = context.getSystemService(ConnectivityManager::class.java)
|
||||
val caps = ShadowNetworkCapabilities.newInstance()
|
||||
shadowOf(caps).addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
|
||||
if (online) {
|
||||
shadowOf(caps).addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
|
||||
shadowOf(caps).addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED)
|
||||
}
|
||||
shadowOf(cm).setNetworkCapabilities(cm.activeNetwork, caps)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun offlineWhenChosenOrWithoutInternet() {
|
||||
assertFalse(OfflineMode.offline(manual = false, online = true))
|
||||
assertTrue(OfflineMode.offline(manual = false, online = false))
|
||||
assertTrue(OfflineMode.offline(manual = true, online = true))
|
||||
assertTrue(OfflineMode.offline(manual = true, online = false))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun steamsOwnChoiceWinsOverTheSavedSetting() {
|
||||
assertTrue(OfflineMode.manual(steamWants = true, automatic = false, saved = false))
|
||||
assertFalse(OfflineMode.manual(steamWants = false, automatic = false, saved = true))
|
||||
assertFalse(OfflineMode.manual(steamWants = true, automatic = true, saved = false))
|
||||
assertTrue(OfflineMode.manual(steamWants = null, automatic = false, saved = true))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun startsOfflineWithoutInternetAndOnlineOnceItReturns() {
|
||||
network(online = false)
|
||||
assertTrue(OfflineMode.apply(context, root))
|
||||
assertEquals("1", steamWants())
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
|
||||
network(online = true)
|
||||
assertFalse(OfflineMode.apply(context, root))
|
||||
assertEquals("0", steamWants())
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun manualOfflineStaysOnWithInternet() {
|
||||
OfflineMode.setEnabled(context, true)
|
||||
assertEquals("1", steamWants())
|
||||
assertTrue(OfflineMode.apply(context, root))
|
||||
assertEquals("1", steamWants())
|
||||
assertTrue(OfflineMode.enabled(context))
|
||||
|
||||
OfflineMode.setEnabled(context, false)
|
||||
assertEquals("0", steamWants())
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun goingOfflineInsideSteamShowsInDroidDeckAndIsKept() {
|
||||
writeSteam("1")
|
||||
assertTrue(OfflineMode.enabled(context))
|
||||
assertTrue(OfflineMode.apply(context, root))
|
||||
assertEquals("1", steamWants())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun goingOnlineInsideSteamAfterAnAutomaticOfflineStartIsKept() {
|
||||
network(online = false)
|
||||
OfflineMode.apply(context, root)
|
||||
writeSteam("0")
|
||||
network(online = true)
|
||||
assertFalse(OfflineMode.apply(context, root))
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
assertEquals("0", steamWants())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun turningTheToggleOffWithoutInternetStillStartsOfflineButNotAsAChoice() {
|
||||
OfflineMode.setEnabled(context, true)
|
||||
network(online = false)
|
||||
OfflineMode.setEnabled(context, false)
|
||||
assertEquals("1", steamWants())
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
network(online = true)
|
||||
assertFalse(OfflineMode.apply(context, root))
|
||||
assertEquals("0", steamWants())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun steamGoingOfflineAfterANetworkDropIsNotTakenAsAChoice() {
|
||||
assertFalse(OfflineMode.apply(context, root))
|
||||
network(online = false)
|
||||
OfflineMode.follow(context)
|
||||
writeSteam("1")
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
network(online = true)
|
||||
OfflineMode.follow(context)
|
||||
writeSteam("0")
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
assertFalse(OfflineMode.apply(context, root))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun autoGoesOnlineWhenTheNetworkReturnsEvenAfterChoosingOfflineInSteam() {
|
||||
writeSteam("1")
|
||||
assertTrue(OfflineMode.enabled(context))
|
||||
network(online = false)
|
||||
OfflineMode.follow(context)
|
||||
assertEquals("1", steamWants())
|
||||
network(online = true)
|
||||
OfflineMode.follow(context)
|
||||
assertEquals("0", steamWants())
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun anAutomaticOfflineStaysAutomaticWhenSteamCannotBeReachedOnReturn() {
|
||||
network(online = false)
|
||||
assertTrue(OfflineMode.apply(context, root))
|
||||
network(online = true)
|
||||
assertEquals(null, OfflineMode.follow(context))
|
||||
writeSteam("1")
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
assertFalse(OfflineMode.apply(context, root))
|
||||
assertEquals("0", steamWants())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aManualChoiceMadeAfterAFailedReturnIsNotMarkedAutomatic() {
|
||||
network(online = false)
|
||||
assertTrue(OfflineMode.apply(context, root))
|
||||
network(online = true)
|
||||
OfflineMode.setAuto(context, false)
|
||||
OfflineMode.setEnabled(context, true)
|
||||
OfflineMode.restoreNetworkOffline(context)
|
||||
assertTrue(OfflineMode.enabled(context))
|
||||
assertTrue(OfflineMode.apply(context, root))
|
||||
assertEquals("1", steamWants())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun autoIsOnByDefaultAndManualModeIgnoresTheNetwork() {
|
||||
assertTrue(OfflineMode.auto(context))
|
||||
OfflineMode.setAuto(context, false)
|
||||
assertFalse(OfflineMode.auto(context))
|
||||
network(online = false)
|
||||
assertFalse(OfflineMode.apply(context, root))
|
||||
assertFalse(OfflineMode.active(context))
|
||||
assertEquals(false, OfflineMode.follow(context))
|
||||
assertEquals("0", steamWants())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun chosenOfflineInManualModeSurvivesANetworkDropAndReturn() {
|
||||
OfflineMode.setAuto(context, false)
|
||||
OfflineMode.setEnabled(context, true)
|
||||
network(online = false)
|
||||
OfflineMode.follow(context)
|
||||
network(online = true)
|
||||
OfflineMode.follow(context)
|
||||
assertTrue(OfflineMode.enabled(context))
|
||||
assertTrue(OfflineMode.apply(context, root))
|
||||
assertEquals("1", steamWants())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun turningAutoOffKeepsTheCurrentStateAsTheChoice() {
|
||||
network(online = false)
|
||||
assertTrue(OfflineMode.apply(context, root))
|
||||
OfflineMode.setAuto(context, false)
|
||||
assertTrue(OfflineMode.enabled(context))
|
||||
network(online = true)
|
||||
assertTrue(OfflineMode.apply(context, root))
|
||||
assertEquals("1", steamWants())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun turningAutoOffRightAfterTheNetworkReturnsKeepsSteamOffline() {
|
||||
network(online = false)
|
||||
assertTrue(OfflineMode.apply(context, root))
|
||||
network(online = true)
|
||||
OfflineMode.setAuto(context, false)
|
||||
assertTrue(OfflineMode.enabled(context))
|
||||
assertEquals("1", steamWants())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun turningAutoOffWhileOnlineStaysOnline() {
|
||||
OfflineMode.setAuto(context, false)
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
assertEquals("0", steamWants())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun turningAutoOnFollowsTheNetworkAgain() {
|
||||
OfflineMode.setAuto(context, false)
|
||||
OfflineMode.setEnabled(context, true)
|
||||
OfflineMode.setAuto(context, true)
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
assertEquals("0", steamWants())
|
||||
network(online = false)
|
||||
assertTrue(OfflineMode.apply(context, root))
|
||||
assertFalse(OfflineMode.enabled(context))
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,21 @@ class NavTabsTest {
|
||||
assertTrue(NavTabs.isDefault())
|
||||
}
|
||||
|
||||
@Test fun appsFollowsTheHomeAppOnEachChangeAndOtherwiseKeepsTheUsersChoice() {
|
||||
NavTabs.syncHomeApps(ctx, false)
|
||||
assertEquals(TabPlace.HIDDEN, NavTabs.place(state(), "android-apps"))
|
||||
NavTabs.syncHomeApps(ctx, true)
|
||||
assertEquals(TabPlace.BAR, NavTabs.place(state(), "android-apps"))
|
||||
NavTabs.setHidden(ctx, "android-apps", true)
|
||||
NavTabs.syncHomeApps(ctx, true)
|
||||
assertEquals(TabPlace.HIDDEN, NavTabs.place(state(), "android-apps"))
|
||||
NavTabs.syncHomeApps(ctx, false)
|
||||
NavTabs.syncHomeApps(ctx, true)
|
||||
assertEquals(TabPlace.BAR, NavTabs.place(state(), "android-apps"))
|
||||
NavTabs.syncHomeApps(ctx, false)
|
||||
assertEquals(TabPlace.HIDDEN, NavTabs.place(state(), "android-apps"))
|
||||
}
|
||||
|
||||
@Test fun showingMusicOnceKeepsItShownAfterReload() {
|
||||
place("soundtracks", TabPlace.BAR)
|
||||
NavTabs.load(ctx)
|
||||
@@ -219,12 +234,12 @@ class NavTabsTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
val last = navigationKeys(state()).last { it != NavTabs.MORE }
|
||||
val last = NavTabs.listed(state()).last { it !in NavTabs.shelved }
|
||||
compose.onNodeWithTag("tab-row-$last").requestFocus()
|
||||
compose.onNodeWithTag("tab-row-$last").performKeyPress(pad(android.view.KeyEvent.KEYCODE_BUTTON_Y))
|
||||
compose.onNodeWithTag("tab-row-$last").performKeyPress(pad(android.view.KeyEvent.KEYCODE_DPAD_DOWN))
|
||||
compose.onNodeWithTag("tab-row-$last").performKeyPress(pad(android.view.KeyEvent.KEYCODE_BUTTON_Y))
|
||||
compose.runOnIdle { assertEquals(last, NavTabs.more(state()).first()) }
|
||||
compose.runOnIdle { assertTrue(last in NavTabs.shelved) }
|
||||
compose.onNodeWithTag("tab-shown-desktop").performClick()
|
||||
compose.runOnIdle { assertFalse("desktop" in navigationKeys(state())) }
|
||||
compose.onNodeWithTag("tab-shown-setup").performClick()
|
||||
|
||||
|
After Width: | Height: | Size: 4.1 MiB |
|
Before Width: | Height: | Size: 9.0 MiB |
@@ -0,0 +1,239 @@
|
||||
# DroidDeck 0.7.11
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/Droid-Deck/DroidDeck/releases/download/0.7.11/DroidDeck-0.7.11.apk"><img src="https://img.shields.io/badge/Download-DroidDeck%200.7.11%20APK-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Download DroidDeck 0.7.11"></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>
|
||||
|
||||
|
||||
**DroidDeck is 100% open source. No ads. No subscriptions. No telemetry. No proprietary components. No source withheld.**
|
||||
|
||||
Since 0.7.1: **42 contributors** | **467 pull requests** | **111 of them from 39 outside contributors**. We are so grateful for you all!
|
||||
|
||||
0.7.11 is the convenience store release. **EA, Ubisoft Connect and Rockstar Games** join the Stores tab, with no launchers to install and cloud saves for EA and Ubisoft. Steam, games, the desktop and the Terminal now **run directly on Android with no proot**, which cuts CPU overhead and gives much better 1% lows. **Zero-copy presentation** sends frames straight to the display and brings real HDR. Games on a memory card start about 4X faster. Around those sit a rebuilt Library, a tab bar you can rearrange, Settings with search, a smoother first run, and many smaller conveniences. The details are below.
|
||||
|
||||
### Features
|
||||
|
||||
- **A new foundation.** 0.7.11 reworks the stack that runs your games, from how Linux runs on Android to how frames reach the screen:
|
||||
- **No proot by default.** Steam, Proton games, the desktop and the Terminal run directly on Android, with lower CPU overhead and much better 1% lows. (@xXJSONDeruloXx, @maxjivi05, @K11MCH1, [#2300](https://github.com/Droid-Deck/DroidDeck/pull/2300), [#2522](https://github.com/Droid-Deck/DroidDeck/pull/2522), [#2560](https://github.com/Droid-Deck/DroidDeck/pull/2560), [#3041](https://github.com/Droid-Deck/DroidDeck/pull/3041))
|
||||
- **Zero-copy presentation** With DD-Turnip v0.9.0 or newer, frames reach the display without an extra copy: improving frametimes, frame pacing, and drastically reducing cases of dropped frames. (@maxjivi05, [#2905](https://github.com/Droid-Deck/DroidDeck/pull/2905))
|
||||
- **DroidDeck-Bionic**, a new test build that runs the game itself on Android’s own libc, with lower memory use, better compatibility and, in some games, better performance. (@The412Banner, [#3037](https://github.com/Droid-Deck/DroidDeck/pull/3037))
|
||||
|
||||
<p align="center"><img src="media/0.7.11/new-foundation.png" width="85%" alt="Four charts. Native execution without proot: process launches 4.2 times faster, tar 3.6, recursive listing 2.6, find 2.4, Python stat walk 1.4 and a CPU-only hash 1.1, with Steam starting in 8.7 s instead of 11 to 14 s on a Retroid Pocket Duo. SD card game starts: cold session start plus launch for eight games fell from 37, 122, 19, 65, 177, 192, 50 and 174 seconds on 0.7.1 to 35, 19, 18, 34, 26, 23, 26 and 24 seconds on 0.7.11, an average of 104 s down to 26 s. Zero-copy presentation: compositor work per frame down from 8.25, 3.3 and 4 ms to 1.25, 0.18 and 0.22 ms on three handhelds, and missed refreshes from 229 to 3 in 60 s on one. DroidDeck-Bionic: D3D8 up 50.3%, OpenGL up 17.5%, D3D7 up 10.4%, Vulkan up 3.3%, D3D11 down 1.3%, D3D10 down 1.4%, D3D9 down 3.5% and D3D12 down 7.5%, with about 400 MB less RAM"></p>
|
||||
|
||||
- Added **EA, Ubisoft Connect and Rockstar Games** stores: sign in, browse, download and launch without their launchers. EA and Ubisoft get cloud saves. (@xXJSONDeruloXx, @K11MCH1, @maxjivi05, [#2259](https://github.com/Droid-Deck/DroidDeck/pull/2259), [#2527](https://github.com/Droid-Deck/DroidDeck/pull/2527), [#2521](https://github.com/Droid-Deck/DroidDeck/pull/2521), [#2438](https://github.com/Droid-Deck/DroidDeck/pull/2438), [#2440](https://github.com/Droid-Deck/DroidDeck/pull/2440), [#2486](https://github.com/Droid-Deck/DroidDeck/pull/2486), [#2322](https://github.com/Droid-Deck/DroidDeck/pull/2322), [#2436](https://github.com/Droid-Deck/DroidDeck/pull/2436), [#2450](https://github.com/Droid-Deck/DroidDeck/pull/2450), [#2460](https://github.com/Droid-Deck/DroidDeck/pull/2460), [#2865](https://github.com/Droid-Deck/DroidDeck/pull/2865), [#2824](https://github.com/Droid-Deck/DroidDeck/pull/2824), [#2537](https://github.com/Droid-Deck/DroidDeck/pull/2537), [#2547](https://github.com/Droid-Deck/DroidDeck/pull/2547), [#2590](https://github.com/Droid-Deck/DroidDeck/pull/2590))
|
||||
|
||||
<p align="center"><img src="media/0.7.11/new-stores.gif" width="60%" alt="Touching through the Library’s store chips from left to right: Rockstar with GTA III, San Andreas and Vice City, EA with Battlefield, Dead Space, GRID Legends, Mass Effect, Need for Speed Heat and skate., then Ubisoft with five Assassin’s Creed titles, Immortals Fenyx Rising and Splinter Cell"></p>
|
||||
|
||||
- Added **black frame insertion** for screens of 100 Hz and up: the game runs at half the refresh rate, for example 60 fps on 120 Hz. (@xXJSONDeruloXx, [#2653](https://github.com/Droid-Deck/DroidDeck/pull/2653))
|
||||
|
||||
- **Controller-specific on-screen controls**: kits for the Steam Deck, Steam Controller, Xbox 360, DualShock 4 and DualSense, restyled after the real pads. The editor restores deleted controls, moves and resizes the D-pad as one control and allows sizes above 100%. Layouts keep separate portrait and landscape edits, and the floating overlays get switches for rear buttons and trackpads. (@xXJSONDeruloXx, @maxjivi05, [#2966](https://github.com/Droid-Deck/DroidDeck/pull/2966), [#2988](https://github.com/Droid-Deck/DroidDeck/pull/2988), [#2996](https://github.com/Droid-Deck/DroidDeck/pull/2996), [#3013](https://github.com/Droid-Deck/DroidDeck/pull/3013), [#3019](https://github.com/Droid-Deck/DroidDeck/pull/3019))
|
||||
|
||||
<p align="center"><img src="media/0.7.11/controller-kits.png" width="60%" alt="The portrait on-screen controls for four of the kits: Steam, Xbox 360, DualShock 4 and DualSense, each with its shoulder buttons, D-pad, face buttons, sticks and a bottom row of menu buttons"></p>
|
||||
|
||||
<p align="center"><img src="media/0.7.11/steam-deck-buttons.jpg" width="50%" alt="Steam’s game mode with the restyled Steam Deck on-screen controls: shoulder buttons, a D-pad, A B X Y, rear buttons, trackpads, sticks and the Steam, keyboard and menu buttons along the bottom"></p>
|
||||
|
||||
- Added a **CurseForge source** to the addon browser. DroidDeck installs the CurseForge app, updates addons per game and no longer reads whole files to list them. (@maxjivi05, [#3028](https://github.com/Droid-Deck/DroidDeck/pull/3028), [#2986](https://github.com/Droid-Deck/DroidDeck/pull/2986), [#3042](https://github.com/Droid-Deck/DroidDeck/pull/3042), [#3056](https://github.com/Droid-Deck/DroidDeck/pull/3056), [#3057](https://github.com/Droid-Deck/DroidDeck/pull/3057), [#3060](https://github.com/Droid-Deck/DroidDeck/pull/3060), [#3081](https://github.com/Droid-Deck/DroidDeck/pull/3081))
|
||||
|
||||
<p align="center"><img src="media/0.7.11/curseforge-addons.jpg" width="50%" alt="The addon browser on the CurseForge source, sorted by Popular: Questie, Auctionator, Details! Damage Meter, DBM and others, each with an Install button"></p>
|
||||
|
||||
- The **file manager has a plain text editor**, and the **Updates icon shows the build you’re on**: stable, Preview, a test build or a local build. (@Dantalian-dev, @xXJSONDeruloXx, [#2980](https://github.com/Droid-Deck/DroidDeck/pull/2980), [#3064](https://github.com/Droid-Deck/DroidDeck/pull/3064))
|
||||
|
||||
- **Frontends can launch any DroidDeck game** with Steam IDs, `steam://` and `droiddeck://` links, Daijisho templates, `.url` shortcuts, store game files or `.exe` paths, and store games export as `.epic`, `.gog`, `.xbox` and similar files. (@xXJSONDeruloXx, [#2872](https://github.com/Droid-Deck/DroidDeck/pull/2872))
|
||||
|
||||
- The **Storage manager names every prefix and store game** and can select and remove them, instead of one large “Kept” total, and launcher prefixes and Linux system caches can be removed too. (@xXJSONDeruloXx, [#2565](https://github.com/Droid-Deck/DroidDeck/pull/2565), [#2867](https://github.com/Droid-Deck/DroidDeck/pull/2867))
|
||||
|
||||
- The **Updates tab lists every kept Preview build**, so you can go back to an earlier one, links each build to its pull request and commit, and flags stale test builds. (@xXJSONDeruloXx, [#2624](https://github.com/Droid-Deck/DroidDeck/pull/2624))
|
||||
|
||||
- Components > Proton lists **DroidDeck-Proton prerelease builds under Experimental**, each with Install now, and removes them once they become a stable release. **Install from file** takes zip, 7z and tar archives, for everyone. (@maxjivi05, @FryMcNugget, [#2831](https://github.com/Droid-Deck/DroidDeck/pull/2831), [#2864](https://github.com/Droid-Deck/DroidDeck/pull/2864), [#2889](https://github.com/Droid-Deck/DroidDeck/pull/2889))
|
||||
|
||||
<p align="center"><img src="media/0.7.11/proton-experimental.jpg" width="50%" alt="Components page with DroidDeck-Proton 11-12.8 selected and an Experimental builds section offering a DroidDeck-Bionic 12.8 r34 test build with Install now and an Install from file button"></p>
|
||||
|
||||
- **Steam picks up game folders found in an added library** without pressing Install on each game, and a Games folder that is not a Steam library yet is offered as one. (@maxjivi05, @xXJSONDeruloXx, [#2317](https://github.com/Droid-Deck/DroidDeck/pull/2317), [#2432](https://github.com/Droid-Deck/DroidDeck/pull/2432))
|
||||
|
||||
- Added **per-game frame generation and screen effects**: pick DD-FG 2x, 3x, 4x, Lossless Scaling or none for each game, from the Library or the in-game menu, with a default for the rest. Upscaling and sharpening stay at full screen size with frame generation on. (@EnzoDLofi, @xXJSONDeruloXx, [#2473](https://github.com/Droid-Deck/DroidDeck/pull/2473), [#2472](https://github.com/Droid-Deck/DroidDeck/pull/2472), [#2728](https://github.com/Droid-Deck/DroidDeck/pull/2728))
|
||||
|
||||
- Added **integer scaling** for pixel art and 2D games, and **SMAA** anti-aliasing. Nearest is the new default filter; a filter you already picked stays. (@EnzoDLofi, [#2620](https://github.com/Droid-Deck/DroidDeck/pull/2620), [#2690](https://github.com/Droid-Deck/DroidDeck/pull/2690), [#2708](https://github.com/Droid-Deck/DroidDeck/pull/2708), [#2760](https://github.com/Droid-Deck/DroidDeck/pull/2760))
|
||||
|
||||
- A **pen works as a mouse**: hover moves the pointer, the tip clicks and the side button right-clicks. (@alien2003, [#2625](https://github.com/Droid-Deck/DroidDeck/pull/2625))
|
||||
|
||||
- Added **head tracking for XREAL One, One Pro, One Pro+ and Aura** glasses, with One Pro+ tracking corrected. (@mhaye20, @informalTechCode, [#2532](https://github.com/Droid-Deck/DroidDeck/pull/2532), [#2680](https://github.com/Droid-Deck/DroidDeck/pull/2680))
|
||||
|
||||
- DroidDeck’s **virtual pads reach programs outside Steam**, such as Firefox, Chromium and SDL games. (@kingokksa, [#1593](https://github.com/Droid-Deck/DroidDeck/pull/1593))
|
||||
|
||||
- Added **On-Device Lab builds** for contributors: build and run your own DroidDeck build on the device from the **Dev Harness** tab, which stays hidden until you show it in Edit tabs. (@xXJSONDeruloXx, @KeegantheVeganat0r, @SlicelessBread, @FryMcNugget, [#2375](https://github.com/Droid-Deck/DroidDeck/pull/2375), [#2494](https://github.com/Droid-Deck/DroidDeck/pull/2494), [#2512](https://github.com/Droid-Deck/DroidDeck/pull/2512), [#2667](https://github.com/Droid-Deck/DroidDeck/pull/2667), [#2550](https://github.com/Droid-Deck/DroidDeck/pull/2550), [#2744](https://github.com/Droid-Deck/DroidDeck/pull/2744), [#2862](https://github.com/Droid-Deck/DroidDeck/pull/2862))
|
||||
|
||||
- **Also new:** a **Game resolution** choice for games started without Steam; **per-game Steam Input** choices: Steam’s default, on or off; **Steam Remote Play** with the controller set to Steam Deck or Steam Controller mode and with touch controls; rounded ends on the game page’s **LB and RB keys**; **icon packs**, per-app icons and an Appearance panel on the Apps page; a **Home button** choice, **three presses of Back to exit the launcher** and an optional **Hide launcher from Recents while idle**; **Shuffle** and **Skip boot movie** switches; the game can move to a **clip-on second screen** that reports as an external display; **Quest headsets** get steps for turning off the child-process limit with SideQuest; a **Clear** key in the bottom-screen terminal, which keeps its shell when another app covers that screen; Steam’s first-run defaults show the **battery percentage**, download rates in bytes and the library sorted by recent (@xXJSONDeruloXx, @vinegh4, @2-Shar, @measlesbagel, @DeathKhan, @kingokksa, @maxjivi05, [#2520](https://github.com/Droid-Deck/DroidDeck/pull/2520), [#2407](https://github.com/Droid-Deck/DroidDeck/pull/2407), [#2033](https://github.com/Droid-Deck/DroidDeck/pull/2033), [#2856](https://github.com/Droid-Deck/DroidDeck/pull/2856), [#2207](https://github.com/Droid-Deck/DroidDeck/pull/2207), [#2493](https://github.com/Droid-Deck/DroidDeck/pull/2493), [#1599](https://github.com/Droid-Deck/DroidDeck/pull/1599), [#2579](https://github.com/Droid-Deck/DroidDeck/pull/2579), [#2462](https://github.com/Droid-Deck/DroidDeck/pull/2462), [#2577](https://github.com/Droid-Deck/DroidDeck/pull/2577), [#2350](https://github.com/Droid-Deck/DroidDeck/pull/2350), [#2306](https://github.com/Droid-Deck/DroidDeck/pull/2306), [#2368](https://github.com/Droid-Deck/DroidDeck/pull/2368), [#2366](https://github.com/Droid-Deck/DroidDeck/pull/2366), [#2599](https://github.com/Droid-Deck/DroidDeck/pull/2599))
|
||||
|
||||
### Design and organization
|
||||
|
||||
DroidDeck is easier to find your way around: tabs you arrange yourself, a Library that puts installed games first, and one home for every setting.
|
||||
|
||||
- **One editor to show, hide and reorder** the launcher tabs, the Library’s stores and the in-game menu pages. **Edit tabs** reorders with drag handles and shelves tabs under **More** or hides them, **Manage stores** does the same for store chips, Favorites and Hidden, and the in-game menu gets **Arrange pages** and its own **More** tab. On a controller, grab a row with Y and move it with the D-pad. The in-game menu can also be **resized**, and the width is kept. (@xXJSONDeruloXx, @FX192, [#2569](https://github.com/Droid-Deck/DroidDeck/pull/2569), [#2627](https://github.com/Droid-Deck/DroidDeck/pull/2627), [#2791](https://github.com/Droid-Deck/DroidDeck/pull/2791), [#2798](https://github.com/Droid-Deck/DroidDeck/pull/2798), [#2809](https://github.com/Droid-Deck/DroidDeck/pull/2809), [#2811](https://github.com/Droid-Deck/DroidDeck/pull/2811), [#2812](https://github.com/Droid-Deck/DroidDeck/pull/2812), [#2558](https://github.com/Droid-Deck/DroidDeck/pull/2558), [#2894](https://github.com/Droid-Deck/DroidDeck/pull/2894), [#2897](https://github.com/Droid-Deck/DroidDeck/pull/2897), [#2920](https://github.com/Droid-Deck/DroidDeck/pull/2920), [#2989](https://github.com/Droid-Deck/DroidDeck/pull/2989), [#3084](https://github.com/Droid-Deck/DroidDeck/pull/3084), [#3080](https://github.com/Droid-Deck/DroidDeck/pull/3080))
|
||||
|
||||
<p align="center"><img src="media/0.7.11/edit-tabs.jpg" width="19%" alt="The launcher’s Edit tabs sheet in portrait, with a drag handle and a switch for Steam, Desktop, Library, Downloads, Settings, Updates and Stores, then a More divider above Boot movies, Decky, Apps and Syncthing"> <img src="media/0.7.11/manage-stores.jpg" width="38%" alt="The Library’s Manage stores sheet with a drag handle and a switch for Favorites, Battle.net, Xbox, Rockstar Games, EA, Ubisoft Connect and itch.io, with a Grab Y hint on the Xbox row being moved"> <img src="media/0.7.11/session-menu-arrange.jpg" width="38%" alt="The widened in-game menu showing Arrange pages with Performance HUD, Effects, Games and Session above a More divider and VR below it"></p>
|
||||
|
||||
- **The Library is rebuilt.** Installed games come first, and games you own but haven’t installed fold into one **Not installed** row linked to their store. It gets the Stores tab’s chips and toolbar and a **Custom games** tab. (@xXJSONDeruloXx, @FX192, [#2894](https://github.com/Droid-Deck/DroidDeck/pull/2894), [#2897](https://github.com/Droid-Deck/DroidDeck/pull/2897), [#2920](https://github.com/Droid-Deck/DroidDeck/pull/2920))
|
||||
|
||||
<p align="center"><img src="media/0.7.11/library-installed.jpg" width="50%" alt="The Library with store chips (All, Steam, Epic, EA, Xbox, GOG, Rockstar, itch.io), a toolbar, an Installed row of Steam, EA, Ubisoft and GOG games with their sizes, and a Not installed row of 746 games below"></p>
|
||||
|
||||
- **Settings are rebuilt.** Setup is now **Settings**, Performance has its own page, every setting has one home, and search finds settings by everyday words such as fps, logs or ram. Storage, Syncthing and Downloads are tabs of their own. (@xXJSONDeruloXx, [#2569](https://github.com/Droid-Deck/DroidDeck/pull/2569), [#2627](https://github.com/Droid-Deck/DroidDeck/pull/2627), [#2791](https://github.com/Droid-Deck/DroidDeck/pull/2791), [#2798](https://github.com/Droid-Deck/DroidDeck/pull/2798), [#2809](https://github.com/Droid-Deck/DroidDeck/pull/2809), [#2811](https://github.com/Droid-Deck/DroidDeck/pull/2811), [#2812](https://github.com/Droid-Deck/DroidDeck/pull/2812), [#2558](https://github.com/Droid-Deck/DroidDeck/pull/2558))
|
||||
|
||||
- Added **Favorites** with a heart on the game page, a **Hidden** tab synced with Steam, and a **Soundtracks tab with a music player** with favorites, collections and Android’s media controls. (@FX192, [#2613](https://github.com/Droid-Deck/DroidDeck/pull/2613), [#2803](https://github.com/Droid-Deck/DroidDeck/pull/2803), [#2389](https://github.com/Droid-Deck/DroidDeck/pull/2389), [#2835](https://github.com/Droid-Deck/DroidDeck/pull/2835))
|
||||
|
||||
- **Decky and Boot movies get their own tabs**, shelved under More. Decky has Installed, **Store** and From ZIP pages; the store lists plugins by downloads with search, checks each download’s SHA-256 and updates what you have installed. (@xXJSONDeruloXx, [#3068](https://github.com/Droid-Deck/DroidDeck/pull/3068))
|
||||
|
||||
<p align="center"><img src="media/0.7.11/more-tab.jpg" width="45%" alt="The More page with Storage, Syncthing, Decky, Boot movies, Music and Dev Harness, and the Updates tab’s L icon for a local build on the rail"> <img src="media/0.7.11/decky-store.jpg" width="45%" alt="Decky’s Store page with a plugin search box and SteamGridDB and CSS Loader, each with an Install button"></p>
|
||||
|
||||
- **One screen picker for the bottom screen**: a dropdown next to X switches between the DroidDeck menu and the panels, replacing the D button and the Second screen tab. Every panel gets the swap button, and the menu’s tabs get Steam Deck style icons. (@xXJSONDeruloXx, [#2912](https://github.com/Droid-Deck/DroidDeck/pull/2912), [#2900](https://github.com/Droid-Deck/DroidDeck/pull/2900))
|
||||
|
||||
<p align="center"><img src="media/0.7.11/screen-picker.jpg" width="40%" alt="The bottom-screen picker open on a Dashboard, listing DroidDeck menu, Keyboard + trackpad, Terminal, Profile controls and Dashboard"></p>
|
||||
|
||||
- **The in-game menu works better on a dual-screen handheld.** It is now a bottom-screen mode, and a docked menu is touch only so the controller stays with the game, unless you turn on **Physical controls can use bottom screen**. **Dual screen sessions** can be set from the Display page, and Pause shows its screen at once, with a real last frame under Zero-copy. (@xXJSONDeruloXx, [#3001](https://github.com/Droid-Deck/DroidDeck/pull/3001), [#3080](https://github.com/Droid-Deck/DroidDeck/pull/3080))
|
||||
|
||||
- Added the **True black** theme for OLED screens with a highlight color you pick, and a **Custom theme** where you set every color. Inner gamer works with launcher animations off. (@DeathKhan, @EnzoDLofi, [#2541](https://github.com/Droid-Deck/DroidDeck/pull/2541), [#2542](https://github.com/Droid-Deck/DroidDeck/pull/2542), [#2850](https://github.com/Droid-Deck/DroidDeck/pull/2850))
|
||||
|
||||
- The **DroidDeck HUD** gets a switch and row order for every reading, an **estimated battery runtime** and a **long press to collapse or expand**, and locking is optional. **Hold the GPU at its top clock** can be switched from the in-game menu and applies right away, and a new switch shows the HUD only while a game runs. (@kingokksa, @EnzoDLofi, @xXJSONDeruloXx, @maxjivi05, [#2454](https://github.com/Droid-Deck/DroidDeck/pull/2454), [#2573](https://github.com/Droid-Deck/DroidDeck/pull/2573), [#2723](https://github.com/Droid-Deck/DroidDeck/pull/2723), [#2882](https://github.com/Droid-Deck/DroidDeck/pull/2882), [#2970](https://github.com/Droid-Deck/DroidDeck/pull/2970))
|
||||
|
||||
- **Launcher controller and gesture settings:** LT and RT step between main tabs on every layout, a light **haptic tick** follows controller navigation, and **Swipe between pages** can be turned off, with edge swipes in landscape left to Android. (@2-Shar, @xXJSONDeruloXx, [#3035](https://github.com/Droid-Deck/DroidDeck/pull/3035), [#3039](https://github.com/Droid-Deck/DroidDeck/pull/3039), [#2993](https://github.com/Droid-Deck/DroidDeck/pull/2993), [#2924](https://github.com/Droid-Deck/DroidDeck/pull/2924))
|
||||
|
||||
- **A smoother first run.** The runtime, DroidDeck-Proton and Steam’s package cache download in the background, one setup card and a progress chip show every step, and the first Play no longer waits on Steam, which already has its client update applied. Bluetooth is asked from the setup card, and Steam starts with big art and the bouncing logo screensaver. (@xXJSONDeruloXx, [#3091](https://github.com/Droid-Deck/DroidDeck/pull/3091), [#3114](https://github.com/Droid-Deck/DroidDeck/pull/3114), [#3087](https://github.com/Droid-Deck/DroidDeck/pull/3087), [#3152](https://github.com/Droid-Deck/DroidDeck/pull/3152))
|
||||
|
||||
### Improvements
|
||||
|
||||
- **Much faster games on a memory card.** DroidDeck no longer walks every game folder on the card at each session start and launch. A cold session start that took 7 to 170 s on 0.7.1 now takes 7 to 9 s, and across eight games cold start plus launch fell from an average of 104 s to 25 s. Steam’s file checks on the card are answered from a cache, so a 3,800-file install went from 261 s to 183.5 s. Reserving space, verifying and installing no longer drop to a slow path after one unsupported call. (@maxjivi05, [#2533](https://github.com/Droid-Deck/DroidDeck/pull/2533), [#2881](https://github.com/Droid-Deck/DroidDeck/pull/2881), [#2553](https://github.com/Droid-Deck/DroidDeck/pull/2553), [#2509](https://github.com/Droid-Deck/DroidDeck/pull/2509), [#2379](https://github.com/Droid-Deck/DroidDeck/pull/2379), [#2504](https://github.com/Droid-Deck/DroidDeck/pull/2504))
|
||||
|
||||
<p align="center"><img src="media/0.7.11/sd-card-game-start.png" width="45%" alt="Bar chart of a cold session start plus game launch from the SD card for eight games, average of two runs: 37, 122, 19, 65, 177, 192, 50 and 174 seconds on 0.7.1, 35, 19, 18, 34, 26, 23, 26 and 24 seconds on 0.7.11"> <img src="media/0.7.11/sd-card-install-steps.png" width="45%" alt="Bar chart of SD card library steps before and after: reserving space 68.9 to 27.5 seconds, commit 150.9 to 104.0, whole install 261.0 to 183.5, move from internal to card 156.8 to 121.7, reserving space for a second program 33.9 to 12.5, and uninstall 12.3 to 9.2"></p>
|
||||
|
||||
- **Memory is managed automatically.** Sessions reclaim memory from what Android actually reports, react to a fast fall on large-RAM devices before Android kills the session, and no longer compress Steam after every game start. This fixes sessions killed with gigabytes free, such as a 15 GB AYN Thor Max with 5.3 GB available, and 5 to 10 s freezes every 30 s on 11 to 12 GB devices. The four manual memory settings under Performance are removed. (@maxjivi05, @xXJSONDeruloXx, [#2853](https://github.com/Droid-Deck/DroidDeck/pull/2853), [#2382](https://github.com/Droid-Deck/DroidDeck/pull/2382), [#2754](https://github.com/Droid-Deck/DroidDeck/pull/2754), [#2335](https://github.com/Droid-Deck/DroidDeck/pull/2335), [#2347](https://github.com/Droid-Deck/DroidDeck/pull/2347), [#2758](https://github.com/Droid-Deck/DroidDeck/pull/2758))
|
||||
- **Steam’s shader pre-caching is on by default**, so games get Valve’s prebuilt shaders and stutter less on first play. (@xXJSONDeruloXx, [#2888](https://github.com/Droid-Deck/DroidDeck/pull/2888))
|
||||
- **Landscape and portrait resolutions are set separately**, each able to follow the other, and an **Avoid notch** switch in Steam’s Display options keeps the picture out of the camera cutout. (@FX192, @The412Banner, [#2990](https://github.com/Droid-Deck/DroidDeck/pull/2990), [#2983](https://github.com/Droid-Deck/DroidDeck/pull/2983), [#3124](https://github.com/Droid-Deck/DroidDeck/pull/3124))
|
||||
|
||||
<p align="center"><img src="media/0.7.11/display-resolutions.jpg" width="50%" alt="Steam Settings > Display with a Landscape resolution of 1280×720 and a Portrait resolution that follows landscape at 720×1280"></p>
|
||||
|
||||
- **Play Protect installs DroidDeck without a warning**: the app targets Android 14, and the shortcut accessibility service moved into an optional companion. (@xXJSONDeruloXx, [#2683](https://github.com/Droid-Deck/DroidDeck/pull/2683), [#2654](https://github.com/Droid-Deck/DroidDeck/pull/2654), [#2764](https://github.com/Droid-Deck/DroidDeck/pull/2764), [#2774](https://github.com/Droid-Deck/DroidDeck/pull/2774))
|
||||
- **Cooler steady games:** a game holding 30 fps or more for 3 s moves off the fastest cores, and the busiest game threads get a boost on every Snapdragon 8 Elite phone, not only the Odin 3. (@xXJSONDeruloXx, @Tapuuk, @xlulx, [#2572](https://github.com/Droid-Deck/DroidDeck/pull/2572), [#2608](https://github.com/Droid-Deck/DroidDeck/pull/2608), [#2914](https://github.com/Droid-Deck/DroidDeck/pull/2914))
|
||||
- **Turnip system-memory rendering** now reaches games and apps, not only the Steam client, and Steam’s interface uses GPU compositing where the driver supports it. (@maxjivi05, [#2338](https://github.com/Droid-Deck/DroidDeck/pull/2338), [#2660](https://github.com/Droid-Deck/DroidDeck/pull/2660))
|
||||
- **Mali:** MaliBridge 0.5.5.4, with the RE6 benchmark at about 25 fps on a Galaxy Tab S10+ and fewer hangs; DXVK runs on Mali GPUs without dual-source blending; and the x86-64 Steam client starts on Venus. (@ASEbrahim, @maxjivi05, [#2704](https://github.com/Droid-Deck/DroidDeck/pull/2704), [#2293](https://github.com/Droid-Deck/DroidDeck/pull/2293), [#2601](https://github.com/Droid-Deck/DroidDeck/pull/2601))
|
||||
- **Programs that need no proot.** Without proot, AppImages, Electron and Chromium apps, Flatpaks, Go programs, scripts without a shebang line and package updates that set file capabilities start as they do with proot, and x86 programs under FEX see the session’s identity, Unix sockets, locales and GL libraries. FEX follows the latest release, and Plasma and Firefox draw on the system PowerVR driver. (@maxjivi05, @The412Banner, @JMLambo, [#3096](https://github.com/Droid-Deck/DroidDeck/pull/3096), [#3097](https://github.com/Droid-Deck/DroidDeck/pull/3097), [#3098](https://github.com/Droid-Deck/DroidDeck/pull/3098), [#3099](https://github.com/Droid-Deck/DroidDeck/pull/3099), [#3103](https://github.com/Droid-Deck/DroidDeck/pull/3103), [#3104](https://github.com/Droid-Deck/DroidDeck/pull/3104), [#3106](https://github.com/Droid-Deck/DroidDeck/pull/3106), [#3108](https://github.com/Droid-Deck/DroidDeck/pull/3108), [#3112](https://github.com/Droid-Deck/DroidDeck/pull/3112), [#3120](https://github.com/Droid-Deck/DroidDeck/pull/3120), [#3121](https://github.com/Droid-Deck/DroidDeck/pull/3121), [#3147](https://github.com/Droid-Deck/DroidDeck/pull/3147), [#3151](https://github.com/Droid-Deck/DroidDeck/pull/3151), [#3154](https://github.com/Droid-Deck/DroidDeck/pull/3154), [#3155](https://github.com/Droid-Deck/DroidDeck/pull/3155), [#3157](https://github.com/Droid-Deck/DroidDeck/pull/3157), [#3158](https://github.com/Droid-Deck/DroidDeck/pull/3158), [#3159](https://github.com/Droid-Deck/DroidDeck/pull/3159), [#3161](https://github.com/Droid-Deck/DroidDeck/pull/3161), [#3162](https://github.com/Droid-Deck/DroidDeck/pull/3162), [#3171](https://github.com/Droid-Deck/DroidDeck/pull/3171), [#3077](https://github.com/Droid-Deck/DroidDeck/pull/3077), [#3059](https://github.com/Droid-Deck/DroidDeck/pull/3059), [#3054](https://github.com/Droid-Deck/DroidDeck/pull/3054), [#3055](https://github.com/Droid-Deck/DroidDeck/pull/3055), [#3074](https://github.com/Droid-Deck/DroidDeck/pull/3074), [#3094](https://github.com/Droid-Deck/DroidDeck/pull/3094), [#3105](https://github.com/Droid-Deck/DroidDeck/pull/3105), [#3110](https://github.com/Droid-Deck/DroidDeck/pull/3110), [#3070](https://github.com/Droid-Deck/DroidDeck/pull/3070), [#3052](https://github.com/Droid-Deck/DroidDeck/pull/3052), [#3040](https://github.com/Droid-Deck/DroidDeck/pull/3040), [#3020](https://github.com/Droid-Deck/DroidDeck/pull/3020), [#3026](https://github.com/Droid-Deck/DroidDeck/pull/3026), [#2836](https://github.com/Droid-Deck/DroidDeck/pull/2836), [#2839](https://github.com/Droid-Deck/DroidDeck/pull/2839))
|
||||
- **A first launch with nothing to unpack:** setup applies Steam’s client update itself, so the first Steam start skips about 30 s of unpacking and its restart, and a failed package claim now fails the install instead of leaving it half done. (@xXJSONDeruloXx, [#3152](https://github.com/Droid-Deck/DroidDeck/pull/3152), [#3145](https://github.com/Droid-Deck/DroidDeck/pull/3145), [#3149](https://github.com/Droid-Deck/DroidDeck/pull/3149))
|
||||
- **Pressing Play on a launcher-run game** shows Starting until it launches, instead of sitting on Play for 12 to 24 s. (@maxjivi05, [#2586](https://github.com/Droid-Deck/DroidDeck/pull/2586))
|
||||
- **A session that fails to start says why**, and stopping a session while it starts undoes the start-up work. (@Tapuuk, [#2841](https://github.com/Droid-Deck/DroidDeck/pull/2841), [#2840](https://github.com/Droid-Deck/DroidDeck/pull/2840))
|
||||
- **Battle.net** keeps the launch behavior you chose, shows its own reason when it refuses a game folder, lists its games under the runtime path, and a download that stops moving ends with Retry. (@xXJSONDeruloXx, @visail, @maxjivi05, [#2750](https://github.com/Droid-Deck/DroidDeck/pull/2750), [#1661](https://github.com/Droid-Deck/DroidDeck/pull/1661), [#2602](https://github.com/Droid-Deck/DroidDeck/pull/2602), [#3188](https://github.com/Droid-Deck/DroidDeck/pull/3188))
|
||||
- **On-screen stick knobs redraw at about 30 fps** instead of on every move, and **Gamescope draws its cursor by default**. (@Tapuuk, @xXJSONDeruloXx, [#2842](https://github.com/Droid-Deck/DroidDeck/pull/2842), [#3187](https://github.com/Droid-Deck/DroidDeck/pull/3187))
|
||||
- **The agent’s setup install retries** on transient source errors and no longer accepts a held-back package. (@xXJSONDeruloXx, [#2904](https://github.com/Droid-Deck/DroidDeck/pull/2904))
|
||||
- **Translations** cover the missing strings, including the input settings, in every language. (@kingokksa, [#2556](https://github.com/Droid-Deck/DroidDeck/pull/2556))
|
||||
- **Clearer logs** for bug reports: runtime install failures, GPU driver lines, GOG cloud sync failures, device restarts, guest start steps, errors from Windows programs started from the desktop, GPU clock holds, and RPCS3’s own log in Share logs. (@maxjivi05, @The412Banner, @xXJSONDeruloXx, [#2591](https://github.com/Droid-Deck/DroidDeck/pull/2591), [#2593](https://github.com/Droid-Deck/DroidDeck/pull/2593), [#2596](https://github.com/Droid-Deck/DroidDeck/pull/2596), [#2752](https://github.com/Droid-Deck/DroidDeck/pull/2752), [#2502](https://github.com/Droid-Deck/DroidDeck/pull/2502), [#2695](https://github.com/Droid-Deck/DroidDeck/pull/2695), [#2343](https://github.com/Droid-Deck/DroidDeck/pull/2343), [#2893](https://github.com/Droid-Deck/DroidDeck/pull/2893), [#3130](https://github.com/Droid-Deck/DroidDeck/pull/3130))
|
||||
- Building and testing: local builds work on x86_64 Linux, source builds start on storage without hard links, test tools for pens and two-screen phones, preview renders of the Library and in-game menu, and steadier CI. (@xXJSONDeruloXx, @maxjivi05, @alien2003, @Tapuuk, [#2807](https://github.com/Droid-Deck/DroidDeck/pull/2807), [#2639](https://github.com/Droid-Deck/DroidDeck/pull/2639), [#2628](https://github.com/Droid-Deck/DroidDeck/pull/2628), [#2844](https://github.com/Droid-Deck/DroidDeck/pull/2844), [#2469](https://github.com/Droid-Deck/DroidDeck/pull/2469), [#2483](https://github.com/Droid-Deck/DroidDeck/pull/2483), [#2672](https://github.com/Droid-Deck/DroidDeck/pull/2672), [#2635](https://github.com/Droid-Deck/DroidDeck/pull/2635), [#2908](https://github.com/Droid-Deck/DroidDeck/pull/2908), [#2899](https://github.com/Droid-Deck/DroidDeck/pull/2899), [#2938](https://github.com/Droid-Deck/DroidDeck/pull/2938))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed **games failing to start since 0.7.1** in ARM64 prefixes, such as Unreal Engine games asking for the Visual C++ arm64 redistributable and Red Dead Redemption 2 missing `vulkan-1.dll`. (@xXJSONDeruloXx, @maxjivi05, [#2442](https://github.com/Droid-Deck/DroidDeck/pull/2442), [#2647](https://github.com/Droid-Deck/DroidDeck/pull/2647))
|
||||
- Fixed **Windows games on Android shared storage** crashing at launch, and 32-bit games such as Spore, Terraria and Borderlands 2 hanging at launch after that fix. (@maxjivi05, @xXJSONDeruloXx, [#2594](https://github.com/Droid-Deck/DroidDeck/pull/2594), [#2706](https://github.com/Droid-Deck/DroidDeck/pull/2706))
|
||||
- Fixed **digital triggers** on handhelds such as the AYN Thor no longer responding since 0.7.0, **right sticks reported on other axes** never reaching the game, and the app closing when a controller disconnects mid-press. (@maxjivi05, [#2291](https://github.com/Droid-Deck/DroidDeck/pull/2291), [#2333](https://github.com/Droid-Deck/DroidDeck/pull/2333), [#2369](https://github.com/Droid-Deck/DroidDeck/pull/2369))
|
||||
- Fixed **driver picks on non-Adreno and smaller Adreno GPUs**: Auto no longer gives Adreno 710, 720 and 722 a display driver that finds no GPU, gives Xclipse 540 a working driver pair instead of a black Steam at about 1 fps, never loads an Adreno-only driver elsewhere, lets Auto-installed display drivers fall back to the system driver, and handles the Mali bridge switch correctly. (@maxjivi05, @unixenon, @The412Banner, [#2356](https://github.com/Droid-Deck/DroidDeck/pull/2356), [#2337](https://github.com/Droid-Deck/DroidDeck/pull/2337), [#2588](https://github.com/Droid-Deck/DroidDeck/pull/2588), [#2406](https://github.com/Droid-Deck/DroidDeck/pull/2406), [#2684](https://github.com/Droid-Deck/DroidDeck/pull/2684), [#2977](https://github.com/Droid-Deck/DroidDeck/pull/2977))
|
||||
- Fixed **Steam flickering on the Mali bridge** and **stalling on Venus** with a Dimensity 9300. (@rainleee, @The412Banner, @xXJSONDeruloXx, [#2506](https://github.com/Droid-Deck/DroidDeck/pull/2506), [#2721](https://github.com/Droid-Deck/DroidDeck/pull/2721), [#2441](https://github.com/Droid-Deck/DroidDeck/pull/2441))
|
||||
- Fixed **Epic’s Install** failing for everyone after Epic stopped publishing its Linux launcher download, and Epic now says which launcher installs a third-party game. (@maxjivi05, [#2281](https://github.com/Droid-Deck/DroidDeck/pull/2281), [#2344](https://github.com/Droid-Deck/DroidDeck/pull/2344))
|
||||
- Fixed **Game Pass downloads and launches** failing with HTTP 401, and Xbox games reporting the account service unavailable. (@maxjivi05, @Zeratullo, [#2598](https://github.com/Droid-Deck/DroidDeck/pull/2598), [#2751](https://github.com/Droid-Deck/DroidDeck/pull/2751))
|
||||
- Fixed **Xbox games that use PlayFab Game Saves**, such as Forza Horizon 6, stopping at “Initialization Failed”, and **older Xbox games** not installing: they now install through Windows Update or from their content boxes, with Nexus backend 0.2.15 and DLC mounting. Xbox sign-in also looks like the other stores’. (@l4nr3, @xXJSONDeruloXx, @The412Banner, [#2662](https://github.com/Droid-Deck/DroidDeck/pull/2662), [#2718](https://github.com/Droid-Deck/DroidDeck/pull/2718), [#2825](https://github.com/Droid-Deck/DroidDeck/pull/2825), [#2851](https://github.com/Droid-Deck/DroidDeck/pull/2851), [#2696](https://github.com/Droid-Deck/DroidDeck/pull/2696))
|
||||
- Fixed **game-specific crashes**: Death Stranding running out of memory on 39-bit kernels, Godot games with Sentry or UI Automation crashing, Final Fantasy VII Rebirth and Kingdom Come: Deliverance II at the D3D12 level they need, a game’s own DLL overrides replacing DroidDeck’s, and Call of Duty: Black Ops II starting through Steam. (@KeegantheVeganat0r, @Kobtul, @maxjivi05, @xXJSONDeruloXx, @Drik0, [#2641](https://github.com/Droid-Deck/DroidDeck/pull/2641), [#2644](https://github.com/Droid-Deck/DroidDeck/pull/2644), [#2605](https://github.com/Droid-Deck/DroidDeck/pull/2605), [#2595](https://github.com/Droid-Deck/DroidDeck/pull/2595), [#2289](https://github.com/Droid-Deck/DroidDeck/pull/2289), [#2787](https://github.com/Droid-Deck/DroidDeck/pull/2787), [#2332](https://github.com/Droid-Deck/DroidDeck/pull/2332), [#2892](https://github.com/Droid-Deck/DroidDeck/pull/2892))
|
||||
- Fixed **the Desktop session**: it draws again and Sunshine can capture it, Windows games started from Steam no longer close after a second, Flatpak apps get the GPU and working file dialogs, and removable drives show in Dolphin. (@xXJSONDeruloXx, @maxjivi05, [#2780](https://github.com/Droid-Deck/DroidDeck/pull/2780), [#2446](https://github.com/Droid-Deck/DroidDeck/pull/2446), [#2597](https://github.com/Droid-Deck/DroidDeck/pull/2597), [#2699](https://github.com/Droid-Deck/DroidDeck/pull/2699), [#2671](https://github.com/Droid-Deck/DroidDeck/pull/2671), [#3190](https://github.com/Droid-Deck/DroidDeck/pull/3190))
|
||||
- Fixed **audio not coming back** after a long sleep, and **the HUD and game clocks** reading wrong after sleep and wake. (@maxjivi05, @xXJSONDeruloXx, [#2396](https://github.com/Droid-Deck/DroidDeck/pull/2396), [#2821](https://github.com/Droid-Deck/DroidDeck/pull/2821), [#2393](https://github.com/Droid-Deck/DroidDeck/pull/2393), [#2552](https://github.com/Droid-Deck/DroidDeck/pull/2552))
|
||||
- Fixed **Epic games that check for Epic’s launcher**, such as GTA V, quitting at start (they now also get the Rockstar SDK they need), and the **itch.io browse grid** staying empty on the default filters. (@K11MCH1, @FX192, [#2932](https://github.com/Droid-Deck/DroidDeck/pull/2932), [#2918](https://github.com/Droid-Deck/DroidDeck/pull/2918))
|
||||
- Fixed **other apps reaching DroidDeck’s private folders** through the system folder picker. (@Tapuuk, [#2846](https://github.com/Droid-Deck/DroidDeck/pull/2846))
|
||||
- Fixed **input and controls**: the on-screen controls editor drawing layouts squashed and overlapping, and saving a Steam touch layout for a game with no touch config; touch stopping after overlapping touches, taps clicking while an on-screen mouse button shows, and System Back turning into a right-click; a USB mouse in REDMAGIC cast mode stopping at the screen edge, held keys dropping when pointer capture ends, and rumble that kept going after a crash; controller navigation on the Apps page, B closing the page behind the on-screen keyboard, and the file manager toolbar after a drive change; a DualShock or DualSense picked mid-session not reattaching to Steam; SDL 3 games and apps that reload libudev crashing on the virtual pads, hardware Escape reaching Back late, and the nested mouse not moving with touch Disabled; launcher focus ring and navigation glitches, including the game page’s main action and tabs (@maxjivi05, @kingokksa, @OmarAlTaki1, @KvFxKaido, @zdennisz, @Tapuuk, @DeathKhan, @Dantalian-dev, @xXJSONDeruloXx, @Necomer0920, @0use-TE, @The412Banner, @xlulx, @2-Shar, [#2339](https://github.com/Droid-Deck/DroidDeck/pull/2339), [#2783](https://github.com/Droid-Deck/DroidDeck/pull/2783), [#2580](https://github.com/Droid-Deck/DroidDeck/pull/2580), [#2528](https://github.com/Droid-Deck/DroidDeck/pull/2528), [#2465](https://github.com/Droid-Deck/DroidDeck/pull/2465), [#2323](https://github.com/Droid-Deck/DroidDeck/pull/2323), [#2298](https://github.com/Droid-Deck/DroidDeck/pull/2298), [#2666](https://github.com/Droid-Deck/DroidDeck/pull/2666), [#2779](https://github.com/Droid-Deck/DroidDeck/pull/2779), [#2614](https://github.com/Droid-Deck/DroidDeck/pull/2614), [#2492](https://github.com/Droid-Deck/DroidDeck/pull/2492), [#2499](https://github.com/Droid-Deck/DroidDeck/pull/2499), [#2534](https://github.com/Droid-Deck/DroidDeck/pull/2534), [#2544](https://github.com/Droid-Deck/DroidDeck/pull/2544), [#2545](https://github.com/Droid-Deck/DroidDeck/pull/2545), [#2543](https://github.com/Droid-Deck/DroidDeck/pull/2543), [#2498](https://github.com/Droid-Deck/DroidDeck/pull/2498), [#2564](https://github.com/Droid-Deck/DroidDeck/pull/2564), [#2567](https://github.com/Droid-Deck/DroidDeck/pull/2567), [#2963](https://github.com/Droid-Deck/DroidDeck/pull/2963), [#2915](https://github.com/Droid-Deck/DroidDeck/pull/2915), [#3180](https://github.com/Droid-Deck/DroidDeck/pull/3180), [#2976](https://github.com/Droid-Deck/DroidDeck/pull/2976), [#2902](https://github.com/Droid-Deck/DroidDeck/pull/2902), [#3008](https://github.com/Droid-Deck/DroidDeck/pull/3008), [#2961](https://github.com/Droid-Deck/DroidDeck/pull/2961), [#3036](https://github.com/Droid-Deck/DroidDeck/pull/3036), [#3039](https://github.com/Droid-Deck/DroidDeck/pull/3039), [#2906](https://github.com/Droid-Deck/DroidDeck/pull/2906), [#2909](https://github.com/Droid-Deck/DroidDeck/pull/2909), [#3082](https://github.com/Droid-Deck/DroidDeck/pull/3082), [#2994](https://github.com/Droid-Deck/DroidDeck/pull/2994), [#2973](https://github.com/Droid-Deck/DroidDeck/pull/2973), [#2929](https://github.com/Droid-Deck/DroidDeck/pull/2929), [#3017](https://github.com/Droid-Deck/DroidDeck/pull/3017))
|
||||
- Fixed **Steam, stores and the Library**: x86-64 Steam store shortcuts that closed within a second, x86-64 Linux games missing libraries under FEX, and 32-bit games such as Left 4 Dead 2 aborting; Steam coming back empty after aborting a black-screen game, and an OpenGL game going black after a level; Return to DroidDeck ending the session at Steam’s install-script step, and Steam’s saved scaling mode not applying; Steam’s frame limits following Game Mode’s FPS override instead of the screen; cloud saves missing for a Steam game launched as an added game; GOG installs hanging on Finishing for games with thousands of files; GOG space checks and cloud saves, an Epic sign-in loop, EA touchup retries, Xbox bundles, and Battle.net games vanishing after a native session; Steam-install and Add game picker oddities, plus a warning when game storage is FAT32; launch requests now handled one at a time, and FEX or AppImage extraction hanging at start-up; Remote Play failing to connect with the virtual pads present, and fullscreen streams cropped to a corner (@maxjivi05, @xXJSONDeruloXx, @The412Banner, @KvFxKaido, @moronigranja, @zdennisz, @visail, @guohaomin1995-dev, [#2336](https://github.com/Droid-Deck/DroidDeck/pull/2336), [#2334](https://github.com/Droid-Deck/DroidDeck/pull/2334), [#2484](https://github.com/Droid-Deck/DroidDeck/pull/2484), [#2592](https://github.com/Droid-Deck/DroidDeck/pull/2592), [#2426](https://github.com/Droid-Deck/DroidDeck/pull/2426), [#2600](https://github.com/Droid-Deck/DroidDeck/pull/2600), [#2562](https://github.com/Droid-Deck/DroidDeck/pull/2562), [#2732](https://github.com/Droid-Deck/DroidDeck/pull/2732), [#2681](https://github.com/Droid-Deck/DroidDeck/pull/2681), [#2717](https://github.com/Droid-Deck/DroidDeck/pull/2717), [#2463](https://github.com/Droid-Deck/DroidDeck/pull/2463), [#2367](https://github.com/Droid-Deck/DroidDeck/pull/2367), [#2419](https://github.com/Droid-Deck/DroidDeck/pull/2419), [#2720](https://github.com/Droid-Deck/DroidDeck/pull/2720), [#3025](https://github.com/Droid-Deck/DroidDeck/pull/3025), [#2421](https://github.com/Droid-Deck/DroidDeck/pull/2421), [#2505](https://github.com/Droid-Deck/DroidDeck/pull/2505), [#3172](https://github.com/Droid-Deck/DroidDeck/pull/3172), [#3175](https://github.com/Droid-Deck/DroidDeck/pull/3175), [#3003](https://github.com/Droid-Deck/DroidDeck/pull/3003), [#3029](https://github.com/Droid-Deck/DroidDeck/pull/3029), [#3148](https://github.com/Droid-Deck/DroidDeck/pull/3148), [#3075](https://github.com/Droid-Deck/DroidDeck/pull/3075), [#2742](https://github.com/Droid-Deck/DroidDeck/pull/2742), [#2411](https://github.com/Droid-Deck/DroidDeck/pull/2411), [#2818](https://github.com/Droid-Deck/DroidDeck/pull/2818), [#3177](https://github.com/Droid-Deck/DroidDeck/pull/3177), [#3123](https://github.com/Droid-Deck/DroidDeck/pull/3123), [#2883](https://github.com/Droid-Deck/DroidDeck/pull/2883), [#3044](https://github.com/Droid-Deck/DroidDeck/pull/3044), [#3070](https://github.com/Droid-Deck/DroidDeck/pull/3070), [#2651](https://github.com/Droid-Deck/DroidDeck/pull/2651), [#2946](https://github.com/Droid-Deck/DroidDeck/pull/2946), [#2968](https://github.com/Droid-Deck/DroidDeck/pull/2968), [#3095](https://github.com/Droid-Deck/DroidDeck/pull/3095))
|
||||
- Fixed **display and drivers**: broken pictures on GPUs such as the Adreno 710 whose driver lists no buffer layouts; display and Steam window sizes after Steam resizes the game screen; the Mali bridge switch, Zink on Mali-G610 and shaders the phone’s compiler rejected (@The412Banner, @xXJSONDeruloXx, @LarzVader, @maxjivi05, [#2927](https://github.com/Droid-Deck/DroidDeck/pull/2927), [#2738](https://github.com/Droid-Deck/DroidDeck/pull/2738), [#3124](https://github.com/Droid-Deck/DroidDeck/pull/3124), [#2985](https://github.com/Droid-Deck/DroidDeck/pull/2985), [#3076](https://github.com/Droid-Deck/DroidDeck/pull/3076), [#3164](https://github.com/Droid-Deck/DroidDeck/pull/3164), [#3102](https://github.com/Droid-Deck/DroidDeck/pull/3102), [#3101](https://github.com/Droid-Deck/DroidDeck/pull/3101), [#2587](https://github.com/Droid-Deck/DroidDeck/pull/2587))
|
||||
- Fixed **a few more things**: a session freezing while a program waits for a browser sign-in, and picture-in-picture leaving no way back; the bottom screen ignoring touch during a game, and launching a running game again asking Steam twice; the app closing when opening Game environment from the second screen; the Stores tab moving under More, apps opening on the wrong screen, and the launcher freezing after a language change; game starts for Hades II, Dragon’s Dogma 2, Dragon Quest Monsters 4, Mount & Blade: Warband, Don’t Starve Together and Europa Universalis IV; x86 Steam stopping at Installing update under FEX, Battle.net unable to repair ProgramData folders a stale Windows owner locked, Windows programs reading the wrong CPU cache sizes, RetroArch’s packaged assets and cores, and non-Adreno graphics logs turning on Wine debug tracing; the desktop panel layout and KDE language packs; Decky Loader’s menu, Electron Node helpers, a Bluetooth controller that fails to disconnect closing the app, and per-game Turnip debug settings. Dual screen sessions also gets **On, game on second screen**, for a phone driving a monitor or TV (@maxjivi05, @xXJSONDeruloXx, @albert-carreras, @The412Banner, @xlulx, @Tapuuk, @zdennisz, @coffeemeist3r, [#2615](https://github.com/Droid-Deck/DroidDeck/pull/2615), [#2559](https://github.com/Droid-Deck/DroidDeck/pull/2559), [#2910](https://github.com/Droid-Deck/DroidDeck/pull/2910), [#2937](https://github.com/Droid-Deck/DroidDeck/pull/2937), [#2919](https://github.com/Droid-Deck/DroidDeck/pull/2919), [#2940](https://github.com/Droid-Deck/DroidDeck/pull/2940), [#2452](https://github.com/Droid-Deck/DroidDeck/pull/2452), [#3115](https://github.com/Droid-Deck/DroidDeck/pull/3115), [#3093](https://github.com/Droid-Deck/DroidDeck/pull/3093), [#3163](https://github.com/Droid-Deck/DroidDeck/pull/3163), [#2855](https://github.com/Droid-Deck/DroidDeck/pull/2855), [#3011](https://github.com/Droid-Deck/DroidDeck/pull/3011), [#2847](https://github.com/Droid-Deck/DroidDeck/pull/2847), [#3092](https://github.com/Droid-Deck/DroidDeck/pull/3092), [#2998](https://github.com/Droid-Deck/DroidDeck/pull/2998), [#3173](https://github.com/Droid-Deck/DroidDeck/pull/3173), [#2845](https://github.com/Droid-Deck/DroidDeck/pull/2845), [#2481](https://github.com/Droid-Deck/DroidDeck/pull/2481), [#2418](https://github.com/Droid-Deck/DroidDeck/pull/2418), [#2670](https://github.com/Droid-Deck/DroidDeck/pull/2670), [#2254](https://github.com/Droid-Deck/DroidDeck/pull/2254), [#2327](https://github.com/Droid-Deck/DroidDeck/pull/2327), [#2703](https://github.com/Droid-Deck/DroidDeck/pull/2703), [#2549](https://github.com/Droid-Deck/DroidDeck/pull/2549), [#2808](https://github.com/Droid-Deck/DroidDeck/pull/2808), [#2781](https://github.com/Droid-Deck/DroidDeck/pull/2781), [#2178](https://github.com/Droid-Deck/DroidDeck/pull/2178), [#2197](https://github.com/Droid-Deck/DroidDeck/pull/2197), [#3193](https://github.com/Droid-Deck/DroidDeck/pull/3193), [#3194](https://github.com/Droid-Deck/DroidDeck/pull/3194), [#2705](https://github.com/Droid-Deck/DroidDeck/pull/2705), [#2451](https://github.com/Droid-Deck/DroidDeck/pull/2451), [#2730](https://github.com/Droid-Deck/DroidDeck/pull/2730))
|
||||
|
||||
### DroidDeck-Proton and drivers
|
||||
|
||||
These ship outside the app and reach you through Components. DroidDeck 0.7.1 had DroidDeck-Proton 11-12.3 and DD-Turnip v0.5.0; 0.7.11 brings DroidDeck-Proton 11-14.1 and DD-Turnip v0.9.1.
|
||||
|
||||
- **Faster game starts, most of all from a memory card** (DroidDeck-Proton 11-12.5 to 11-12.7). Closing an event no longer stops every other thread while wineserver answers, events come back ready to wait on, closed private events are reused, and file lookups skip extended-attribute queries and folder scans a memory card can’t answer. World of Warcraft’s start fell from 111 s to 60 s. (@maxjivi05, [Proton#17](https://github.com/Droid-Deck/DroidDeck-Proton/pull/17), [Proton#19](https://github.com/Droid-Deck/DroidDeck-Proton/pull/19), [Proton#26](https://github.com/Droid-Deck/DroidDeck-Proton/pull/26))
|
||||
- Fixed **games that debug a copy of themselves**, such as Metal Gear Solid V: Ground Zeroes, stuck on the same breakpoint at start, and **old Steam DRM games failing with error 55**. (@xXJSONDeruloXx, [Proton#16](https://github.com/Droid-Deck/DroidDeck-Proton/pull/16), [Proton#12](https://github.com/Droid-Deck/DroidDeck-Proton/pull/12))
|
||||
- Fixed **intro videos that never end**, such as Burnout Paradise Remastered waiting forever on the last frame of its first intro. (@K11MCH1, [Proton#13](https://github.com/Droid-Deck/DroidDeck-Proton/pull/13), [Proton#14](https://github.com/Droid-Deck/DroidDeck-Proton/pull/14))
|
||||
- **DroidDeck-Proton 11-14.1 moves to GE-Proton11-14**, Valve’s Wine from 21 November and FEX-2611-68, with DXVK v3.1.1, VKD3D-Proton v3.1 and about 25 video playback fixes. Games that use D3D8 or 32-bit DirectDraw stay on wined3d, as in 11-12, unless you set `PROTON_DXVK_D3D8=1` or `PROTON_USE_D7VK=1`.
|
||||
- Fixed **games freezing after a thread is stopped mid-wait**, such as the Forza Horizon 6 loading screen, **Crash Bandicoot N. Sane Trilogy** closing seconds after its title screen, **Death Stranding Director’s Cut** crashing when a graphics setting is applied, **Call of Duty: Black Ops III** crashing about 20 seconds after start, and hooking libraries that couldn’t patch relocated 32-bit DLLs. (@l4nr3, @66sam, @KeegantheVeganat0r, @FryMcNugget, @maxjivi05, [Proton#30](https://github.com/Droid-Deck/DroidDeck-Proton/pull/30), [Proton#24](https://github.com/Droid-Deck/DroidDeck-Proton/pull/24), [Proton#31](https://github.com/Droid-Deck/DroidDeck-Proton/pull/31), [Proton#34](https://github.com/Droid-Deck/DroidDeck-Proton/pull/34), [Proton#40](https://github.com/Droid-Deck/DroidDeck-Proton/pull/40))
|
||||
- **DD-Turnip v0.6.0 to v0.9.1** follow Mesa main (more than 1,300 upstream commits). The GPU can clock down again when there is little to draw, so it runs cooler and saves battery, and game frames can go straight to the compositor’s display buffers for Zero-copy presentation. (@xXJSONDeruloXx, @maxjivi05, [Drivers#22](https://github.com/Droid-Deck/Drivers/pull/22), [Drivers#26](https://github.com/Droid-Deck/Drivers/pull/26), [Drivers#20](https://github.com/Droid-Deck/Drivers/pull/20), [Drivers#27](https://github.com/Droid-Deck/Drivers/pull/27))
|
||||
- **DD-Turnip-Emu**, the Android driver packaged for emulators, is now published with every DD-Turnip release. (@maxjivi05, [Drivers#31](https://github.com/Droid-Deck/Drivers/pull/31))
|
||||
- Fixed **invisible game menus after a descriptor pool reset**, such as the Scaleform UI in Detroit: Become Human on Adreno 840, and made **subgroup shuffles** cost one step instead of one per thread. (@l4nr3, [Drivers#12](https://github.com/Droid-Deck/Drivers/pull/12), [Drivers#10](https://github.com/Droid-Deck/Drivers/pull/10))
|
||||
|
||||
### Community
|
||||
|
||||
DroidDeck is built in the open by the people who use it. These are everyone whose code is in 0.7.11:
|
||||
|
||||
| Contributor | Pull requests |
|
||||
|---|---|
|
||||
| @xXJSONDeruloXx | 192: stores, run without proot, tabs and Settings, Library, screen picker, first run, Decky store and more |
|
||||
| @maxjivi05 | 141: zero-copy and HDR, memory card speed, memory management, CurseForge, on-screen controls, drivers and more |
|
||||
| @The412Banner | 23: DroidDeck-Bionic, Xbox backend, AppImages and Flatpaks without proot, Mali bridge |
|
||||
| @DeathKhan | 12: True black theme, Apps page, Home button |
|
||||
| @Tapuuk | 10: 8 Elite thread boost, start-up errors, HUD, CI |
|
||||
| @KeegantheVeganat0r | 9: Lab builds, Death Stranding fix |
|
||||
| @EnzoDLofi | 9: per-game frame generation, integer scaling, SMAA, Custom theme |
|
||||
| @2-Shar | 9: LT and RT tab stepping, page swipes, focus ring |
|
||||
| @FX192 | 8: Soundtracks, Favorites, Hidden tab, Manage stores, resolutions |
|
||||
| @kingokksa | 5: virtual pads outside Steam, HUD, translations |
|
||||
| @K11MCH1 | 4: Ubisoft launches, Epic launcher check |
|
||||
| @zdennisz | 4: held keys, FAT32 warning |
|
||||
| @alien2003 | 3: pen as a mouse, pen test tool, two-screen screenshots |
|
||||
| @Dantalian-dev | 3: file manager toolbar and Back, plain text editor |
|
||||
| @FryMcNugget | 3: Proton from a .zip, Lab build memory |
|
||||
| @xlulx | 3: SM8750P thread hints, nested mouse with touch disabled, native shader compilers for three games |
|
||||
| @JMLambo | 2: Plasma and Firefox on the system PowerVR driver |
|
||||
| @KvFxKaido | 2: Back gesture with controllers that bring a mouse, Xbox bundle packaging files |
|
||||
| @LarzVader | 2: Zink on Mali-G610, Mali layer map growth |
|
||||
| @visail | 2: Battle.net folder errors, launch request coordinator |
|
||||
| @0use-TE | 1: hardware Escape before Back |
|
||||
| @albert-carreras | 1: Dragon Quest Monsters 4 |
|
||||
| @ASEbrahim | 1: MaliBridge 0.5.5.4 |
|
||||
| @coffeemeist3r | 1: Mesa sampler fix |
|
||||
| @Drik0 | 1: per-game DLL overrides |
|
||||
| @guohaomin1995-dev | 1: arm64 Steam update progress in every language |
|
||||
| @informalTechCode | 1: XREAL One Pro+ tracking |
|
||||
| @JanPokorny | 1: Dev Harness focus fix |
|
||||
| @Kobtul | 1: Godot games with Sentry |
|
||||
| @l4nr3 | 1: Xbox PlayFab Game Saves |
|
||||
| @measlesbagel | 1: icon packs |
|
||||
| @mhaye20 | 1: XREAL One and Aura head tracking |
|
||||
| @moronigranja | 1: Steam target whose file is gone |
|
||||
| @Necomer0920 | 1: SDL 3 games and the virtual pads’ udev devices |
|
||||
| @OmarAlTaki1 | 1: USB mouse in cast mode |
|
||||
| @pablogonz12 | 1: payload shebangs |
|
||||
| @rainleee | 1: Mali bridge flicker |
|
||||
| @SlicelessBread | 1: Lab builds on 8 GB devices |
|
||||
| @unixenon | 1: Mali (Venus) switch after restart |
|
||||
| @vinegh4 | 1: Remote Play controllers |
|
||||
| @Zeratullo | 1: Xbox launch folder |
|
||||
| @66sam | 1: Crash Bandicoot fix in DroidDeck-Proton |
|
||||
|
||||
### New contributors
|
||||
|
||||
- @vinegh4 made their first contribution in [#2033](https://github.com/Droid-Deck/DroidDeck/pull/2033).
|
||||
- @measlesbagel made their first contribution in [#2207](https://github.com/Droid-Deck/DroidDeck/pull/2207).
|
||||
- @Drik0 made their first contribution in [#2332](https://github.com/Droid-Deck/DroidDeck/pull/2332).
|
||||
- @DeathKhan made their first contribution in [#2492](https://github.com/Droid-Deck/DroidDeck/pull/2492).
|
||||
- @rainleee made their first contribution in [#2506](https://github.com/Droid-Deck/DroidDeck/pull/2506).
|
||||
- @zdennisz made their first contribution in [#2524](https://github.com/Droid-Deck/DroidDeck/pull/2524).
|
||||
- @mhaye20 made their first contribution in [#2532](https://github.com/Droid-Deck/DroidDeck/pull/2532).
|
||||
- @Tapuuk made their first contribution in [#2607](https://github.com/Droid-Deck/DroidDeck/pull/2607).
|
||||
- @alien2003 made their first contribution in [#2625](https://github.com/Droid-Deck/DroidDeck/pull/2625).
|
||||
- @guohaomin1995-dev made their first contribution in [#2651](https://github.com/Droid-Deck/DroidDeck/pull/2651).
|
||||
- @KvFxKaido made their first contribution in [#2666](https://github.com/Droid-Deck/DroidDeck/pull/2666).
|
||||
- @SlicelessBread made their first contribution in [#2667](https://github.com/Droid-Deck/DroidDeck/pull/2667).
|
||||
- @unixenon made their first contribution in [#2684](https://github.com/Droid-Deck/DroidDeck/pull/2684).
|
||||
- @Zeratullo made their first contribution in [#2751](https://github.com/Droid-Deck/DroidDeck/pull/2751).
|
||||
- @JanPokorny made their first contribution in [#2769](https://github.com/Droid-Deck/DroidDeck/pull/2769).
|
||||
- @JMLambo made their first contribution in [#2836](https://github.com/Droid-Deck/DroidDeck/pull/2836).
|
||||
- @albert-carreras made their first contribution in [#2847](https://github.com/Droid-Deck/DroidDeck/pull/2847).
|
||||
- @2-Shar made their first contribution in [#2856](https://github.com/Droid-Deck/DroidDeck/pull/2856).
|
||||
- @FryMcNugget made their first contribution in [#2864](https://github.com/Droid-Deck/DroidDeck/pull/2864).
|
||||
- @xlulx made their first contribution in [#2914](https://github.com/Droid-Deck/DroidDeck/pull/2914).
|
||||
- @Necomer0920 made their first contribution in [#2915](https://github.com/Droid-Deck/DroidDeck/pull/2915).
|
||||
- @pablogonz12 made their first contribution in [#2930](https://github.com/Droid-Deck/DroidDeck/pull/2930).
|
||||
- @0use-TE made their first contribution in [#2976](https://github.com/Droid-Deck/DroidDeck/pull/2976).
|
||||
- @LarzVader made their first contribution in [#3101](https://github.com/Droid-Deck/DroidDeck/pull/3101).
|
||||
- @66sam made their first contribution in [Proton#24](https://github.com/Droid-Deck/DroidDeck-Proton/pull/24).
|
||||
|
||||
[Full changelog](https://github.com/Droid-Deck/DroidDeck/compare/0.7.1...0.7.11)
|
||||
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 139 KiB |
|
After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 160 KiB |
|
After Width: | Height: | Size: 140 KiB |
|
After Width: | Height: | Size: 125 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 255 KiB |
|
After Width: | Height: | Size: 157 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 142 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 141 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 109 KiB |
@@ -0,0 +1,982 @@
|
||||
diff --git a/Data/ThunksDB.json b/Data/ThunksDB.json
|
||||
index 886379a..7844b27 100644
|
||||
--- a/Data/ThunksDB.json
|
||||
+++ b/Data/ThunksDB.json
|
||||
@@ -49,6 +49,24 @@
|
||||
"@PREFIX_LIB@/libwayland-client.so.0.20.0"
|
||||
]
|
||||
},
|
||||
+ "EGL": {
|
||||
+ "Library" : "libEGL-guest.so",
|
||||
+ "Overlay": [
|
||||
+ "@PREFIX_LIB@/libEGL.so",
|
||||
+ "@PREFIX_LIB@/libEGL.so.1",
|
||||
+ "@PREFIX_LIB@/libEGL.so.1.1.0",
|
||||
+ "@PREFIX_LIB@/libGLESv2.so.2",
|
||||
+ "@PREFIX_LIB@/libGLESv2.so.2.1.0"
|
||||
+ ]
|
||||
+ },
|
||||
+ "WaylandEGL": {
|
||||
+ "Library" : "libwayland-egl-guest.so",
|
||||
+ "Overlay": [
|
||||
+ "@PREFIX_LIB@/libwayland-egl.so",
|
||||
+ "@PREFIX_LIB@/libwayland-egl.so.1",
|
||||
+ "@PREFIX_LIB@/libwayland-egl.so.1.0.0"
|
||||
+ ]
|
||||
+ },
|
||||
"cuda": {
|
||||
"Library" : "libcuda-guest.so",
|
||||
"Overlay": [
|
||||
diff --git a/ThunkLibs/GuestLibs/CMakeLists.txt b/ThunkLibs/GuestLibs/CMakeLists.txt
|
||||
index bf666d9..72b0832 100644
|
||||
--- a/ThunkLibs/GuestLibs/CMakeLists.txt
|
||||
+++ b/ThunkLibs/GuestLibs/CMakeLists.txt
|
||||
@@ -211,6 +211,21 @@ if (BITNESS EQUAL 64)
|
||||
target_include_directories_from_pkgconfig(libasound-guest-deps alsa)
|
||||
add_guest_lib(asound "libasound.so.2")
|
||||
|
||||
+ generate(libwayland-client ${CMAKE_CURRENT_SOURCE_DIR}/../libwayland-client/libwayland-client_interface.cpp)
|
||||
+ add_guest_lib(wayland-client "libwayland-client.so.0.20.0")
|
||||
+ target_include_directories_from_pkgconfig(libwayland-client-guest-deps wayland-client /usr/include/wayland)
|
||||
+
|
||||
+ generate(libwayland-egl ${CMAKE_CURRENT_SOURCE_DIR}/../libwayland-egl/libwayland-egl_interface.cpp)
|
||||
+ add_guest_lib(wayland-egl "libwayland-egl.so.1")
|
||||
+ target_include_directories_from_pkgconfig(libwayland-egl-guest-deps wayland-egl /usr/include/wayland)
|
||||
+
|
||||
+ generate(libEGL ${CMAKE_CURRENT_SOURCE_DIR}/../libEGL/libEGL_interface.cpp)
|
||||
+ target_include_directories_from_pkgconfig(libEGL-guest-deps egl)
|
||||
+ add_guest_lib(EGL "libEGL.so.1")
|
||||
+ target_link_libraries(EGL-guest PRIVATE GL-guest)
|
||||
+ target_link_libraries(EGL-guest PRIVATE PlaceholderX11)
|
||||
+ target_include_directories_from_pkgconfig(libEGL-guest-deps "xcb;x11")
|
||||
+
|
||||
# disabled for now, headers are platform specific
|
||||
# find_package(SDL2 REQUIRED)
|
||||
# generate(libSDL2)
|
||||
@@ -229,10 +244,6 @@ if (BITNESS EQUAL 64)
|
||||
add_guest_lib(drm "libdrm.so.2")
|
||||
endif()
|
||||
|
||||
-generate(libwayland-client ${CMAKE_CURRENT_SOURCE_DIR}/../libwayland-client/libwayland-client_interface.cpp)
|
||||
-add_guest_lib(wayland-client "libwayland-client.so.0.20.0")
|
||||
-target_include_directories_from_pkgconfig(libwayland-client-guest-deps wayland-client /usr/include/wayland)
|
||||
-
|
||||
generate(libVDSO ${CMAKE_CURRENT_SOURCE_DIR}/../libVDSO/libVDSO_interface.cpp)
|
||||
add_guest_lib(VDSO "linux-vdso.so.1")
|
||||
# Can't use a stack protector because otherwise cross-compiling fails
|
||||
@@ -271,11 +282,6 @@ target_include_directories_from_pkgconfig(libGL-guest-deps gl)
|
||||
target_include_directories_from_pkgconfig(libGL-guest-deps "xcb;x11;xrandr;xrender")
|
||||
add_guest_lib(GL "libGL.so.1")
|
||||
|
||||
-generate(libEGL ${CMAKE_CURRENT_SOURCE_DIR}/../libEGL/libEGL_interface.cpp)
|
||||
-target_include_directories_from_pkgconfig(libEGL-guest-deps egl)
|
||||
-add_guest_lib(EGL "libEGL.so.1")
|
||||
-target_link_libraries(EGL-guest PRIVATE GL-guest)
|
||||
-
|
||||
# libGL must pull in libX11.so, so generate a placeholder libX11.so to link against
|
||||
add_library(PlaceholderX11 SHARED ../libX11/libX11_NativeGuest.cpp)
|
||||
target_link_options(PlaceholderX11 PRIVATE "LINKER:-soname,libX11.so.6")
|
||||
diff --git a/ThunkLibs/HostLibs/CMakeLists.txt b/ThunkLibs/HostLibs/CMakeLists.txt
|
||||
index 8d18d0e..c10066f 100644
|
||||
--- a/ThunkLibs/HostLibs/CMakeLists.txt
|
||||
+++ b/ThunkLibs/HostLibs/CMakeLists.txt
|
||||
@@ -167,13 +167,19 @@ foreach(GUEST_BITNESS IN LISTS BITNESS_LIST)
|
||||
target_include_directories_from_pkgconfig(libvulkan-${GUEST_BITNESS}-deps "xcb;x11;xrandr;xrender")
|
||||
add_host_lib(vulkan ${GUEST_BITNESS})
|
||||
|
||||
- generate(libwayland-client ${CMAKE_CURRENT_SOURCE_DIR}/../libwayland-client/libwayland-client_interface.cpp ${GUEST_BITNESS})
|
||||
- add_host_lib(wayland-client ${GUEST_BITNESS})
|
||||
- target_include_directories_from_pkgconfig(libwayland-client-${GUEST_BITNESS}-deps wayland-client /usr/include/wayland)
|
||||
-
|
||||
- generate(libEGL ${CMAKE_CURRENT_SOURCE_DIR}/../libEGL/libEGL_interface.cpp ${GUEST_BITNESS})
|
||||
- target_include_directories_from_pkgconfig(libEGL-${GUEST_BITNESS}-deps egl)
|
||||
- add_host_lib(EGL ${GUEST_BITNESS})
|
||||
+ if (GUEST_BITNESS EQUAL 64)
|
||||
+ generate(libwayland-client ${CMAKE_CURRENT_SOURCE_DIR}/../libwayland-client/libwayland-client_interface.cpp ${GUEST_BITNESS})
|
||||
+ add_host_lib(wayland-client ${GUEST_BITNESS})
|
||||
+ target_include_directories_from_pkgconfig(libwayland-client-${GUEST_BITNESS}-deps wayland-client /usr/include/wayland)
|
||||
+
|
||||
+ generate(libwayland-egl ${CMAKE_CURRENT_SOURCE_DIR}/../libwayland-egl/libwayland-egl_interface.cpp ${GUEST_BITNESS})
|
||||
+ add_host_lib(wayland-egl ${GUEST_BITNESS})
|
||||
+ target_include_directories_from_pkgconfig(libwayland-egl-${GUEST_BITNESS}-deps wayland-egl /usr/include/wayland)
|
||||
+
|
||||
+ generate(libEGL ${CMAKE_CURRENT_SOURCE_DIR}/../libEGL/libEGL_interface.cpp ${GUEST_BITNESS})
|
||||
+ target_include_directories_from_pkgconfig(libEGL-${GUEST_BITNESS}-deps "egl;xcb;x11")
|
||||
+ add_host_lib(EGL ${GUEST_BITNESS})
|
||||
+ endif()
|
||||
|
||||
generate(libGL ${CMAKE_CURRENT_SOURCE_DIR}/../libGL/libGL_interface.cpp ${GUEST_BITNESS})
|
||||
target_include_directories_from_pkgconfig(libGL-${GUEST_BITNESS}-deps gl)
|
||||
diff --git a/ThunkLibs/libEGL/libEGL_Guest.cpp b/ThunkLibs/libEGL/libEGL_Guest.cpp
|
||||
index c157f00..196c7e8 100644
|
||||
--- a/ThunkLibs/libEGL/libEGL_Guest.cpp
|
||||
+++ b/ThunkLibs/libEGL/libEGL_Guest.cpp
|
||||
@@ -5,11 +5,22 @@ desc: Depends on glXGetProcAddress thunk
|
||||
$end_info$
|
||||
*/
|
||||
|
||||
+#define EGL_EGLEXT_PROTOTYPES 1
|
||||
#include <GL/glx.h>
|
||||
#include <EGL/egl.h>
|
||||
+#include <EGL/eglext.h>
|
||||
+#include <X11/Xlib.h>
|
||||
|
||||
+#ifndef _GNU_SOURCE
|
||||
+#define _GNU_SOURCE
|
||||
+#endif
|
||||
+#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
#include <cstring>
|
||||
+#include <mutex>
|
||||
+#include <set>
|
||||
+#include <string>
|
||||
+#include <string_view>
|
||||
|
||||
#include "common/Guest.h"
|
||||
|
||||
@@ -17,12 +28,128 @@ $end_info$
|
||||
|
||||
typedef void voidFunc();
|
||||
|
||||
+static void* Self() {
|
||||
+ static void* self = [] {
|
||||
+ Dl_info info {};
|
||||
+ return dladdr(reinterpret_cast<void*>(&Self), &info) && info.dli_fname ? dlopen(info.dli_fname, RTLD_LAZY | RTLD_NOLOAD) : nullptr;
|
||||
+ }();
|
||||
+ return self;
|
||||
+}
|
||||
+
|
||||
+static constexpr std::pair<std::string_view, std::string_view> ExtensionEntrypoints[] = {
|
||||
+ {"EGL_ANDROID_blob_cache", "eglSetBlobCacheFuncsANDROID"},
|
||||
+ {"EGL_ANDROID_create_native_client_buffer", "eglCreateNativeClientBufferANDROID"},
|
||||
+ {"EGL_ANDROID_get_frame_timestamps", "eglGetCompositorTimingSupportedANDROID eglGetCompositorTimingANDROID eglGetNextFrameIdANDROID eglGetFrameTimestampSupportedANDROID eglGetFrameTimestampsANDROID"},
|
||||
+ {"EGL_ANDROID_get_native_client_buffer", "eglGetNativeClientBufferANDROID"},
|
||||
+ {"EGL_ANDROID_native_fence_sync", "eglDupNativeFenceFDANDROID"},
|
||||
+ {"EGL_ANDROID_presentation_time", "eglPresentationTimeANDROID"},
|
||||
+ {"EGL_ANGLE_query_surface_pointer", "eglQuerySurfacePointerANGLE"},
|
||||
+ {"EGL_ANGLE_sync_control_rate", "eglGetMscRateANGLE"},
|
||||
+ {"EGL_EXT_client_sync", "eglClientSignalSyncEXT"},
|
||||
+ {"EGL_EXT_compositor", "eglCompositorSetContextListEXT eglCompositorSetContextAttributesEXT eglCompositorSetWindowListEXT eglCompositorSetWindowAttributesEXT eglCompositorBindTexWindowEXT eglCompositorSetSizeEXT eglCompositorSwapPolicyEXT"},
|
||||
+ {"EGL_EXT_device_base", "eglQueryDeviceAttribEXT eglQueryDeviceStringEXT eglQueryDevicesEXT eglQueryDisplayAttribEXT"},
|
||||
+ {"EGL_EXT_device_enumeration", "eglQueryDevicesEXT"},
|
||||
+ {"EGL_EXT_device_persistent_id", "eglQueryDeviceBinaryEXT"},
|
||||
+ {"EGL_EXT_device_query", "eglQueryDeviceAttribEXT eglQueryDeviceStringEXT eglQueryDisplayAttribEXT"},
|
||||
+ {"EGL_EXT_image_dma_buf_import_modifiers", "eglQueryDmaBufFormatsEXT eglQueryDmaBufModifiersEXT"},
|
||||
+ {"EGL_EXT_output_base", "eglGetOutputLayersEXT eglGetOutputPortsEXT eglOutputLayerAttribEXT eglQueryOutputLayerAttribEXT eglQueryOutputLayerStringEXT eglOutputPortAttribEXT eglQueryOutputPortAttribEXT eglQueryOutputPortStringEXT"},
|
||||
+ {"EGL_EXT_platform_base", "eglGetPlatformDisplayEXT eglCreatePlatformWindowSurfaceEXT eglCreatePlatformPixmapSurfaceEXT"},
|
||||
+ {"EGL_EXT_stream_consumer_egloutput", "eglStreamConsumerOutputEXT"},
|
||||
+ {"EGL_EXT_surface_compression", "eglQuerySupportedCompressionRatesEXT"},
|
||||
+ {"EGL_EXT_swap_buffers_with_damage", "eglSwapBuffersWithDamageEXT"},
|
||||
+ {"EGL_EXT_sync_reuse", "eglUnsignalSyncEXT"},
|
||||
+ {"EGL_HI_clientpixmap", "eglCreatePixmapSurfaceHI"},
|
||||
+ {"EGL_KHR_cl_event2", "eglCreateSync64KHR"},
|
||||
+ {"EGL_KHR_debug", "eglDebugMessageControlKHR eglQueryDebugKHR eglLabelObjectKHR"},
|
||||
+ {"EGL_KHR_display_reference", "eglQueryDisplayAttribKHR"},
|
||||
+ {"EGL_KHR_fence_sync", "eglCreateSyncKHR eglDestroySyncKHR eglClientWaitSyncKHR eglGetSyncAttribKHR"},
|
||||
+ {"EGL_KHR_image", "eglCreateImageKHR eglDestroyImageKHR"},
|
||||
+ {"EGL_KHR_image_base", "eglCreateImageKHR eglDestroyImageKHR"},
|
||||
+ {"EGL_KHR_lock_surface", "eglLockSurfaceKHR eglUnlockSurfaceKHR"},
|
||||
+ {"EGL_KHR_lock_surface3", "eglLockSurfaceKHR eglUnlockSurfaceKHR eglQuerySurface64KHR"},
|
||||
+ {"EGL_KHR_partial_update", "eglSetDamageRegionKHR"},
|
||||
+ {"EGL_KHR_reusable_sync", "eglCreateSyncKHR eglDestroySyncKHR eglClientWaitSyncKHR eglSignalSyncKHR eglGetSyncAttribKHR"},
|
||||
+ {"EGL_KHR_stream", "eglCreateStreamKHR eglDestroyStreamKHR eglStreamAttribKHR eglQueryStreamKHR eglQueryStreamu64KHR"},
|
||||
+ {"EGL_KHR_stream_attrib", "eglCreateStreamAttribKHR eglSetStreamAttribKHR eglQueryStreamAttribKHR eglStreamConsumerAcquireAttribKHR eglStreamConsumerReleaseAttribKHR"},
|
||||
+ {"EGL_KHR_stream_consumer_gltexture", "eglStreamConsumerGLTextureExternalKHR eglStreamConsumerAcquireKHR eglStreamConsumerReleaseKHR"},
|
||||
+ {"EGL_KHR_stream_cross_process_fd", "eglGetStreamFileDescriptorKHR eglCreateStreamFromFileDescriptorKHR"},
|
||||
+ {"EGL_KHR_stream_fifo", "eglQueryStreamTimeKHR"},
|
||||
+ {"EGL_KHR_stream_producer_eglsurface", "eglCreateStreamProducerSurfaceKHR"},
|
||||
+ {"EGL_KHR_swap_buffers_with_damage", "eglSwapBuffersWithDamageKHR"},
|
||||
+ {"EGL_KHR_wait_sync", "eglWaitSyncKHR"},
|
||||
+ {"EGL_MESA_drm_image", "eglCreateDRMImageMESA eglExportDRMImageMESA"},
|
||||
+ {"EGL_MESA_image_dma_buf_export", "eglExportDMABUFImageQueryMESA eglExportDMABUFImageMESA"},
|
||||
+ {"EGL_MESA_query_driver", "eglGetDisplayDriverConfig eglGetDisplayDriverName"},
|
||||
+ {"EGL_NOK_swap_region", "eglSwapBuffersRegionNOK"},
|
||||
+ {"EGL_NOK_swap_region2", "eglSwapBuffersRegion2NOK"},
|
||||
+ {"EGL_NV_native_query", "eglQueryNativeDisplayNV eglQueryNativeWindowNV eglQueryNativePixmapNV"},
|
||||
+ {"EGL_NV_post_sub_buffer", "eglPostSubBufferNV"},
|
||||
+ {"EGL_NV_stream_consumer_eglimage", "eglStreamImageConsumerConnectNV eglQueryStreamConsumerEventNV eglStreamAcquireImageNV eglStreamReleaseImageNV"},
|
||||
+ {"EGL_NV_stream_consumer_gltexture_yuv", "eglStreamConsumerGLTextureExternalAttribsNV"},
|
||||
+ {"EGL_NV_stream_flush", "eglStreamFlushNV"},
|
||||
+ {"EGL_NV_stream_metadata", "eglQueryDisplayAttribNV eglSetStreamMetadataNV eglQueryStreamMetadataNV"},
|
||||
+ {"EGL_NV_stream_reset", "eglResetStreamNV"},
|
||||
+ {"EGL_NV_stream_sync", "eglCreateStreamSyncNV"},
|
||||
+ {"EGL_NV_sync", "eglCreateFenceSyncNV eglDestroySyncNV eglFenceNV eglClientWaitSyncNV eglSignalSyncNV eglGetSyncAttribNV"},
|
||||
+ {"EGL_NV_system_time", "eglGetSystemTimeFrequencyNV eglGetSystemTimeNV"},
|
||||
+ {"EGL_WL_bind_wayland_display", "eglBindWaylandDisplayWL eglUnbindWaylandDisplayWL eglQueryWaylandBufferWL"},
|
||||
+ {"EGL_WL_create_wayland_buffer_from_image", "eglCreateWaylandBufferFromImageWL"},
|
||||
+};
|
||||
+
|
||||
+static bool GuestHasEntrypoints(std::string_view extension) {
|
||||
+ for (const auto& [name, entrypoints] : ExtensionEntrypoints) {
|
||||
+ if (name != extension) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ std::string_view rest = entrypoints;
|
||||
+ while (!rest.empty()) {
|
||||
+ auto end = rest.find(' ');
|
||||
+ if (!Self() || !dlsym(Self(), std::string {rest.substr(0, end)}.c_str())) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ rest = end == std::string_view::npos ? std::string_view {} : rest.substr(end + 1);
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ return true;
|
||||
+}
|
||||
|
||||
extern "C" {
|
||||
voidFunc* eglGetProcAddress(const char* procname) {
|
||||
- // TODO: Fix this HACK
|
||||
+ if (strncmp(procname, "egl", 3) == 0) {
|
||||
+ return Self() ? reinterpret_cast<voidFunc*>(dlsym(Self(), procname)) : nullptr;
|
||||
+ }
|
||||
return glXGetProcAddress((const GLubyte*)procname);
|
||||
}
|
||||
+
|
||||
+const char* eglQueryString(EGLDisplay display, EGLint name) {
|
||||
+ const char* result = fexfn_pack_eglQueryString(display, name);
|
||||
+ if (!result || name != EGL_EXTENSIONS) {
|
||||
+ return result;
|
||||
+ }
|
||||
+ std::string filtered;
|
||||
+ std::string_view all {result};
|
||||
+ while (!all.empty()) {
|
||||
+ auto end = all.find(' ');
|
||||
+ auto extension = all.substr(0, end);
|
||||
+ if (!extension.empty() && GuestHasEntrypoints(extension)) {
|
||||
+ if (!filtered.empty()) {
|
||||
+ filtered += ' ';
|
||||
+ }
|
||||
+ filtered += extension;
|
||||
+ }
|
||||
+ all = end == std::string_view::npos ? std::string_view {} : all.substr(end + 1);
|
||||
+ }
|
||||
+ static std::mutex mutex;
|
||||
+ static std::set<std::string> strings;
|
||||
+ std::lock_guard lock(mutex);
|
||||
+ return strings.insert(std::move(filtered)).first->c_str();
|
||||
+}
|
||||
+}
|
||||
+
|
||||
+static void OnInit() {
|
||||
+ fexfn_pack_EGL_SetGuestXSync((uintptr_t)XSync, (uintptr_t)CallbackUnpack<decltype(XSync)>::Unpack);
|
||||
+ fexfn_pack_EGL_SetGuestXDisplayString((uintptr_t)XDisplayString, (uintptr_t)CallbackUnpack<decltype(XDisplayString)>::Unpack);
|
||||
}
|
||||
|
||||
-LOAD_LIB(libEGL)
|
||||
+LOAD_LIB_INIT(libEGL, OnInit)
|
||||
diff --git a/ThunkLibs/libEGL/libEGL_Host.cpp b/ThunkLibs/libEGL/libEGL_Host.cpp
|
||||
index ac8a87e..9b154b8 100644
|
||||
--- a/ThunkLibs/libEGL/libEGL_Host.cpp
|
||||
+++ b/ThunkLibs/libEGL/libEGL_Host.cpp
|
||||
@@ -4,14 +4,163 @@ tags: thunklibs|EGL
|
||||
$end_info$
|
||||
*/
|
||||
|
||||
+#include <atomic>
|
||||
#include <cstdio>
|
||||
+#include <cstdlib>
|
||||
#include <dlfcn.h>
|
||||
+#include <mutex>
|
||||
+#include <string_view>
|
||||
+#include <unordered_map>
|
||||
|
||||
+#define EGL_EGLEXT_PROTOTYPES 1
|
||||
#include <EGL/egl.h>
|
||||
+#include <EGL/eglext.h>
|
||||
|
||||
#include "common/Host.h"
|
||||
-#include <dlfcn.h>
|
||||
+#include <X11/Xutil.h>
|
||||
+#include "common/X11Manager.h"
|
||||
+
|
||||
+static X11Manager x11_manager;
|
||||
+static std::mutex x11_displays_mutex;
|
||||
+static std::unordered_map<EGLDisplay, _XDisplay*> x11_displays;
|
||||
+
|
||||
+static void* fex_egl_get_proc_address(void* so, const char* name) {
|
||||
+ static auto get_proc_address = reinterpret_cast<void* (*)(const char*)>(dlsym(so, "eglGetProcAddress"));
|
||||
+ return get_proc_address ? get_proc_address(name) : nullptr;
|
||||
+}
|
||||
+
|
||||
+static void fexfn_impl_libEGL_EGL_SetGuestXSync(uintptr_t GuestTarget, uintptr_t GuestUnpacker) {
|
||||
+ MakeHostTrampolineForGuestFunctionAt(GuestTarget, GuestUnpacker, &x11_manager.GuestXSync);
|
||||
+}
|
||||
+
|
||||
+static void fexfn_impl_libEGL_EGL_SetGuestXDisplayString(uintptr_t GuestTarget, uintptr_t GuestUnpacker) {
|
||||
+ MakeHostTrampolineForGuestFunctionAt(GuestTarget, GuestUnpacker, &x11_manager.GuestXDisplayString);
|
||||
+}
|
||||
|
||||
#include "thunkgen_host_libEGL.inl"
|
||||
|
||||
+static bool IsWaylandDisplay(void* native) {
|
||||
+ static std::atomic<void*> cached_interface {nullptr};
|
||||
+ void* wl_display_interface = cached_interface.load(std::memory_order_acquire);
|
||||
+ if (!wl_display_interface) {
|
||||
+ if (void* so = dlopen("libwayland-client.so.0", RTLD_LAZY | RTLD_NOLOAD)) {
|
||||
+ wl_display_interface = dlsym(so, "wl_display_interface");
|
||||
+ dlclose(so);
|
||||
+ cached_interface.store(wl_display_interface, std::memory_order_release);
|
||||
+ }
|
||||
+ }
|
||||
+ return wl_display_interface && *reinterpret_cast<void**>(native) == wl_display_interface;
|
||||
+}
|
||||
+
|
||||
+static std::string_view EnvPlatform() {
|
||||
+ const char* name = getenv("EGL_PLATFORM");
|
||||
+ if (!name || !*name) {
|
||||
+ name = getenv("EGL_DISPLAY");
|
||||
+ }
|
||||
+ return name ? std::string_view {name} : std::string_view {};
|
||||
+}
|
||||
+
|
||||
+static void* HostNativeDisplay(EGLenum platform, void* native, _XDisplay** guest_x11) {
|
||||
+ if (!native) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ switch (platform) {
|
||||
+ case EGL_PLATFORM_X11_KHR: break;
|
||||
+#ifdef EGL_PLATFORM_XCB_EXT
|
||||
+ case EGL_PLATFORM_XCB_EXT: return x11_manager.GuestToHostConnection(static_cast<xcb_connection_t*>(native));
|
||||
+#endif
|
||||
+ case 0:
|
||||
+ if (auto env = EnvPlatform(); !env.empty()) {
|
||||
+ if (env == "xcb") {
|
||||
+ return x11_manager.GuestToHostConnection(static_cast<xcb_connection_t*>(native));
|
||||
+ }
|
||||
+ if (env != "x11") {
|
||||
+ return native;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ if (IsWaylandDisplay(native)) {
|
||||
+ return native;
|
||||
+ }
|
||||
+ break;
|
||||
+ default: return native;
|
||||
+ }
|
||||
+ *guest_x11 = static_cast<_XDisplay*>(native);
|
||||
+ return x11_manager.GuestToHostDisplay(*guest_x11);
|
||||
+}
|
||||
+
|
||||
+static EGLDisplay TrackDisplay(EGLDisplay display, _XDisplay* guest_x11) {
|
||||
+ if (display != EGL_NO_DISPLAY && guest_x11) {
|
||||
+ std::lock_guard lock(x11_displays_mutex);
|
||||
+ x11_displays[display] = guest_x11;
|
||||
+ }
|
||||
+ return display;
|
||||
+}
|
||||
+
|
||||
+static void SyncGuestDisplay(EGLDisplay display) {
|
||||
+ _XDisplay* guest_x11 = nullptr;
|
||||
+ {
|
||||
+ std::lock_guard lock(x11_displays_mutex);
|
||||
+ if (auto it = x11_displays.find(display); it != x11_displays.end()) {
|
||||
+ guest_x11 = it->second;
|
||||
+ }
|
||||
+ }
|
||||
+ if (guest_x11) {
|
||||
+ x11_manager.GuestXSync(guest_x11, 0);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+EGLDisplay fexfn_impl_libEGL_eglGetDisplay(guest_layout<EGLNativeDisplayType> native) {
|
||||
+ _XDisplay* guest_x11 = nullptr;
|
||||
+ auto host = HostNativeDisplay(0, native.force_get_host_pointer(), &guest_x11);
|
||||
+ return TrackDisplay(fexldr_ptr_libEGL_eglGetDisplay(static_cast<EGLNativeDisplayType>(host)), guest_x11);
|
||||
+}
|
||||
+
|
||||
+EGLDisplay fexfn_impl_libEGL_eglGetPlatformDisplay(EGLenum platform, void* native, const EGLAttrib* attribs) {
|
||||
+ _XDisplay* guest_x11 = nullptr;
|
||||
+ auto host = HostNativeDisplay(platform, native, &guest_x11);
|
||||
+ return TrackDisplay(fexldr_ptr_libEGL_eglGetPlatformDisplay(platform, host, attribs), guest_x11);
|
||||
+}
|
||||
+
|
||||
+EGLDisplay fexfn_impl_libEGL_eglGetPlatformDisplayEXT(EGLenum platform, void* native, const EGLint* attribs) {
|
||||
+ _XDisplay* guest_x11 = nullptr;
|
||||
+ auto host = HostNativeDisplay(platform, native, &guest_x11);
|
||||
+ return TrackDisplay(fexldr_ptr_libEGL_eglGetPlatformDisplayEXT(platform, host, attribs), guest_x11);
|
||||
+}
|
||||
+
|
||||
+EGLSurface fexfn_impl_libEGL_eglCreateWindowSurface(EGLDisplay display, EGLConfig config, EGLNativeWindowType window, const EGLint* attribs) {
|
||||
+ SyncGuestDisplay(display);
|
||||
+ return fexldr_ptr_libEGL_eglCreateWindowSurface(display, config, window, attribs);
|
||||
+}
|
||||
+
|
||||
+EGLSurface fexfn_impl_libEGL_eglCreatePixmapSurface(EGLDisplay display, EGLConfig config, EGLNativePixmapType pixmap, const EGLint* attribs) {
|
||||
+ SyncGuestDisplay(display);
|
||||
+ return fexldr_ptr_libEGL_eglCreatePixmapSurface(display, config, pixmap, attribs);
|
||||
+}
|
||||
+
|
||||
+EGLSurface fexfn_impl_libEGL_eglCreatePlatformWindowSurface(EGLDisplay display, EGLConfig config, void* window, const EGLAttrib* attribs) {
|
||||
+ SyncGuestDisplay(display);
|
||||
+ return fexldr_ptr_libEGL_eglCreatePlatformWindowSurface(display, config, window, attribs);
|
||||
+}
|
||||
+
|
||||
+EGLSurface fexfn_impl_libEGL_eglCreatePlatformPixmapSurface(EGLDisplay display, EGLConfig config, void* pixmap, const EGLAttrib* attribs) {
|
||||
+ SyncGuestDisplay(display);
|
||||
+ return fexldr_ptr_libEGL_eglCreatePlatformPixmapSurface(display, config, pixmap, attribs);
|
||||
+}
|
||||
+
|
||||
+EGLSurface fexfn_impl_libEGL_eglCreatePlatformWindowSurfaceEXT(EGLDisplay display, EGLConfig config, void* window, const EGLint* attribs) {
|
||||
+ SyncGuestDisplay(display);
|
||||
+ return fexldr_ptr_libEGL_eglCreatePlatformWindowSurfaceEXT(display, config, window, attribs);
|
||||
+}
|
||||
+
|
||||
+EGLSurface fexfn_impl_libEGL_eglCreatePlatformPixmapSurfaceEXT(EGLDisplay display, EGLConfig config, void* pixmap, const EGLint* attribs) {
|
||||
+ SyncGuestDisplay(display);
|
||||
+ return fexldr_ptr_libEGL_eglCreatePlatformPixmapSurfaceEXT(display, config, pixmap, attribs);
|
||||
+}
|
||||
+
|
||||
+EGLBoolean fexfn_impl_libEGL_eglCopyBuffers(EGLDisplay display, EGLSurface surface, EGLNativePixmapType pixmap) {
|
||||
+ SyncGuestDisplay(display);
|
||||
+ return fexldr_ptr_libEGL_eglCopyBuffers(display, surface, pixmap);
|
||||
+}
|
||||
+
|
||||
EXPORTS(libEGL)
|
||||
diff --git a/ThunkLibs/libEGL/libEGL_interface.cpp b/ThunkLibs/libEGL/libEGL_interface.cpp
|
||||
index 27de16d..19f8b86 100644
|
||||
--- a/ThunkLibs/libEGL/libEGL_interface.cpp
|
||||
+++ b/ThunkLibs/libEGL/libEGL_interface.cpp
|
||||
@@ -1,51 +1,170 @@
|
||||
#include <common/GeneratorInterface.h>
|
||||
|
||||
+#define EGL_EGLEXT_PROTOTYPES 1
|
||||
#include <EGL/egl.h>
|
||||
+#include <EGL/eglext.h>
|
||||
+#include <X11/Xlib.h>
|
||||
|
||||
template<auto>
|
||||
struct fex_gen_config {
|
||||
unsigned version = 1;
|
||||
};
|
||||
|
||||
-// Function, parameter index, parameter type [optional]
|
||||
template<auto, int, typename = void>
|
||||
struct fex_gen_param {};
|
||||
|
||||
+template<typename>
|
||||
+struct fex_gen_type {};
|
||||
+
|
||||
+template<>
|
||||
+struct fex_gen_type<void> : fexgen::opaque_type {};
|
||||
+template<>
|
||||
+struct fex_gen_type<_XDisplay> : fexgen::opaque_type {};
|
||||
+
|
||||
+void EGL_SetGuestXSync(uintptr_t, uintptr_t);
|
||||
+void EGL_SetGuestXDisplayString(uintptr_t, uintptr_t);
|
||||
+template<>
|
||||
+struct fex_gen_config<EGL_SetGuestXSync> : fexgen::custom_guest_entrypoint, fexgen::custom_host_impl {};
|
||||
+template<>
|
||||
+struct fex_gen_config<EGL_SetGuestXDisplayString> : fexgen::custom_guest_entrypoint, fexgen::custom_host_impl {};
|
||||
+
|
||||
template<>
|
||||
struct fex_gen_config<eglBindAPI> {};
|
||||
template<>
|
||||
+struct fex_gen_config<eglBindTexImage> {};
|
||||
+template<>
|
||||
struct fex_gen_config<eglChooseConfig> {};
|
||||
template<>
|
||||
+struct fex_gen_config<eglClientWaitSync> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreateContext> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreateImage> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreatePbufferFromClientBuffer> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreatePbufferSurface> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreateSync> {};
|
||||
+template<>
|
||||
struct fex_gen_config<eglDestroyContext> {};
|
||||
template<>
|
||||
+struct fex_gen_config<eglDestroyImage> {};
|
||||
+template<>
|
||||
struct fex_gen_config<eglDestroySurface> {};
|
||||
template<>
|
||||
+struct fex_gen_config<eglDestroySync> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglGetConfigAttrib> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglGetConfigs> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglGetCurrentContext> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglGetCurrentDisplay> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglGetCurrentSurface> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglGetError> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglGetSyncAttrib> {};
|
||||
+template<>
|
||||
struct fex_gen_config<eglInitialize> {};
|
||||
template<>
|
||||
struct fex_gen_config<eglMakeCurrent> {};
|
||||
template<>
|
||||
+struct fex_gen_config<eglQueryAPI> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglQueryContext> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglQueryString> : fexgen::custom_guest_entrypoint {};
|
||||
+template<>
|
||||
struct fex_gen_config<eglQuerySurface> {};
|
||||
template<>
|
||||
+struct fex_gen_config<eglReleaseTexImage> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglReleaseThread> {};
|
||||
+template<>
|
||||
struct fex_gen_config<eglSurfaceAttrib> {};
|
||||
template<>
|
||||
struct fex_gen_config<eglSwapBuffers> {};
|
||||
template<>
|
||||
+struct fex_gen_config<eglSwapInterval> {};
|
||||
+template<>
|
||||
struct fex_gen_config<eglTerminate> {};
|
||||
template<>
|
||||
-struct fex_gen_config<eglGetError> {};
|
||||
+struct fex_gen_config<eglWaitClient> {};
|
||||
template<>
|
||||
-struct fex_gen_config<eglCreateContext> {};
|
||||
+struct fex_gen_config<eglWaitGL> {};
|
||||
template<>
|
||||
-struct fex_gen_config<eglCreateWindowSurface> {};
|
||||
+struct fex_gen_config<eglWaitNative> {};
|
||||
template<>
|
||||
-struct fex_gen_config<eglGetCurrentContext> {};
|
||||
+struct fex_gen_config<eglWaitSync> {};
|
||||
template<>
|
||||
-struct fex_gen_config<eglGetCurrentDisplay> {};
|
||||
+struct fex_gen_config<eglGetDisplay> : fexgen::custom_host_impl {};
|
||||
template<>
|
||||
-struct fex_gen_config<eglGetCurrentSurface> {};
|
||||
+struct fex_gen_config<eglGetPlatformDisplay> : fexgen::custom_host_impl {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreateWindowSurface> : fexgen::custom_host_impl {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreatePixmapSurface> : fexgen::custom_host_impl {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreatePlatformWindowSurface> : fexgen::custom_host_impl {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreatePlatformPixmapSurface> : fexgen::custom_host_impl {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCopyBuffers> : fexgen::custom_host_impl {};
|
||||
+template<>
|
||||
+struct fex_gen_param<eglGetDisplay, 0, EGLNativeDisplayType> : fexgen::ptr_passthrough {};
|
||||
+
|
||||
+namespace ext {
|
||||
+template<auto>
|
||||
+struct fex_gen_config {
|
||||
+ const char* load_host_endpoint_via = "fex_egl_get_proc_address";
|
||||
+};
|
||||
|
||||
-// EGLNativeDisplayType is a pointer to opaque data (wl_display/(X)Display/...)
|
||||
template<>
|
||||
-struct fex_gen_config<eglGetDisplay> {};
|
||||
+struct fex_gen_config<eglSwapBuffersWithDamageKHR> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglSwapBuffersWithDamageEXT> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglSetDamageRegionKHR> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreateImageKHR> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglDestroyImageKHR> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreateSyncKHR> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglDestroySyncKHR> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglClientWaitSyncKHR> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglGetSyncAttribKHR> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglWaitSyncKHR> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglDupNativeFenceFDANDROID> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglQueryDmaBufFormatsEXT> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglQueryDmaBufModifiersEXT> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglExportDMABUFImageMESA> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglExportDMABUFImageQueryMESA> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglQueryDisplayAttribEXT> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglQueryDeviceStringEXT> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglQueryDeviceAttribEXT> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglQueryDevicesEXT> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglGetPlatformDisplayEXT> : fexgen::custom_host_impl {};
|
||||
+template<>
|
||||
+struct fex_gen_config<eglCreatePlatformWindowSurfaceEXT> : fexgen::custom_host_impl {};
|
||||
template<>
|
||||
-struct fex_gen_param<eglGetDisplay, 0, EGLNativeDisplayType> : fexgen::assume_compatible_data_layout {};
|
||||
+struct fex_gen_config<eglCreatePlatformPixmapSurfaceEXT> : fexgen::custom_host_impl {};
|
||||
+}
|
||||
diff --git a/ThunkLibs/libwayland-client/Guest.cpp b/ThunkLibs/libwayland-client/Guest.cpp
|
||||
index 2f887a6..8fa6476 100644
|
||||
--- a/ThunkLibs/libwayland-client/Guest.cpp
|
||||
+++ b/ThunkLibs/libwayland-client/Guest.cpp
|
||||
@@ -42,8 +42,11 @@ extern "C" const wl_interface wl_subsurface_interface {};
|
||||
#include <charconv>
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
+#include <cstdint>
|
||||
+#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
+#include <utility>
|
||||
|
||||
#include "common/Guest.h"
|
||||
|
||||
@@ -92,18 +95,39 @@ static uint64_t WaylandAllocateHostTrampolineForGuestListener(void (*callback)()
|
||||
}
|
||||
|
||||
#define WL_CLOSURE_MAX_ARGS 20
|
||||
+#define WAYLAND_UNIFORM_MAX_ARGS 17
|
||||
+
|
||||
+template<std::size_t... I>
|
||||
+static uint64_t WaylandAllocateUniformHostTrampoline(void (*callback)(), std::index_sequence<I...>) {
|
||||
+ using cb = void(void*, wl_proxy*, std::conditional_t<true, uintptr_t, std::integral_constant<std::size_t, I>>...);
|
||||
+ return (uint64_t)(uintptr_t)(void*)AllocateHostTrampolineForGuestFunction((cb*)callback);
|
||||
+}
|
||||
+
|
||||
+template<std::size_t... Counts>
|
||||
+static uint64_t WaylandAllocateUniformHostTrampoline(void (*callback)(), std::size_t count, std::index_sequence<Counts...>) {
|
||||
+ using allocator = uint64_t (*)(void (*)());
|
||||
+ static constexpr allocator allocators[] = {
|
||||
+ [](void (*cb)()) { return WaylandAllocateUniformHostTrampoline(cb, std::make_index_sequence<Counts> {}); }...};
|
||||
+ return allocators[count](callback);
|
||||
+}
|
||||
|
||||
extern "C" int wl_proxy_add_listener(wl_proxy* proxy, void (**callback)(void), void* data) {
|
||||
// Replace guest-provided callback table with host-callable function pointers
|
||||
// NOTE: A reference to this table is stored in the wl_proxy, so the data
|
||||
// must remain valid until the proxy is destroyed (or another listener
|
||||
// is added)
|
||||
- delete[] (uint64_t*)wl_proxy_get_listener(proxy); // Delete previous substitute, if any
|
||||
- auto host_callbacks = new uint64_t[WL_CLOSURE_MAX_ARGS];
|
||||
+ if (wl_proxy_get_listener(proxy)) {
|
||||
+ fprintf(stderr, "proxy %p already has listener\n", proxy);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ auto host_callbacks = new uint64_t[std::max(fex_wl_get_interface_event_count(proxy), WL_CLOSURE_MAX_ARGS)];
|
||||
|
||||
for (int i = 0; i < fex_wl_get_interface_event_count(proxy); ++i) {
|
||||
- char event_signature[16];
|
||||
- fex_wl_get_interface_event_signature(proxy, i, event_signature);
|
||||
+ char event_signature[64];
|
||||
+ if (fex_wl_get_interface_event_signature(proxy, i, event_signature, sizeof(event_signature)) >= sizeof(event_signature)) {
|
||||
+ fprintf(stderr, "TODO: Unknown wayland event signature descriptor %s\n", event_signature);
|
||||
+ std::abort();
|
||||
+ }
|
||||
auto signature2 = std::string_view {event_signature};
|
||||
|
||||
// A leading number indicates the minimum protocol version
|
||||
@@ -227,13 +251,19 @@ extern "C" int wl_proxy_add_listener(wl_proxy* proxy, void (**callback)(void), v
|
||||
} else if (signature == "sii") {
|
||||
// E.g. zwp_text_input_v3::preedit_string
|
||||
host_callbacks[i] = WaylandAllocateHostTrampolineForGuestListener<'s', 'i', 'i'>(callback[i]);
|
||||
+ } else if (signature.size() <= WAYLAND_UNIFORM_MAX_ARGS) {
|
||||
+ host_callbacks[i] = WaylandAllocateUniformHostTrampoline(callback[i], signature.size(), std::make_index_sequence<WAYLAND_UNIFORM_MAX_ARGS + 1> {});
|
||||
} else {
|
||||
fprintf(stderr, "TODO: Unknown wayland event signature descriptor %s\n", signature.data());
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
|
||||
- return fexfn_pack_wl_proxy_add_listener(proxy, (void (**)())host_callbacks, data);
|
||||
+ int result = fexfn_pack_wl_proxy_add_listener(proxy, (void (**)())host_callbacks, data);
|
||||
+ if (result != 0) {
|
||||
+ delete[] host_callbacks;
|
||||
+ }
|
||||
+ return result;
|
||||
}
|
||||
|
||||
extern "C" void wl_proxy_destroy(wl_proxy* proxy) {
|
||||
@@ -353,6 +383,92 @@ extern "C" void wl_log_set_handler_client(wl_log_func_t handler) {
|
||||
// Ignore
|
||||
}
|
||||
|
||||
+extern "C" void wl_list_init(wl_list* list) {
|
||||
+ list->prev = list;
|
||||
+ list->next = list;
|
||||
+}
|
||||
+
|
||||
+extern "C" void wl_list_insert(wl_list* list, wl_list* elm) {
|
||||
+ elm->prev = list;
|
||||
+ elm->next = list->next;
|
||||
+ list->next = elm;
|
||||
+ elm->next->prev = elm;
|
||||
+}
|
||||
+
|
||||
+extern "C" void wl_list_remove(wl_list* elm) {
|
||||
+ elm->prev->next = elm->next;
|
||||
+ elm->next->prev = elm->prev;
|
||||
+ elm->next = nullptr;
|
||||
+ elm->prev = nullptr;
|
||||
+}
|
||||
+
|
||||
+extern "C" int wl_list_length(const wl_list* list) {
|
||||
+ int count = 0;
|
||||
+ for (auto e = list->next; e != list; e = e->next) {
|
||||
+ ++count;
|
||||
+ }
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+extern "C" int wl_list_empty(const wl_list* list) {
|
||||
+ return list->next == list;
|
||||
+}
|
||||
+
|
||||
+extern "C" void wl_list_insert_list(wl_list* list, wl_list* other) {
|
||||
+ if (wl_list_empty(other)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ other->next->prev = list;
|
||||
+ other->prev->next = list->next;
|
||||
+ list->next->prev = other->prev;
|
||||
+ list->next = other->next;
|
||||
+}
|
||||
+
|
||||
+extern "C" void wl_array_init(wl_array* array) {
|
||||
+ memset(array, 0, sizeof(*array));
|
||||
+}
|
||||
+
|
||||
+extern "C" void wl_array_release(wl_array* array) {
|
||||
+ free(array->data);
|
||||
+ array->data = (void*)4;
|
||||
+}
|
||||
+
|
||||
+extern "C" void* wl_array_add(wl_array* array, size_t size) {
|
||||
+ if (size > SIZE_MAX - array->size) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ size_t needed = array->size + size;
|
||||
+ size_t alloc = array->alloc > 0 ? array->alloc : 16;
|
||||
+ while (alloc < needed) {
|
||||
+ alloc = alloc > SIZE_MAX / 2 ? needed : alloc * 2;
|
||||
+ }
|
||||
+ if (array->alloc < alloc) {
|
||||
+ void* data = array->alloc > 0 ? realloc(array->data, alloc) : malloc(alloc);
|
||||
+ if (!data) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ array->data = data;
|
||||
+ array->alloc = alloc;
|
||||
+ }
|
||||
+ void* p = (char*)array->data + array->size;
|
||||
+ array->size += size;
|
||||
+ return p;
|
||||
+}
|
||||
+
|
||||
+extern "C" int wl_array_copy(wl_array* array, wl_array* source) {
|
||||
+ if (array->size < source->size) {
|
||||
+ if (!wl_array_add(array, source->size - array->size)) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ } else {
|
||||
+ array->size = source->size;
|
||||
+ }
|
||||
+ if (source->size > 0) {
|
||||
+ memcpy(array->data, source->data, source->size);
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
|
||||
void OnInit() {
|
||||
fex_wl_exchange_interface_pointer(const_cast<wl_interface*>(&wl_output_interface), "wl_output_interface");
|
||||
diff --git a/ThunkLibs/libwayland-client/Host.cpp b/ThunkLibs/libwayland-client/Host.cpp
|
||||
index 68c2ded..25f964c 100644
|
||||
--- a/ThunkLibs/libwayland-client/Host.cpp
|
||||
+++ b/ThunkLibs/libwayland-client/Host.cpp
|
||||
@@ -22,6 +22,7 @@ $end_info$
|
||||
#include <map>
|
||||
#include <span>
|
||||
#include <string>
|
||||
+#include <utility>
|
||||
|
||||
#include <ranges>
|
||||
|
||||
@@ -166,6 +167,7 @@ static wl_proxy* fexfn_impl_libwayland_client_wl_proxy_create(wl_proxy* proxy, g
|
||||
}
|
||||
|
||||
#define WL_CLOSURE_MAX_ARGS 20
|
||||
+#define WAYLAND_UNIFORM_MAX_ARGS 17
|
||||
static auto fex_wl_remap_argument_list(guest_layout<wl_argument*> args, const wl_message& message) {
|
||||
#ifndef IS_32BIT_THUNK
|
||||
// Cast to host layout and return as std::span
|
||||
@@ -309,6 +311,21 @@ static void WaylandFinalizeHostTrampolineForGuestListener(void (*callback)()) {
|
||||
FinalizeHostTrampolineForGuestFunction((cb*)callback);
|
||||
}
|
||||
|
||||
+
|
||||
+template<std::size_t... I>
|
||||
+static void WaylandFinalizeUniformHostTrampoline(void (*callback)(), std::index_sequence<I...>) {
|
||||
+ using cb = void(void*, wl_proxy*, std::conditional_t<true, uint64_t, std::integral_constant<std::size_t, I>>...);
|
||||
+ FinalizeHostTrampolineForGuestFunction((cb*)callback);
|
||||
+}
|
||||
+
|
||||
+template<std::size_t... Counts>
|
||||
+static void WaylandFinalizeUniformHostTrampoline(void (*callback)(), std::size_t count, std::index_sequence<Counts...>) {
|
||||
+ using finalizer = void (*)(void (*)());
|
||||
+ static constexpr finalizer finalizers[] = {
|
||||
+ [](void (*cb)()) { WaylandFinalizeUniformHostTrampoline(cb, std::make_index_sequence<Counts> {}); }...};
|
||||
+ finalizers[count](callback);
|
||||
+}
|
||||
+
|
||||
extern "C" int
|
||||
fexfn_impl_libwayland_client_wl_proxy_add_listener(struct wl_proxy* proxy, guest_layout<void (**)(void)> callback_table_raw, void* data) {
|
||||
auto interface = get_proxy_interface(proxy);
|
||||
@@ -446,6 +463,8 @@ fexfn_impl_libwayland_client_wl_proxy_add_listener(struct wl_proxy* proxy, guest
|
||||
WaylandFinalizeHostTrampolineForGuestListener<'s', 'i', 'i'>(callback);
|
||||
} else if (signature == "ss") {
|
||||
WaylandFinalizeHostTrampolineForGuestListener<'s', 's'>(callback);
|
||||
+ } else if (signature.size() <= WAYLAND_UNIFORM_MAX_ARGS) {
|
||||
+ WaylandFinalizeUniformHostTrampoline(callback, signature.size(), std::make_index_sequence<WAYLAND_UNIFORM_MAX_ARGS + 1> {});
|
||||
} else {
|
||||
fprintf(stderr, "TODO: Unknown wayland event signature descriptor %s\n", signature.data());
|
||||
std::abort();
|
||||
@@ -514,8 +533,35 @@ void fexfn_impl_libwayland_client_fex_wl_get_interface_event_name(wl_proxy* prox
|
||||
strcpy(out, get_proxy_interface(proxy)->events[i].name);
|
||||
}
|
||||
|
||||
-void fexfn_impl_libwayland_client_fex_wl_get_interface_event_signature(wl_proxy* proxy, int i, char* out) {
|
||||
- strcpy(out, get_proxy_interface(proxy)->events[i].signature);
|
||||
+size_t fexfn_impl_libwayland_client_fex_wl_get_interface_event_signature(wl_proxy* proxy, int i, char* out, size_t size) {
|
||||
+ const char* signature = get_proxy_interface(proxy)->events[i].signature;
|
||||
+ size_t length = strlen(signature);
|
||||
+ if (size > 0) {
|
||||
+ size_t copied = std::min(length, size - 1);
|
||||
+ memcpy(out, signature, copied);
|
||||
+ out[copied] = '\0';
|
||||
+ }
|
||||
+ return length;
|
||||
+}
|
||||
+
|
||||
+uint32_t fexfn_impl_libwayland_client_wl_display_get_protocol_error(wl_display* display, guest_layout<const wl_interface**> guest_interface,
|
||||
+ uint32_t* id) {
|
||||
+ const wl_interface* host_interface = nullptr;
|
||||
+ auto code = fexldr_ptr_libwayland_client_wl_display_get_protocol_error(display, &host_interface, id);
|
||||
+ if (!guest_interface.force_get_host_pointer()) {
|
||||
+ return code;
|
||||
+ }
|
||||
+ uintptr_t result = 0;
|
||||
+ for (auto& [guest, host] : guest_to_host_interface) {
|
||||
+ if (host == host_interface) {
|
||||
+ result = reinterpret_cast<uintptr_t>(guest);
|
||||
+ }
|
||||
+ }
|
||||
+ if (!result) {
|
||||
+ result = reinterpret_cast<uintptr_t>(host_interface);
|
||||
+ }
|
||||
+ guest_interface.get_pointer()->data = result;
|
||||
+ return code;
|
||||
}
|
||||
|
||||
EXPORTS(libwayland_client)
|
||||
diff --git a/ThunkLibs/libwayland-client/libwayland-client_interface.cpp b/ThunkLibs/libwayland-client/libwayland-client_interface.cpp
|
||||
index 575d2e1..9723a3c 100644
|
||||
--- a/ThunkLibs/libwayland-client/libwayland-client_interface.cpp
|
||||
+++ b/ThunkLibs/libwayland-client/libwayland-client_interface.cpp
|
||||
@@ -83,6 +83,16 @@ struct fex_gen_config<wl_display_get_fd> {};
|
||||
|
||||
template<>
|
||||
struct fex_gen_config<wl_event_queue_destroy> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<wl_event_queue_get_name> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<wl_display_create_queue_with_name> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<wl_display_set_max_buffer_size> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<wl_display_get_protocol_error> : fexgen::custom_host_impl {};
|
||||
+template<>
|
||||
+struct fex_gen_param<wl_display_get_protocol_error, 1, const wl_interface**> : fexgen::ptr_passthrough {};
|
||||
|
||||
template<>
|
||||
struct fex_gen_config<wl_proxy_add_listener> : fexgen::custom_host_impl, fexgen::custom_guest_entrypoint {};
|
||||
@@ -101,6 +111,10 @@ struct fex_gen_config<wl_proxy_create_wrapper> {};
|
||||
template<>
|
||||
struct fex_gen_config<wl_proxy_get_class> {};
|
||||
template<>
|
||||
+struct fex_gen_config<wl_proxy_get_display> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<wl_proxy_get_queue> {};
|
||||
+template<>
|
||||
struct fex_gen_config<wl_proxy_get_id> {};
|
||||
template<>
|
||||
struct fex_gen_config<wl_proxy_get_listener> {};
|
||||
@@ -164,6 +178,6 @@ struct fex_gen_config<fex_wl_get_interface_event_count> : fexgen::custom_host_im
|
||||
void fex_wl_get_interface_event_name(wl_proxy*, int, char*);
|
||||
template<>
|
||||
struct fex_gen_config<fex_wl_get_interface_event_name> : fexgen::custom_host_impl {};
|
||||
-void fex_wl_get_interface_event_signature(wl_proxy*, int, char*);
|
||||
+size_t fex_wl_get_interface_event_signature(wl_proxy*, int, char*, size_t);
|
||||
template<>
|
||||
struct fex_gen_config<fex_wl_get_interface_event_signature> : fexgen::custom_host_impl {};
|
||||
diff --git a/ThunkLibs/libwayland-egl/Guest.cpp b/ThunkLibs/libwayland-egl/Guest.cpp
|
||||
new file mode 100644
|
||||
index 0000000..300a8fc
|
||||
--- /dev/null
|
||||
+++ b/ThunkLibs/libwayland-egl/Guest.cpp
|
||||
@@ -0,0 +1,7 @@
|
||||
+#include <wayland-egl.h>
|
||||
+
|
||||
+#include "common/Guest.h"
|
||||
+
|
||||
+#include "thunkgen_guest_libwayland-egl.inl"
|
||||
+
|
||||
+LOAD_LIB(libwayland-egl)
|
||||
diff --git a/ThunkLibs/libwayland-egl/Host.cpp b/ThunkLibs/libwayland-egl/Host.cpp
|
||||
new file mode 100644
|
||||
index 0000000..81ad83b
|
||||
--- /dev/null
|
||||
+++ b/ThunkLibs/libwayland-egl/Host.cpp
|
||||
@@ -0,0 +1,8 @@
|
||||
+#include <wayland-egl.h>
|
||||
+
|
||||
+#include "common/Host.h"
|
||||
+#include <dlfcn.h>
|
||||
+
|
||||
+#include "thunkgen_host_libwayland-egl.inl"
|
||||
+
|
||||
+EXPORTS(libwayland_egl)
|
||||
diff --git a/ThunkLibs/libwayland-egl/libwayland-egl_interface.cpp b/ThunkLibs/libwayland-egl/libwayland-egl_interface.cpp
|
||||
new file mode 100644
|
||||
index 0000000..bc5d743
|
||||
--- /dev/null
|
||||
+++ b/ThunkLibs/libwayland-egl/libwayland-egl_interface.cpp
|
||||
@@ -0,0 +1,25 @@
|
||||
+#include <common/GeneratorInterface.h>
|
||||
+
|
||||
+#include <wayland-egl.h>
|
||||
+
|
||||
+template<auto>
|
||||
+struct fex_gen_config {
|
||||
+ unsigned version = 1;
|
||||
+};
|
||||
+
|
||||
+template<typename>
|
||||
+struct fex_gen_type {};
|
||||
+
|
||||
+template<>
|
||||
+struct fex_gen_type<wl_egl_window> : fexgen::opaque_type {};
|
||||
+template<>
|
||||
+struct fex_gen_type<wl_surface> : fexgen::opaque_type {};
|
||||
+
|
||||
+template<>
|
||||
+struct fex_gen_config<wl_egl_window_create> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<wl_egl_window_destroy> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<wl_egl_window_resize> {};
|
||||
+template<>
|
||||
+struct fex_gen_config<wl_egl_window_get_attached_size> {};
|
||||
@@ -425,3 +425,22 @@ at a pointer that never left the top-left corner. Steam picks Disabled for some
|
||||
cursor followed the mouse while every click landed at (0,0). In Disabled the nested pointer now warps the X pointer as
|
||||
in the other modes; real fingers are still ignored. `tools/tests/test_gamescope_disabled_touch_mouse.py` compiles the
|
||||
branch from this patch.
|
||||
|
||||
## 0142 Steam is entered at the corner it is reset to
|
||||
|
||||
When Steam's window takes focus with `bResetToCorner`, gamescope parks the pointer in its bottom-right corner so
|
||||
nothing in Big Picture is hovered and the controller owns the UI. Upstream fe7f21c (3.16.24) moved
|
||||
`wlserver_mousefocus` ahead of that reset, so the window is first entered under the current pointer, then warped to
|
||||
its centre (`wlserver_mousewarp`, synthetic), then moved to the corner. SteamOS's 3.16.23 still resets before focus,
|
||||
so its motions reach no window and the X pointer stays at (0,0). On upstream 3.16.29 they reach Steam: on a Steam Deck
|
||||
the pointer is at (1279,799) right after focus. The Deck shows no hover because Big Picture's page exists about 1 s
|
||||
before the reset. On a Retroid Pocket Duo the page is created at the same moment, Chromium keeps the centre position
|
||||
as its hover, and the second library tile stayed highlighted on every start (4 of 4).
|
||||
|
||||
Steam is now entered at the corner. The centre is still stored in `mouse_surface_cursorx/y`, so the gamepad cursor
|
||||
starts there as before, but no motion is sent for it. The fake pointer position stays in the corner. Only the
|
||||
`bResetToCorner` path changes. Other windows are entered under the pointer as upstream does.
|
||||
|
||||
With the patch, the Duo starts with only the bottom bar under the parked pointer hovered and controller focus on the
|
||||
first tile (4 of 4 starts), and returns from a game the same way (3 of 3). Making 0100 ignore the X server's initial
|
||||
pointer instead was tried and rejected: the centre motion still arrived, and the header or search bar ended up hovered.
|
||||
@@ -0,0 +1,31 @@
|
||||
diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp
|
||||
--- a/src/steamcompmgr.cpp
|
||||
+++ b/src/steamcompmgr.cpp
|
||||
@@ -5790,7 +5790,16 @@
|
||||
|
||||
if ( win_surface(pFocus->inputFocusWindow) != nullptr && pFocus->cursor )
|
||||
{
|
||||
- wlserver_mousefocus( pFocus->inputFocusWindow->main_surface(), pFocus->cursor->x(), pFocus->cursor->y() );
|
||||
+ int nEnterX = pFocus->cursor->x();
|
||||
+ int nEnterY = pFocus->cursor->y();
|
||||
+ // A window reset to the corner below must not first be entered under the cursor:
|
||||
+ // a page that loads during the reset keeps that position as its hover.
|
||||
+ if ( pFocus->inputFocusWindow->GetFocus()->bResetToCorner )
|
||||
+ {
|
||||
+ nEnterX = pFocus->inputFocusWindow->GetGeometry().nWidth - 1;
|
||||
+ nEnterY = pFocus->inputFocusWindow->GetGeometry().nHeight - 1;
|
||||
+ }
|
||||
+ wlserver_mousefocus( pFocus->inputFocusWindow->main_surface(), nEnterX, nEnterY );
|
||||
focus_log.debugf( "Setting mouse focus to: %s (%x)", pFocus->inputFocusWindow->debug_name(), pFocus->inputFocusWindow->id() );
|
||||
}
|
||||
|
||||
@@ -5813,7 +5822,8 @@
|
||||
if ( pFocus->inputFocusWindow->GetFocus()->bResetToCorner )
|
||||
{
|
||||
wlserver_lock();
|
||||
- wlserver_mousewarp( pFocus->inputFocusWindow->GetGeometry().nWidth / 2, pFocus->inputFocusWindow->GetGeometry().nHeight / 2, 0, true );
|
||||
+ wlserver.mouse_surface_cursorx = pFocus->inputFocusWindow->GetGeometry().nWidth / 2;
|
||||
+ wlserver.mouse_surface_cursory = pFocus->inputFocusWindow->GetGeometry().nHeight / 2;
|
||||
wlserver_fake_mouse_pos( pFocus->inputFocusWindow->GetGeometry().nWidth - 1, pFocus->inputFocusWindow->GetGeometry().nHeight - 1 );
|
||||
wlserver_unlock();
|
||||
}
|
||||
@@ -34,6 +34,97 @@ ln -sf /usr/local/bin/droiddeck-steam-launch /usr/local/bin/steamdeck-steam 2>/d
|
||||
ln -sf /usr/local/bin/droiddeck-steam-shim /usr/local/bin/steam 2>/dev/null
|
||||
python3 /usr/local/bin/droiddeck-desktop-games 2>&1 | sed 's/^/[games] /'
|
||||
python3 /usr/local/bin/droiddeck-desktop-programs 2>&1 | sed 's/^/[programs] /'
|
||||
# Plasma lays out the SteamOS panel only for a profile without one. The layout is written at every
|
||||
# start, and a panel made before this version (Kubuntu's own, or the first SteamOS one without the
|
||||
# pager, clock and Plasma's stock pins) is set aside once so Plasma lays out the current one.
|
||||
dd_layout=/usr/share/plasma/look-and-feel/com.valve.vapor.desktop/contents/layouts
|
||||
dd_layout_installed=0
|
||||
if [ -d "$dd_layout" ]; then
|
||||
if cat > "$dd_layout/org.kde.plasma.desktop-layout.js" <<'LAYOUT'
|
||||
var desktops = desktopsForActivity(currentActivity());
|
||||
for (var i = 0; i < desktops.length; i++) {
|
||||
desktops[i].wallpaperPlugin = "org.kde.image";
|
||||
desktops[i].currentConfigGroup = ["Wallpaper", "org.kde.image", "General"];
|
||||
desktops[i].writeConfig("Image", "file:///usr/share/wallpapers/DroidDeck");
|
||||
}
|
||||
|
||||
var panel = new Panel;
|
||||
var panelScreen = panel.screen;
|
||||
panel.location = "bottom";
|
||||
panel.height = 2 * Math.ceil(gridUnit * 2.5 / 2);
|
||||
|
||||
const maximumAspectRatio = 21 / 9;
|
||||
if (panel.formFactor === "horizontal") {
|
||||
const geo = screenGeometry(panelScreen);
|
||||
const maximumWidth = Math.ceil(geo.height * maximumAspectRatio);
|
||||
if (geo.width > maximumWidth) {
|
||||
panel.alignment = "center";
|
||||
panel.minimumLength = maximumWidth;
|
||||
panel.maximumLength = maximumWidth;
|
||||
}
|
||||
}
|
||||
|
||||
var kickoff = panel.addWidget("org.kde.plasma.kickoff");
|
||||
kickoff.currentConfigGroup = ["Shortcuts"];
|
||||
kickoff.writeConfig("global", "Alt+F1");
|
||||
kickoff.currentConfigGroup = ["General"];
|
||||
kickoff.writeConfig("icon", "distributor-logo-steamdeck");
|
||||
kickoff.writeConfig("favorites", [
|
||||
"preferred://browser",
|
||||
"applications:org.kde.dolphin.desktop",
|
||||
"applications:org.kde.konsole.desktop",
|
||||
"applications:org.kde.kate.desktop",
|
||||
"applications:org.kde.discover.desktop",
|
||||
"applications:systemsettings.desktop",
|
||||
]);
|
||||
|
||||
panel.addWidget("org.kde.plasma.pager");
|
||||
|
||||
var tasks = panel.addWidget("org.kde.plasma.icontasks");
|
||||
tasks.currentConfigGroup = ["General"];
|
||||
tasks.writeConfig("launchers", [
|
||||
"applications:steamdeck-steam.desktop",
|
||||
"applications:systemsettings.desktop",
|
||||
"applications:org.kde.discover.desktop",
|
||||
"preferred://filemanager",
|
||||
"preferred://browser",
|
||||
"applications:org.kde.konsole.desktop",
|
||||
"applications:org.kde.kate.desktop",
|
||||
]);
|
||||
|
||||
panel.addWidget("org.kde.plasma.marginsseparator");
|
||||
|
||||
const inputMethodLanguages = ["as", "bn", "bo", "brx", "doi", "gu", "hi", "ja", "kn", "ko", "kok", "ks", "lep", "mai",
|
||||
"ml", "mni", "mr", "ne", "or", "pa", "sa", "sat", "sd", "si", "ta", "te", "th", "ur", "vi", "zh_CN", "zh_TW"];
|
||||
if (inputMethodLanguages.indexOf(languageId) != -1) {
|
||||
panel.addWidget("org.kde.plasma.kimpanel");
|
||||
}
|
||||
|
||||
var tray = panel.addWidget("org.kde.plasma.systemtray");
|
||||
var trayId = tray.readConfig("SystrayContainmentId");
|
||||
if (trayId) {
|
||||
var trayContainment = desktopById(trayId);
|
||||
trayContainment.currentConfigGroup = ["General"];
|
||||
trayContainment.writeConfig("scaleIconsToFit", true);
|
||||
}
|
||||
var clock = panel.addWidget("org.kde.plasma.digitalclock");
|
||||
clock.currentConfigGroup = ["Appearance"];
|
||||
clock.writeConfig("dateFormat", "isoDate");
|
||||
panel.addWidget("org.kde.plasma.showdesktop");
|
||||
LAYOUT
|
||||
then
|
||||
dd_layout_installed=1
|
||||
fi
|
||||
fi
|
||||
dd_panel_rc="${XDG_CONFIG_HOME:-$HOME/.config}/plasma-org.kde.plasma.desktop-appletsrc"
|
||||
dd_panel_stamp="${XDG_CONFIG_HOME:-$HOME/.config}/droiddeck-panel-layout"
|
||||
if [ "$dd_layout_installed" -eq 1 ] && [ "$(cat "$dd_panel_stamp" 2>/dev/null)" != steamos-2 ]; then
|
||||
dd_panel_backup="$dd_panel_rc.before-steamos-2"
|
||||
[ -e "$dd_panel_backup" ] && dd_panel_backup="$dd_panel_backup.$$"
|
||||
if [ ! -f "$dd_panel_rc" ] || mv "$dd_panel_rc" "$dd_panel_backup"; then
|
||||
mkdir -p "$(dirname "$dd_panel_stamp")" && echo steamos-2 > "$dd_panel_stamp"
|
||||
fi
|
||||
fi
|
||||
# startplasma applies this file over the session environment, and keeps what an earlier session wrote.
|
||||
kwriteconfig6 --file plasma-localerc --group Formats --key LANG "${LANG:-C.UTF-8}"
|
||||
if [ -n "${LANGUAGE:-}" ]; then
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# The device tree on Android handhelds names the SoC vendor's reference board ("Kera MTP") and an
|
||||
# internal codename for the CPU, so the device and SoC names come from Android through the session.
|
||||
case "$1" in
|
||||
host)
|
||||
if [ -n "$DD_DEVICE_NAME" ]; then
|
||||
printf '%s\n' "$DD_DEVICE_NAME"
|
||||
else
|
||||
tr -d '\0' < /proc/device-tree/model 2>/dev/null
|
||||
echo
|
||||
fi
|
||||
;;
|
||||
cpu)
|
||||
name=${DD_SOC_NAME:-$(cat /sys/devices/soc0/machine 2>/dev/null)}
|
||||
cores=$(getconf _NPROCESSORS_CONF)
|
||||
mhz=$(cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_max_freq 2>/dev/null | sort -n | tail -n 1)
|
||||
if [ -n "$mhz" ]; then
|
||||
printf '%s (%s) @ %s GHz\n' "$name" "$cores" "$(awk -v k="$mhz" 'BEGIN { printf "%.2f", k / 1000000 }')"
|
||||
else
|
||||
printf '%s (%s)\n' "$name" "$cores"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "usage: droiddeck-device-info host|cpu" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "file",
|
||||
"source": "/usr/share/droiddeck/fastfetch/logo.txt",
|
||||
"color": {
|
||||
"1": "38;2;255;255;255",
|
||||
"2": "38;2;26;159;255"
|
||||
},
|
||||
"padding": { "right": 3 }
|
||||
},
|
||||
"modules": [
|
||||
"title", "separator", "os",
|
||||
{ "type": "command", "key": "Host", "text": "droiddeck-device-info host" },
|
||||
"kernel", "uptime", "packages", "shell",
|
||||
"display", "de", "wm", "wmtheme", "theme", "icons", "font", "cursor",
|
||||
"terminal",
|
||||
{ "type": "command", "key": "CPU", "text": "droiddeck-device-info cpu" },
|
||||
"gpu", "memory", "swap",
|
||||
{ "type": "disk", "key": "Disk", "folders": "/", "format": "{size-used} / {size-total} ({size-percentage})" },
|
||||
{ "type": "battery", "key": "Battery" },
|
||||
"locale",
|
||||
"break", "colors"
|
||||
]
|
||||
}
|
||||
@@ -299,6 +299,27 @@ def map_drive(root, volume):
|
||||
return None
|
||||
|
||||
|
||||
def rootfs():
|
||||
host = os.environ.get("DDNATV_ROOT")
|
||||
return os.path.realpath(host) if host else None
|
||||
|
||||
|
||||
def guest_path(path):
|
||||
host = rootfs()
|
||||
if not host or not inside(path, host):
|
||||
return None
|
||||
return "/" + path[len(host):].strip("/")
|
||||
|
||||
|
||||
def rootfs_drive(root, text):
|
||||
found = re.match(r"(?i)^([abd-y]):[\\/]", text)
|
||||
host = rootfs()
|
||||
if not found or not host:
|
||||
return False
|
||||
link = os.path.join(dosdevices(root), found.group(1).lower() + ":")
|
||||
return os.path.islink(link) and inside(host, os.path.realpath(link))
|
||||
|
||||
|
||||
def install_path(root, library):
|
||||
library = library.rstrip("/") or "/"
|
||||
try:
|
||||
@@ -308,6 +329,9 @@ def install_path(root, library):
|
||||
return "Z:" + library
|
||||
if volume == "/":
|
||||
return "Z:" + library
|
||||
host = rootfs()
|
||||
if host and inside(host, volume):
|
||||
return "Z:" + (guest_path(path) or library)
|
||||
drive = mapped_drive(root, path, volume)
|
||||
if drive is None and not wine_processes(os.path.join(prefix(root), "pfx")):
|
||||
drive = map_drive(root, volume)
|
||||
@@ -586,11 +610,15 @@ def drive_folder(root, value):
|
||||
text = value.decode("utf-8")
|
||||
except UnicodeDecodeError:
|
||||
return value
|
||||
if not re.match(r"(?i)^z:[\\/]", text):
|
||||
holds_root = rootfs_drive(root, text)
|
||||
if not holds_root and not re.match(r"(?i)^z:[\\/]", text):
|
||||
return value
|
||||
folder = windows_path(root, text)
|
||||
if not folder or not os.path.isdir(folder):
|
||||
return value
|
||||
if holds_root:
|
||||
guest = guest_path(os.path.realpath(folder))
|
||||
return value if guest is None else ("Z:" + guest).encode("utf-8")
|
||||
moved = install_path(root, folder)
|
||||
return value if moved.startswith("Z:") else moved.replace("\\", "/").encode("utf-8")
|
||||
|
||||
@@ -608,11 +636,115 @@ def move_installs(root):
|
||||
return False
|
||||
except (OSError, ValueError):
|
||||
return False
|
||||
write_bytes(path, moved)
|
||||
return True
|
||||
|
||||
|
||||
def rootfs_drives(root):
|
||||
host = rootfs()
|
||||
folder = dosdevices(root)
|
||||
if not host:
|
||||
return {}
|
||||
try:
|
||||
names = sorted(os.listdir(folder))
|
||||
except OSError:
|
||||
return {}
|
||||
drives = {}
|
||||
for name in names:
|
||||
link = os.path.join(folder, name)
|
||||
if len(name) == 2 and name[0].lower() in DRIVES and name[1] == ":" and os.path.islink(link):
|
||||
target = os.path.realpath(link)
|
||||
if inside(host, target):
|
||||
drives[name[0].lower()] = host[len(target):].strip("/")
|
||||
return drives
|
||||
|
||||
|
||||
def write_bytes(path, data):
|
||||
with open(path + ".tmp", "wb") as f:
|
||||
f.write(moved)
|
||||
f.write(data)
|
||||
shutil.copymode(path, path + ".tmp")
|
||||
os.replace(path + ".tmp", path)
|
||||
return True
|
||||
|
||||
|
||||
def install_folders(root):
|
||||
try:
|
||||
with open(os.path.join(drive_c(root), *PRODUCT_DB), "rb") as f:
|
||||
data = f.read()
|
||||
except FileNotFoundError:
|
||||
return []
|
||||
folders = []
|
||||
rewrite_field(data, INSTALL_FOLDER, lambda value: folders.append(value) or value)
|
||||
return folders
|
||||
|
||||
|
||||
def json_strings(value):
|
||||
if isinstance(value, str):
|
||||
yield value
|
||||
elif isinstance(value, dict):
|
||||
for key, item in value.items():
|
||||
yield key
|
||||
yield from json_strings(item)
|
||||
elif isinstance(value, list):
|
||||
for item in value:
|
||||
yield from json_strings(item)
|
||||
|
||||
|
||||
def escapes(tail):
|
||||
depth = 0
|
||||
for part in re.split(rb"[\\/]+", tail):
|
||||
if part == b"..":
|
||||
depth -= 1
|
||||
if depth < 0:
|
||||
return True
|
||||
elif part and part != b".":
|
||||
depth += 1
|
||||
return False
|
||||
|
||||
|
||||
def drop_rootfs_drives(root):
|
||||
pfx = os.path.join(prefix(root), "pfx")
|
||||
drives = rootfs_drives(root)
|
||||
if not drives or wine_processes(pfx):
|
||||
return []
|
||||
try:
|
||||
folders = install_folders(root)
|
||||
except ValueError:
|
||||
return []
|
||||
texts = {}
|
||||
for path in (os.path.join(pfx, "system.reg"), os.path.join(pfx, "user.reg"), os.path.join(drive_c(root), *CONFIG)):
|
||||
try:
|
||||
with open(path, "rb") as f:
|
||||
texts[path] = f.read()
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
sep = rb"(?:\\\\|/)"
|
||||
changed = dict(texts)
|
||||
for letter, rest in drives.items():
|
||||
head = rb"(?<![A-Za-z0-9])[" + letter.encode() + letter.upper().encode() + rb"]:"
|
||||
inner = b"".join(sep + re.escape(part.encode()) for part in rest.split("/") if part)
|
||||
for path in changed:
|
||||
changed[path] = re.sub(head + inner + rb"(?=(" + sep + rb"[^\"\r\n]*))",
|
||||
lambda m: m.group(0) if escapes(m.group(1)) else b"Z:", changed[path])
|
||||
for path, data in changed.items():
|
||||
if data != texts[path]:
|
||||
write_bytes(path, data)
|
||||
seen = list(changed.values())
|
||||
config = os.path.join(drive_c(root), *CONFIG)
|
||||
if config in changed:
|
||||
try:
|
||||
seen += [text.encode("utf-8", "replace") for text in json_strings(json.loads(changed[config].decode("utf-8-sig")))]
|
||||
except ValueError:
|
||||
return []
|
||||
dropped = []
|
||||
for letter in sorted(drives):
|
||||
drive = letter.encode() + letter.upper().encode()
|
||||
used = rb"(?<![A-Za-z0-9])[" + drive + rb"]:[\\/]"
|
||||
if any(re.match(rb"[" + drive + rb"]:[\\/]", folder.lstrip()) for folder in folders):
|
||||
continue
|
||||
if not any(re.search(used, data) for data in seen):
|
||||
os.unlink(os.path.join(dosdevices(root), letter + ":"))
|
||||
dropped.append(letter)
|
||||
return dropped
|
||||
|
||||
|
||||
def wow_folders(root):
|
||||
@@ -725,9 +857,14 @@ def configure(root, library=None):
|
||||
return
|
||||
try:
|
||||
if move_installs(root):
|
||||
say("Battle.net's installed games on a mapped volume now use its Wine drive")
|
||||
say("Battle.net's installed games now use the Wine drive of their volume")
|
||||
except OSError as error:
|
||||
say("Battle.net's installed games not moved to their Wine drive: %s" % error)
|
||||
try:
|
||||
for letter in drop_rootfs_drives(root):
|
||||
say("Wine drive %s: held the runtime and is no longer used; removed" % letter.upper())
|
||||
except OSError as error:
|
||||
say("Battle.net's unused runtime drive not removed: %s" % error)
|
||||
try:
|
||||
wallpaper(root)
|
||||
except OSError as error:
|
||||
|
||||
@@ -3,13 +3,16 @@ import base64
|
||||
import fcntl
|
||||
import json
|
||||
import os
|
||||
import secrets
|
||||
import signal
|
||||
import socket
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
|
||||
SOCKET_FILE = "/etc/droiddeck/bwrap-socket"
|
||||
MAX_FORWARDED_FDS = 253
|
||||
|
||||
|
||||
def socket_name():
|
||||
@@ -94,6 +97,7 @@ class Spec:
|
||||
self.json_fds = []
|
||||
self.keep_fds = []
|
||||
self.lock_files = []
|
||||
self.lock_fds = []
|
||||
self.command = []
|
||||
self.argv0 = None
|
||||
self.env_tool = None
|
||||
@@ -363,6 +367,7 @@ def hold_locks(s):
|
||||
sys.stderr.write("bwrap: Can't lock file %s: %s\n" % (path, e.strerror))
|
||||
sys.exit(1)
|
||||
os.set_inheritable(fd, True)
|
||||
s.lock_fds.append(fd)
|
||||
|
||||
|
||||
def report_pid(s, pid):
|
||||
@@ -379,8 +384,28 @@ def report_pid(s, pid):
|
||||
pass
|
||||
|
||||
|
||||
def bind_flatpak_info(s):
|
||||
if not s.env.get("DDNATV_ROOT"):
|
||||
return
|
||||
for op in s.ops:
|
||||
if op["t"] != "file" or op["dest"] != "/.flatpak-info":
|
||||
continue
|
||||
try:
|
||||
fd = os.memfd_create("flatpak-info", 0)
|
||||
except (AttributeError, OSError):
|
||||
return
|
||||
data = memoryview(op["data"])
|
||||
while data:
|
||||
data = data[os.write(fd, data):]
|
||||
os.lseek(fd, 0, os.SEEK_SET)
|
||||
entry = "/proc/%d/fd/%d:/.flatpak-info" % (os.getpid(), fd)
|
||||
binds = s.env.get("DDNATV_BINDS")
|
||||
s.env["DDNATV_BINDS"] = binds + "|" + entry if binds else entry
|
||||
|
||||
|
||||
def run_here(s):
|
||||
report_pid(s, os.getpid())
|
||||
bind_flatpak_info(s)
|
||||
for fd in s.json_fds:
|
||||
os.close(fd)
|
||||
if s.cwd:
|
||||
@@ -410,7 +435,53 @@ def recv_exact(sock, n):
|
||||
return buf
|
||||
|
||||
|
||||
def inherited_fds(s):
|
||||
own = set(s.info_fds + s.json_fds + s.keep_fds + s.lock_fds)
|
||||
fds = []
|
||||
for name in os.listdir("/proc/self/fd"):
|
||||
fd = int(name)
|
||||
if fd <= 2 or fd in own:
|
||||
continue
|
||||
try:
|
||||
if os.get_inheritable(fd):
|
||||
fds.append(fd)
|
||||
except OSError:
|
||||
pass
|
||||
return sorted(fds)
|
||||
|
||||
|
||||
def hand_over(listener, fds):
|
||||
try:
|
||||
conn, _ = listener.accept()
|
||||
except OSError:
|
||||
return
|
||||
finally:
|
||||
listener.close()
|
||||
with conn:
|
||||
creds = conn.getsockopt(socket.SOL_SOCKET, socket.SO_PEERCRED, struct.calcsize("3i"))
|
||||
if struct.unpack("3i", creds)[1] != os.getuid():
|
||||
return
|
||||
conn.sendmsg([",".join(map(str, fds)).encode()],
|
||||
[(socket.SOL_SOCKET, socket.SCM_RIGHTS, struct.pack("%di" % len(fds), *fds))])
|
||||
|
||||
|
||||
def offer_fds(s):
|
||||
fds = inherited_fds(s)
|
||||
if not fds:
|
||||
return
|
||||
if len(fds) > MAX_FORWARDED_FDS:
|
||||
sys.stderr.write("bwrap: Too many inherited file descriptors: %d\n" % len(fds))
|
||||
sys.exit(1)
|
||||
name = "droiddeck-fds-" + secrets.token_hex(16)
|
||||
listener = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
listener.bind("\0" + name)
|
||||
listener.listen(1)
|
||||
s.env["DROIDDECK_FDS"] = name
|
||||
threading.Thread(target=hand_over, args=(listener, fds), daemon=True).start()
|
||||
|
||||
|
||||
def run_by_app(s):
|
||||
offer_fds(s)
|
||||
ops = []
|
||||
for op in s.ops:
|
||||
op = dict(op)
|
||||
|
||||
@@ -115,7 +115,7 @@ def link_libraries():
|
||||
common = os.path.join(library, "steamapps", "common")
|
||||
link = os.path.join(HOME, label)
|
||||
if os.path.isdir(common):
|
||||
if os.path.islink(link) and os.readlink(link) == common:
|
||||
if os.path.islink(link) and os.readlink(link) == common and os.path.isdir(os.path.join(link, ".")):
|
||||
continue
|
||||
if os.path.islink(link) or os.path.isfile(link):
|
||||
os.unlink(link)
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
#!/usr/bin/python3
|
||||
import configparser
|
||||
import os
|
||||
import stat
|
||||
import sys
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gio", "2.0")
|
||||
from gi.repository import Gio, GLib
|
||||
|
||||
NAME = "org.freedesktop.portal.Documents"
|
||||
PATH = "/org/freedesktop/portal/documents"
|
||||
VERSION = 5
|
||||
PROC = sys.argv[1] if len(sys.argv) > 1 else "/proc"
|
||||
AS_NEEDED_BY_APP = 1 << 2
|
||||
DIRECTORY = 1 << 3
|
||||
FAILED = "org.freedesktop.portal.Error.Failed"
|
||||
NOT_FOUND = "org.freedesktop.portal.Error.NotFound"
|
||||
NOT_ALLOWED = "org.freedesktop.portal.Error.NotAllowed"
|
||||
INVALID = "org.freedesktop.portal.Error.InvalidArgument"
|
||||
INTROSPECTION = """
|
||||
<node>
|
||||
<interface name="org.freedesktop.portal.Documents">
|
||||
<method name="GetMountPoint"><arg type="ay" direction="out"/></method>
|
||||
<method name="Add">
|
||||
<arg type="h" direction="in"/><arg type="b" direction="in"/><arg type="b" direction="in"/>
|
||||
<arg type="s" direction="out"/>
|
||||
</method>
|
||||
<method name="AddNamed">
|
||||
<arg type="h" direction="in"/><arg type="ay" direction="in"/><arg type="b" direction="in"/>
|
||||
<arg type="b" direction="in"/><arg type="s" direction="out"/>
|
||||
</method>
|
||||
<method name="AddFull">
|
||||
<arg type="ah" direction="in"/><arg type="u" direction="in"/><arg type="s" direction="in"/>
|
||||
<arg type="as" direction="in"/><arg type="as" direction="out"/><arg type="a{sv}" direction="out"/>
|
||||
</method>
|
||||
<method name="AddNamedFull">
|
||||
<arg type="h" direction="in"/><arg type="ay" direction="in"/><arg type="u" direction="in"/>
|
||||
<arg type="s" direction="in"/><arg type="as" direction="in"/><arg type="s" direction="out"/>
|
||||
<arg type="a{sv}" direction="out"/>
|
||||
</method>
|
||||
<method name="GrantPermissions">
|
||||
<arg type="s" direction="in"/><arg type="s" direction="in"/><arg type="as" direction="in"/>
|
||||
</method>
|
||||
<method name="RevokePermissions">
|
||||
<arg type="s" direction="in"/><arg type="s" direction="in"/><arg type="as" direction="in"/>
|
||||
</method>
|
||||
<method name="Delete"><arg type="s" direction="in"/></method>
|
||||
<method name="Lookup"><arg type="ay" direction="in"/><arg type="s" direction="out"/></method>
|
||||
<method name="Info">
|
||||
<arg type="s" direction="in"/><arg type="ay" direction="out"/><arg type="a{sas}" direction="out"/>
|
||||
</method>
|
||||
<method name="List"><arg type="s" direction="in"/><arg type="a{say}" direction="out"/></method>
|
||||
<method name="GetHostPaths"><arg type="as" direction="in"/><arg type="a{say}" direction="out"/></method>
|
||||
<property name="version" type="u" access="read"/>
|
||||
</interface>
|
||||
</node>
|
||||
"""
|
||||
|
||||
|
||||
def passed_fds(invocation, handles):
|
||||
fd_list = invocation.get_message().get_unix_fd_list()
|
||||
fds = fd_list.peek_fds() if fd_list else []
|
||||
return [fds[h] if 0 <= h < len(fds) else -1 for h in handles]
|
||||
|
||||
|
||||
def usable(fd, flags):
|
||||
try:
|
||||
mode = os.fstat(fd).st_mode
|
||||
except OSError:
|
||||
return False
|
||||
return stat.S_ISDIR(mode) if flags & DIRECTORY else stat.S_ISREG(mode)
|
||||
|
||||
|
||||
def app_name(pid):
|
||||
info = configparser.ConfigParser(interpolation=None)
|
||||
try:
|
||||
with open(os.path.join(PROC, pid, "root/.flatpak-info")) as f:
|
||||
info.read_file(f)
|
||||
except (OSError, UnicodeDecodeError, configparser.Error):
|
||||
return None
|
||||
return info.get("Application", "name", fallback=None)
|
||||
|
||||
|
||||
def root_of(pid):
|
||||
try:
|
||||
return os.stat(os.path.join(PROC, str(pid), "root", "."))
|
||||
except OSError:
|
||||
return None
|
||||
|
||||
|
||||
def app_pids(app_id):
|
||||
roots = {pid: root_of(pid) for pid in os.listdir(PROC) if pid.isdigit() and app_name(pid) == app_id}
|
||||
own = root_of(os.getpid())
|
||||
apart = [pid for pid, root in roots.items() if not (own and root and os.path.samestat(own, root))]
|
||||
return apart or list(roots)
|
||||
|
||||
|
||||
def access_mode(permissions):
|
||||
mode = os.R_OK if "read" in permissions else 0
|
||||
return mode | os.W_OK if "write" in permissions else mode
|
||||
|
||||
|
||||
def under(path, prefix):
|
||||
return path == prefix or path.startswith(prefix.rstrip("/") + "/")
|
||||
|
||||
|
||||
def spellings(path):
|
||||
root = os.environ.get("DDNATV_ROOT", "").rstrip("/")
|
||||
if root and under(path, root):
|
||||
path = path[len(root):] or "/"
|
||||
names = [path]
|
||||
for bind in filter(None, os.environ.get("DDNATV_BINDS", "").split("|")):
|
||||
host, _, guest = bind.partition(":")
|
||||
if host and guest and under(path, guest):
|
||||
name = host + path[len(guest.rstrip("/")):]
|
||||
if not (root and under(name, root)) and name not in names:
|
||||
names.append(name)
|
||||
return names
|
||||
|
||||
|
||||
def same_file(path, picked):
|
||||
try:
|
||||
return os.path.samestat(os.stat(path), picked)
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
||||
def app_reaches(app_id, path, picked, permissions):
|
||||
if not app_id:
|
||||
return True
|
||||
mode = access_mode(permissions) or os.F_OK
|
||||
roots = [os.path.join(PROC, pid, "root") for pid in app_pids(app_id)]
|
||||
return any(same_file(root + name, picked) and os.access(root + name, mode)
|
||||
for root in roots for name in spellings(path))
|
||||
|
||||
|
||||
def fd_path(fd):
|
||||
try:
|
||||
path = os.readlink("/proc/self/fd/%d" % fd)
|
||||
except OSError:
|
||||
return None
|
||||
return path if path.startswith("/") else None
|
||||
|
||||
|
||||
def reachable_in_place(invocation, flags, handles, directories, app_id, permissions):
|
||||
if not flags & AS_NEEDED_BY_APP:
|
||||
invocation.return_dbus_error(NOT_ALLOWED, "Documents can only be shared in place")
|
||||
return False
|
||||
fds = passed_fds(invocation, handles)
|
||||
if not all(fd >= 0 and usable(fd, DIRECTORY if directories else flags) for fd in fds):
|
||||
invocation.return_dbus_error(INVALID, "Invalid fd passed")
|
||||
return False
|
||||
if not all(fd_path(fd) and app_reaches(app_id, fd_path(fd), os.fstat(fd), permissions) for fd in fds):
|
||||
invocation.return_dbus_error(NOT_ALLOWED, "The application can't reach this location without the document store")
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def on_call(connection, sender, path, interface, method, params, invocation):
|
||||
args = params.unpack()
|
||||
if method == "AddFull":
|
||||
handles, flags = args[0], args[1]
|
||||
if reachable_in_place(invocation, flags, handles, False, args[2], args[3]):
|
||||
invocation.return_value(GLib.Variant("(asa{sv})", ([""] * len(handles), {})))
|
||||
elif method == "AddNamedFull":
|
||||
if reachable_in_place(invocation, args[2], [args[0]], True, args[3], args[4]):
|
||||
invocation.return_value(GLib.Variant("(sa{sv})", ("", {})))
|
||||
elif method == "Lookup":
|
||||
invocation.return_value(GLib.Variant("(s)", ("",)))
|
||||
elif method == "List":
|
||||
invocation.return_value(GLib.Variant("(a{say})", ({},)))
|
||||
elif method == "GetHostPaths":
|
||||
invocation.return_value(GLib.Variant("(a{say})", ({},)))
|
||||
elif method in ("Add", "AddNamed"):
|
||||
invocation.return_dbus_error(NOT_ALLOWED, "Documents can only be shared in place")
|
||||
elif method in ("GrantPermissions", "RevokePermissions", "Delete", "Info"):
|
||||
invocation.return_dbus_error(NOT_FOUND, "Invalid document id")
|
||||
else:
|
||||
invocation.return_dbus_error(FAILED, "No document store mount")
|
||||
|
||||
|
||||
def on_get(connection, sender, path, interface, prop):
|
||||
return GLib.Variant("u", VERSION) if prop == "version" else None
|
||||
|
||||
|
||||
def main():
|
||||
loop = GLib.MainLoop()
|
||||
info = Gio.DBusNodeInfo.new_for_xml(INTROSPECTION).interfaces[0]
|
||||
bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
|
||||
bus.register_object(PATH, info, on_call, on_get, None)
|
||||
Gio.bus_own_name_on_connection(bus, NAME, Gio.BusNameOwnerFlags.DO_NOT_QUEUE, None, lambda *_: loop.quit())
|
||||
loop.run()
|
||||
return 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -10,7 +10,7 @@ free_name() {
|
||||
share() {
|
||||
local android=$HOME/Storage/$1 link=$HOME/$2 f
|
||||
[ -d "$android" ] && [ -w "$android" ] || return 0
|
||||
[ "$(readlink "$link" 2>/dev/null)" = "$android" ] && return 0
|
||||
[ "$(readlink "$link" 2>/dev/null)" = "$android" ] && [ -d "$link/." ] && return 0
|
||||
if [ -L "$link" ]; then
|
||||
rm -f "$link"
|
||||
elif [ -d "$link" ]; then
|
||||
|
||||
@@ -71,6 +71,7 @@ RUNTIME_LIBRARIES = (("libc.so.6", b"GLIBC_"), ("libstdc++.so.6", b"GLIBCXX_"))
|
||||
VERSION_NAME = re.compile(rb"GLIBC(?:XX)?_[0-9][0-9.]*[0-9]")
|
||||
BUNDLE_DEPTH = 3
|
||||
THUNKS = {"GL": 1, "Vulkan": 1}
|
||||
WAYLAND_THUNKS = {"WaylandClient": "libwayland-client-guest.so", "EGL": "libEGL-guest.so", "WaylandEGL": "libwayland-egl-guest.so"}
|
||||
X86 = {3: "i386", 62: "x86_64"}
|
||||
ARM = {40: "arm", 183: "arm64"}
|
||||
SCAN_DEPTH = 4
|
||||
@@ -448,13 +449,20 @@ def install_preloads(root):
|
||||
write_if_changed(os.path.join(root, "etc", "asound.conf"), ASOUND_CONF)
|
||||
|
||||
|
||||
def enabled_thunks(fex):
|
||||
thunks = dict(THUNKS)
|
||||
if all(os.path.isfile(os.path.join(fex["guest_thunks"], name)) for name in WAYLAND_THUNKS.values()):
|
||||
thunks.update(dict.fromkeys(WAYLAND_THUNKS, 1))
|
||||
return thunks
|
||||
|
||||
|
||||
def write_config(fex, root):
|
||||
config = {"Config": {"RootFS": root}}
|
||||
if fex["host_thunks"] and fex["guest_thunks"] and fex["thunks_db"]:
|
||||
config["Config"]["ThunkHostLibs"] = fex["host_thunks"]
|
||||
config["Config"]["ThunkGuestLibs"] = fex["guest_thunks"]
|
||||
config["ThunksDB"] = dict(THUNKS)
|
||||
write_if_changed(os.path.join(CONFIG_DIR, "ThunksConfig.json"), json.dumps({"ThunksDB": dict(THUNKS)}, indent=2) + "\n")
|
||||
config["ThunksDB"] = enabled_thunks(fex)
|
||||
write_if_changed(os.path.join(CONFIG_DIR, "ThunksConfig.json"), json.dumps({"ThunksDB": config["ThunksDB"]}, indent=2) + "\n")
|
||||
write_if_changed(os.path.join(CONFIG_DIR, "Config.json"), json.dumps(config, indent=2) + "\n")
|
||||
|
||||
|
||||
|
||||
@@ -29,14 +29,19 @@ fex_install() {
|
||||
return 1
|
||||
fi
|
||||
(cd "$tmp/root" && find . ! -type d) > "$tmp/files"
|
||||
for d in usr/local/share/fex-emu/GuestThunks usr/local/share/fex-emu/GuestThunks_32 usr/local/lib/fex-emu/HostThunks usr/local/lib/fex-emu/HostThunks_32; do
|
||||
[ -d "$tmp/root/$d" ] && [ -d "$dst$d" ] || continue
|
||||
(cd "$dst" && find "$d" ! -type d) | while IFS= read -r f; do grep -qxF "./$f" "$tmp/files" || echo "$f"; done
|
||||
done > "$tmp/stale"
|
||||
mkdir "$tmp/old"
|
||||
while IFS= read -r f; do
|
||||
f=${f#./}
|
||||
if [ -e "$dst$f" ] || [ -L "$dst$f" ]; then
|
||||
cp -a --parents "$dst$f" "$tmp/old" || { echo "== FEX $tag: could not keep $dst$f aside" >&2; rm -rf "$tmp"; return 1; }
|
||||
fi
|
||||
done < "$tmp/files"
|
||||
if tar -C "$tmp/root" -c . | tar -C "$dst" -x && fex_loads "$dst" &&
|
||||
done < <(cat "$tmp/files" "$tmp/stale")
|
||||
if tar -C "$tmp/root" -c . | tar -C "$dst" -x &&
|
||||
( while IFS= read -r f; do rm -f "$dst$f" || exit 1; done < "$tmp/stale" ) && fex_loads "$dst" &&
|
||||
mkdir -p "${dst}usr/local/share/fex-emu" && echo "$tag" > "${dst}usr/local/share/fex-emu/.droiddeck-tag"; then
|
||||
rm -rf "$tmp"
|
||||
return 0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python3
|
||||
import fcntl
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
@@ -6,6 +7,8 @@ import platform
|
||||
import re
|
||||
import runpy
|
||||
import signal
|
||||
import stat
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
@@ -1046,6 +1049,9 @@ WINE_DLL_DIRS = ("/lib/wine/i386-windows", "/lib/wine/x86_64-windows", "/lib/win
|
||||
|
||||
|
||||
FOREIGN_SUFFIX = ".foreign-arch"
|
||||
WINE_SD = "user.wine.sd"
|
||||
SHARED_DATA = "pfx/drive_c/ProgramData"
|
||||
MACHINE_ID = "/etc/machine-id"
|
||||
PE = runpy.run_path(str(Path(__file__).resolve().parent / "droiddeck-wine-pe"))
|
||||
pe_machine = PE["pe_machine"]
|
||||
|
||||
@@ -1144,6 +1150,124 @@ def repair_foreign_system_dlls(prefix, proton, env=None):
|
||||
return repaired
|
||||
|
||||
|
||||
def wine_user_sid():
|
||||
try:
|
||||
with open(MACHINE_ID, "rb") as handle:
|
||||
text = handle.read(16)
|
||||
except OSError:
|
||||
return (21, 0, 0, 0, 1000)
|
||||
if len(text) != 16:
|
||||
return (21, 0, 0, 0, 1000)
|
||||
sign, digits = re.match(rb"\s*([+-]?)(?:0[xX])?([0-9a-fA-F]*)", text).groups()
|
||||
machine = int(digits, 16) if digits else 0
|
||||
if sign == b"-":
|
||||
machine = -machine % (1 << 64)
|
||||
return (21, machine >> 32, machine & 0xffffffff, os.getuid(), 1000)
|
||||
|
||||
|
||||
def wine_sd_owner(path):
|
||||
try:
|
||||
data = os.getxattr(path, WINE_SD, follow_symlinks=False)
|
||||
except OSError:
|
||||
return None
|
||||
if len(data) < 22:
|
||||
return None
|
||||
sid = data[22:22 + struct.unpack_from("<I", data, 6)[0]]
|
||||
if len(sid) < 8 or len(sid) < 8 + 4 * sid[1]:
|
||||
return None
|
||||
return sid[0], int.from_bytes(sid[2:8], "big"), struct.unpack_from("<%dI" % sid[1], sid, 8)
|
||||
|
||||
|
||||
def is_stale_owner(owner, user):
|
||||
if owner is None:
|
||||
return False
|
||||
revision, authority, subs = owner
|
||||
return revision == 1 and authority == 5 and len(subs) == 5 and subs[0] == 21 and subs[4] == 1000 \
|
||||
and subs != user
|
||||
|
||||
|
||||
def heal_wine_entry(path, is_dir, user):
|
||||
try:
|
||||
mode = stat.S_IMODE(os.lstat(path).st_mode)
|
||||
except OSError:
|
||||
return None, False
|
||||
readable = mode
|
||||
if not mode & stat.S_IRUSR:
|
||||
readable = mode | stat.S_IRUSR
|
||||
try:
|
||||
os.chmod(path, readable)
|
||||
except OSError:
|
||||
return None, False
|
||||
final = mode
|
||||
stale = is_stale_owner(wine_sd_owner(path), user)
|
||||
cleared = False
|
||||
if stale and (not mode & stat.S_IRUSR or is_dir and not mode & stat.S_IXUSR):
|
||||
final = mode | (stat.S_IRWXU if is_dir else stat.S_IRUSR | stat.S_IWUSR)
|
||||
try:
|
||||
if stale:
|
||||
os.chmod(path, final | stat.S_IWUSR)
|
||||
try:
|
||||
os.removexattr(path, WINE_SD, follow_symlinks=False)
|
||||
cleared = True
|
||||
except OSError:
|
||||
pass
|
||||
if not final & stat.S_IWUSR:
|
||||
os.chmod(path, final)
|
||||
elif final != readable:
|
||||
os.chmod(path, final)
|
||||
except OSError:
|
||||
return None, cleared
|
||||
return (mode, final), cleared
|
||||
|
||||
|
||||
def heal_shared_data(prefix):
|
||||
root = Path(prefix) / SHARED_DATA
|
||||
if root.is_symlink() or not root.is_dir():
|
||||
return [], []
|
||||
try:
|
||||
lock = os.open(root.parent.parent, os.O_RDONLY | os.O_DIRECTORY)
|
||||
except OSError:
|
||||
return [], []
|
||||
try:
|
||||
fcntl.flock(lock, fcntl.LOCK_EX)
|
||||
return heal_shared_data_locked(root)
|
||||
finally:
|
||||
os.close(lock)
|
||||
|
||||
|
||||
def heal_shared_data_locked(root):
|
||||
user = wine_user_sid()
|
||||
unlocked = []
|
||||
cleared = []
|
||||
pending = [(str(root), True)]
|
||||
while pending:
|
||||
path, is_dir = pending.pop()
|
||||
modes, was_cleared = heal_wine_entry(path, is_dir, user)
|
||||
name = os.path.relpath(path, root)
|
||||
if was_cleared:
|
||||
cleared.append(name)
|
||||
if modes is None:
|
||||
continue
|
||||
mode, final = modes
|
||||
if final != mode:
|
||||
unlocked.append(name)
|
||||
if not is_dir or final & (stat.S_IRUSR | stat.S_IXUSR) != stat.S_IRUSR | stat.S_IXUSR:
|
||||
continue
|
||||
try:
|
||||
with os.scandir(path) as entries:
|
||||
for entry in entries:
|
||||
try:
|
||||
if entry.is_dir(follow_symlinks=False):
|
||||
pending.append((entry.path, True))
|
||||
elif entry.is_file(follow_symlinks=False):
|
||||
pending.append((entry.path, False))
|
||||
except OSError:
|
||||
continue
|
||||
except OSError:
|
||||
continue
|
||||
return sorted(unlocked), sorted(cleared)
|
||||
|
||||
|
||||
def is_wine_dll_link(path):
|
||||
try:
|
||||
return os.path.islink(path) and os.path.dirname(os.readlink(path)).endswith(WINE_DLL_DIRS)
|
||||
@@ -1406,9 +1530,13 @@ def game_logs(command, env, app_id, now=None):
|
||||
except OSError as error:
|
||||
print("droiddeck-game-env: no game log folder (%s)" % error, file=sys.stderr)
|
||||
return env
|
||||
proton_log = env.get("PROTON_LOG", "")
|
||||
asked = proton_log not in ("", "0")
|
||||
result = dict(env)
|
||||
if not asked:
|
||||
result.setdefault("WINEDEBUG", "-all,err+all")
|
||||
result.update({
|
||||
"PROTON_LOG": "1",
|
||||
"PROTON_LOG": proton_log if asked else "1",
|
||||
"PROTON_LOG_DIR": str(folder),
|
||||
"DXVK_LOG_PATH": str(folder),
|
||||
"DXVK_LOG_LEVEL": env.get("DXVK_LOG_LEVEL", "info"),
|
||||
@@ -1486,6 +1614,14 @@ def main():
|
||||
except OSError as error:
|
||||
restored = fixed = []
|
||||
print("droiddeck-game-env: prefix system DLL check skipped (%s)" % error, file=sys.stderr)
|
||||
try:
|
||||
unlocked, cleared = heal_shared_data(prefix_path)
|
||||
except OSError as error:
|
||||
unlocked = cleared = []
|
||||
print("droiddeck-game-env: ProgramData owner check skipped (%s)" % error, file=sys.stderr)
|
||||
if cleared:
|
||||
print("droiddeck-game-env: cleared %d stale Windows owners in ProgramData; unlocked: %s"
|
||||
% (len(cleared), ", ".join(unlocked) or "none"), file=sys.stderr)
|
||||
if restored:
|
||||
print("droiddeck-game-env: restored system DLLs this Proton's own programs do not load: %s" % ", ".join(restored),
|
||||
file=sys.stderr)
|
||||
|
||||