I tries to cover all monitors with fullscreen windows to display graphs on them. I have multiple monitors with different resolutions, framerates and scale factors. However, the approach from examples works only for the primary monitor. The windows on secondary monitors stay small, borderless and in random positions.
However, setting windows to fullscreen after the window was built works.
P.S. While we are here, please #[derive(PatialEq)] on tauri::window::Monitor.
Reproduction
This does not work: windows on secondary monitors remain small.
Uncomment the commented line to make it work.
tauri::Builder::default()
.setup(move |app| {
// Build the primary window
let primary_window = tauri::WebviewWindowBuilder::new(
app,
"primary",
tauri::WebviewUrl::App("index.html".into()),
)
.fullscreen(true)
.build()?;
if need_multiscreen {
let monitors = primary_window.available_monitors()?;
let primary_monitor = primary_window.current_monitor()?.unwrap();
for (i, monitor) in monitors.iter().enumerate() {
if !compare_monitors(&primary_monitor, monitor) {
dbg!(&monitor);
let label = format!("extra{}", i);
let pos = calculate_window_position(monitor);
let secondary_window =
tauri::WebviewWindowBuilder::new(
app,
label,
tauri::WebviewUrl::App("index.html".into()),
)
.position(pos.0, pos.1)
.fullscreen(true)
.build()?;
// Uncomment here
// let secondary_window =
// tauri::WebviewWindowBuilder::new(
// app,
// label,
// tauri::WebviewUrl::App("index.html".into()),
// )
// .position(pos.0, pos.1)
// .build()?;
// secondary_window.set_fullscreen(true);
}
}
}
std::result::Result::Ok(())
})
.run(tauri::generate_context!())
.expect("error while running app");
Ok(())
Describe the bug
I tries to cover all monitors with fullscreen windows to display graphs on them. I have multiple monitors with different resolutions, framerates and scale factors. However, the approach from examples works only for the primary monitor. The windows on secondary monitors stay small, borderless and in random positions.
However, setting windows to fullscreen after the window was built works.
P.S. While we are here, please
#[derive(PatialEq)]
on tauri::window::Monitor.Reproduction
This does not work: windows on secondary monitors remain small.
Uncomment the commented line to make it work.
Expected behavior
No response
Full
tauri info
outputStack trace
No response
Additional context
No response