-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] can resize only from top when no decorations #9268
Comments
when using multiwebview, you need to do the resizing yourself. You could also leave 1px around the edge so the underlying window could catch clicks there and provide resizing. |
How should I handle resize myself from left / right bottom in multiwebview window?
Sounds good, I understand that the webviews should leave some space (1px) in left / right / bottom edges. |
you need to detect the clicks where you want to do resizing and then call https://docs.rs/tauri/2.0.0-beta.13/tauri/test/struct.MockWindowDispatcher.html#method.start_resize_dragging
|
I tried and created window with main.rsuse std::str::FromStr;
use tauri::{LogicalPosition, LogicalSize, Url, WebviewBuilder};
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.setup(|app| {
// Create main window
let width = 800.;
let height = 600.;
let window = tauri::window::WindowBuilder::new(app, "main")
.decorations(false)
.inner_size(width, height)
.build()?;
// Create webviews
let webview = WebviewBuilder::new(
"app",
tauri::WebviewUrl::External(Url::from_str("https://tauri.app/").unwrap())
).auto_resize();
let edge_space = 2.;
let size = LogicalSize::new(width - edge_space, height - edge_space);
let position = LogicalPosition::new(0 + edge_space as u32, 0 + edge_space as u32);
window.add_child(webview, position, size).unwrap();
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
} tauri infoWARNING: no lock files found, defaulting to npm
[✔] Environment
- OS: Windows 10.0.22631 X64
✔ WebView2: 123.0.2420.65
✔ MSVC: Visual Studio Community 2022
✔ rustc: 1.75.0 (82e1608df 2023-12-21)
✔ cargo: 1.75.0 (1d8b05cdd 2023-11-20)
✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
- node: 18.17.1
- npm: 9.6.7
[-] Packages
- tauri [RUST]: 2.0.0-beta.13
- tauri-build [RUST]: 2.0.0-beta.10
- wry [RUST]: 0.37.0
- tao [RUST]: 0.26.2
- tauri-cli [RUST]: 1.5.9
- @tauri-apps/api : not installed!
- @tauri-apps/cli [NPM]: 2.0.0-beta.1
[-] App
- build-type: bundle
- CSP: unset |
closes tauri-apps#7388 closes tauri-apps#9510 closes tauri-apps#9464 ref tauri-apps#9268 ref tauri-apps#9053 ref tauri-apps#8770 ref tauri-apps#8750 ref tauri-apps#4012
Describe the bug
When using latest tauri from dev branch with multiwebview and
deocrations(false)
I can't resize the window from left / right / bottom. I can resize only from top edge.
Reproduction
add
decorations(false)
to multiwebview exampleRun multiwebview example
cargo run --example multiwebview --features="unstable"
Expected behavior
We should be able to resize the window from left / right / bottom corners as well.
Full
tauri info
outputStack trace
No response
Additional context
It doesn't happen in
helloworld
exampleThe text was updated successfully, but these errors were encountered: