Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "localdesktop"
version = "2.1.0"
version = "2.1.1"
edition = "2021"
build = "build.rs"
default-run = "build_apk"
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The backend struct is the compositor's live state — the smithay `Compositor`,

<!--snippet file=src/android/backend/wayland/winit_backend.rs fn=bind-->

`configure_output` reconciles the compositor with the physical Android window every time the surface changes: it sets the compositor size, creates or updates the smithay `Output` (mode, transform, fractional scale), writes the host geometry to a file the in-chroot `wlr-randr` script watches, and resizes any existing toplevel windows to fill the screen.
`configure_output` reconciles the compositor with the physical Android window every time the surface changes: it sets the compositor size, creates or updates the smithay `Output` (mode and transform, with the parent output scale fixed at 1 because rendering uses physical pixels), writes the host geometry and guest UI scale to a file the in-chroot `wlr-randr` script watches, and resizes any existing toplevel windows to fill the screen.

<!--snippet file=src/android/app/run.rs fn=configure_output-->

Expand Down
3 changes: 2 additions & 1 deletion gh-pages/docs/developer/9-offline-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ cargo run --bin build_docs -- user phone dark # user manual, dark, phone pag
The User Manual ships as release artifacts in **6 variants** — every size
(desktop/fold/phone) × theme (light/dark) — attached alongside the APK/AAB as
`Local-Desktop-v<version>-User-Manual[-Fold|-Phone][-Dark].pdf`. The app also
pre-downloads the matching desktop/light manual onto the Linux desktop during setup.
pre-downloads the matching desktop/light manual onto the Linux desktop as
`Local Desktop - User Manual.pdf`.

The Developer Manual's architecture part comes in two modes:

Expand Down
12 changes: 1 addition & 11 deletions gh-pages/docs/user/app-compatibility/visual-studio-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,13 @@
title: Visual Studio Code
---

:::info

Visual Studio Code must be launched from the command line as follows:

```bash
code --no-sandbox
```

:::

![Visual Studio Code on Local Desktop](/img/vscode.webp)

You can install it from the [AUR](https://aur.archlinux.org/). See [How to install applications?](/docs/user/getting-started#how-to-install-applications) for instructions.

## Compatibility note

- VS Code **won't** launch from the XFCE Application launcher, you have to launch it from the terminal with an additional flag `--no-sandbox`. **It is an issue that persists with Termux + proot-distro.**
- Chromium's sandbox needs Linux user namespaces, which Android does not allow, so VS Code has to run with `--no-sandbox`. Local Desktop applies that for you: `ELECTRON_DISABLE_SANDBOX` is exported for the whole desktop session, and application entries for Chromium-based apps are shadowed with `--no-sandbox` copies in `~/.local/share/applications`. VS Code launches from the XFCE Application launcher and from the terminal with no extra flags. **Termux + proot-distro still requires the flag by hand.**

- Launching as a root user requires the `--user-data-dir` flag. [Why?](https://stackoverflow.com/a/70453798)

Expand Down
19 changes: 11 additions & 8 deletions src/android/app/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ use crate::android::{
webview::ErrorVariant,
},
proot::launch::launch,
utils::{ndk::run_in_jvm, webview::show_webview_popup},
utils::{
ndk::{self, run_in_jvm},
webview::show_webview_popup,
},
};
use crate::core::config;
use smithay::output::{Mode, Output, PhysicalProperties, Scale, Subpixel};
Expand All @@ -30,8 +33,11 @@ fn configure_output(backend: &mut crate::android::backend::wayland::WaylandBacke
};

let window_size = winit.window_size();
let scale_factor = winit.scale_factor();
let size = (window_size.w, window_size.h);
// Not `winit.scale_factor()`: that reads `AConfiguration`, which still reports the 160 dpi
// default on the first launch and only becomes accurate after a configuration change.
let guest_scale_factor = ndk::scale_factor(&backend.android_app);
backend.guest_scale_factor = guest_scale_factor;
backend.compositor.state.size = size.into();

let output = backend
Expand Down Expand Up @@ -61,11 +67,11 @@ fn configure_output(backend: &mut crate::android::backend::wayland::WaylandBacke
refresh: 60000,
}),
Some(Transform::Normal),
Some(Scale::Fractional(scale_factor)),
Some(Scale::Integer(1)),
Some((0, 0).into()),
);

let guest_scale = scale_factor.round().max(1.0) as i32;
let guest_scale = guest_scale_factor.round().max(1.0) as i32;
write_guest_output_state(window_size.w, window_size.h, guest_scale);

for surface in backend.compositor.state.xdg_shell_state.toplevel_surfaces() {
Expand Down Expand Up @@ -180,10 +186,7 @@ impl ApplicationHandler<AppUserEvent> for PolarBearApp {
if let PolarBearBackend::Wayland(backend) = &mut self.backend {
backend.graphic_renderer = None;
backend.key_counter = 0;
backend.touch_points.clear();
backend.scroll_centroid = None;
backend.touch_gesture_was_multi_touch = false;
backend.touch_down_position = None;
backend.reset_touch_state();
backend.pointer_pressed = false;
// Kill the standalone-client PipeWire/AAudio backend if it was started.
pipewire_standalone_aaudio::shutdown();
Expand Down
Loading
Loading