Closed inkyMountain closed 9 months ago
I think the problem is that on Windows, the webview
itself is a child window and so when you create a child window on Windows it is actually rendered behind the webview of the main window.
if you want the a similar behavior to macOS
you need to be using window.owner_window()
on Windows instead.
I am not really sure if I should solve this issue, or just make parent_window
act the same as owner_window
to make it consistent on all platforms.
I think the problem is that on Windows, the
webview
itself is a child window and so when you create a child window on Windows it is actually rendered behind the webview of the main window.if you want the a similar behavior to
macOS
you need to be usingwindow.owner_window()
on Windows instead.
Thanks for your reply. I noticed that if window A is the owner of Window B, window B won't move along with A when A is being dragged. But child window will in this scenario. So I have a try that I listen to the move event of window A, set B's position to make it the same as A. Then it looks like B is embedded into A. A small problem is that, if A is fastly dragged, at some moments B is a little out of A.
yeah on Windows, parent window don't control the position of the owned window, there is no relationship between their position, unlike macOS. You also need to have in mind that child windows while move with the parent, they don't overflow the parent like this image shows
So it depends on your use case really.
Describe the bug
Child window can't be created on Windows 11
Reproduction
Run the "parent-window" example on Windows 11 with command
cargo run --example parent-window
and click "create child window" button on the main window. https://github.com/tauri-apps/tauri/assets/36476221/671de62c-b4b5-43e1-a1d9-7050bcbdba7fExpected behavior
A child window should show up, but none appears.
Platform and versions
Stack trace
No response
Additional context
I did the same on MacOS and everything works fine, so it might be a platform specific issue.