Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
57f9d56
feat(android): prepare for multi-window support
lucasfernog Oct 22, 2025
a71c707
add android multiwindow apis
lucasfernog Oct 23, 2025
f12df40
activity_name getter, JS API, auto inherit from manager on builder::new
lucasfernog Oct 24, 2025
c389ba4
refactor(core): improve iOS log messages from stdout/stderr
lucasfernog Oct 28, 2025
9e0bbff
patch
lucasfernog Oct 28, 2025
067ef61
Merge branch 'dev' into feat/mobile-multi-window
lucasfernog Oct 28, 2025
6854f8b
Merge branch 'refactor/ios-stdout-stderr-log' into feat/mobile-multi-…
lucasfernog Oct 28, 2025
b5d874d
use context (created_by_activity_name) from caller on TS API
lucasfernog Oct 29, 2025
bcc25c0
add scene identifier getter and setter
lucasfernog Oct 29, 2025
e4ccc32
expose apis
lucasfernog Oct 29, 2025
9a360af
fix desktop build
lucasfernog Oct 29, 2025
c5dbb02
Merge remote-tracking branch 'origin/dev' into feat/mobile-multi-window
lucasfernog Oct 30, 2025
6b94116
fix window from config
lucasfernog Oct 30, 2025
a602008
update lock
lucasfernog Oct 30, 2025
eb51b13
size is now respected on iOS, so default to None
lucasfernog Oct 30, 2025
f5f9b3d
add SceneRequested event
lucasfernog Nov 6, 2025
220cc2a
Merge remote-tracking branch 'origin/dev' into feat/mobile-multi-window
lucasfernog Nov 12, 2025
6eb2dee
update features
lucasfernog Nov 12, 2025
bfc74a7
fix default size
lucasfernog Nov 12, 2025
e97e2e5
Revert "fix default size"
lucasfernog Nov 12, 2025
11fc78b
ignore size from config
lucasfernog Nov 12, 2025
e5f65a6
lint
lucasfernog Nov 12, 2025
1702b27
Merge remote-tracking branch 'origin/dev' into feat/mobile-multi-window
lucasfernog Nov 17, 2025
2172252
use git
lucasfernog Nov 17, 2025
7f953fc
change file
lucasfernog Nov 17, 2025
7f02cf5
add supports_multiple_windows API
lucasfernog Dec 2, 2025
12aaef6
add androidx.lifecycle:lifecycle-process
lucasfernog Dec 3, 2025
00dcedc
update wry
lucasfernog Dec 3, 2025
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
Prev Previous commit
Next Next commit
add android multiwindow apis
  • Loading branch information
lucasfernog committed Oct 23, 2025
commit a71c7078b857046eb0fac46e77cc53ac4e54404c
15 changes: 15 additions & 0 deletions crates/tauri-runtime-wry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ use tauri_runtime::{

#[cfg(target_vendor = "apple")]
use objc2::rc::Retained;
#[cfg(target_os = "android")]
use tao::platform::android::WindowBuilderExtAndroid;
#[cfg(target_os = "macos")]
use tao::platform::macos::{EventLoopWindowTargetExtMacOS, WindowBuilderExtMacOS};
#[cfg(target_os = "linux")]
Expand Down Expand Up @@ -1238,6 +1240,18 @@ impl WindowBuilder for WindowBuilderWrapper {
fn window_classname<S: Into<String>>(self, _window_classname: S) -> Self {
self
}

#[cfg(target_os = "android")]
fn activity_name<S: Into<String>>(mut self, class_name: S) -> Self {
self.inner = self.inner.activity_name(class_name.into());
self
}

#[cfg(target_os = "android")]
fn created_by_activity_name<S: Into<String>>(mut self, class_name: S) -> Self {
self.inner = self.inner.created_by_activity_name(class_name.into());
self
}
}

#[cfg(any(
Expand Down Expand Up @@ -4401,6 +4415,7 @@ fn create_window<T: UserEvent, F: Fn(RawWindow) + Send + 'static>(
let window = window_builder
.inner
.build(event_loop)
.inspect_err(|e| log::error!("Error creating window: {e:?}"))
.map_err(|_| Error::CreateWindow)?;

#[cfg(feature = "tracing")]
Expand Down
10 changes: 10 additions & 0 deletions crates/tauri-runtime/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,16 @@ pub trait WindowBuilder: WindowBuilderBase {
/// Sets custom name for Windows' window class. **Windows only**.
#[must_use]
fn window_classname<S: Into<String>>(self, window_classname: S) -> Self;

/// The name of the activity to create for this webview window.
#[cfg(target_os = "android")]
fn activity_name<S: Into<String>>(self, class_name: S) -> Self;

/// Sets the name of the activity that is creating this webview window.
///
/// This is important to determine which stack the activity will belong to.
#[cfg(target_os = "android")]
fn created_by_activity_name<S: Into<String>>(self, class_name: S) -> Self;
}

/// A window that has yet to be built.
Expand Down
10 changes: 10 additions & 0 deletions crates/tauri/src/test/mock_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,16 @@ impl WindowBuilder for MockWindowBuilder {
fn background_color(self, _color: tauri_utils::config::Color) -> Self {
self
}

#[cfg(target_os = "android")]
fn activity_name(self, _class_name: String) -> Self {
self
}

#[cfg(target_os = "android")]
fn created_by_activity_name(self, _class_name: String) -> Self {
self
}
}

impl<T: UserEvent> WebviewDispatch<T> for MockWebviewDispatcher {
Expand Down
18 changes: 18 additions & 0 deletions crates/tauri/src/webview/webview_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,24 @@ impl<R: Runtime, M: Manager<R>> WebviewWindowBuilder<'_, R, M> {
}
}

// Android specific APIs
#[cfg(target_os = "android")]
impl<R: Runtime, M: Manager<R>> WebviewWindowBuilder<'_, R, M> {
/// The name of the activity to create for this webview window.
pub fn activity_name<S: Into<String>>(mut self, class_name: S) -> Self {
self.window_builder = self.window_builder.activity_name(class_name);
self
}

/// Sets the name of the activity that is creating this webview window.
///
/// This is important to determine which stack the activity will belong to.
pub fn created_by_activity_name<S: Into<String>>(mut self, class_name: S) -> Self {
self.window_builder = self.window_builder.created_by_activity_name(class_name);
self
}
}

/// A type that wraps a [`Window`] together with a [`Webview`].
#[default_runtime(crate::Wry, wry)]
#[derive(Debug)]
Expand Down
18 changes: 18 additions & 0 deletions crates/tauri/src/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,24 @@ impl<R: Runtime, M: Manager<R>> WindowBuilder<'_, R, M> {
self
}
}

#[cfg(target_os = "android")]
impl<R: Runtime, M: Manager<R>> WindowBuilder<'_, R, M> {
/// The name of the activity to create for this webview window.
pub fn activity_name<S: Into<String>>(mut self, class_name: S) -> Self {
self.window_builder = self.window_builder.activity_name(class_name);
self
}

/// Sets the name of the activity that is creating this webview window.
///
/// This is important to determine which stack the activity will belong to.
pub fn created_by_activity_name<S: Into<String>>(mut self, class_name: S) -> Self {
self.window_builder = self.window_builder.created_by_activity_name(class_name);
self
}
}

/// A wrapper struct to hold the window menu state
/// and whether it is global per-app or specific to this window.
#[cfg(desktop)]
Expand Down
12 changes: 12 additions & 0 deletions examples/api/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ pub fn run_app<R: Runtime, F: FnOnce(&App<R>) + Send + 'static>(

let webview = window_builder.build()?;

let app_ = app.handle().clone();
std::thread::spawn(move || {
std::thread::sleep(std::time::Duration::from_secs(3));
let mut w = WebviewWindowBuilder::new(&app_, "main-2", WebviewUrl::default());
#[cfg(target_os = "android")]
{
w = w.activity_name("Activity3");
}
let w = w.build().unwrap();
w.open_devtools();
});

#[cfg(debug_assertions)]
webview.open_devtools();

Expand Down