Skip to content

Commit

Permalink
fix(windows): use physical size when resizing to parent (#1254)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed May 9, 2024
1 parent 4c88c66 commit 2d43d62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changes/windows-resize-to-parent-logical.md
@@ -0,0 +1,5 @@
---
"wry": "patch"
---

On Windows, fix webview having a bigger size than the actual window size after creation and until the window is resized.
5 changes: 1 addition & 4 deletions src/webview2/mod.rs
Expand Up @@ -1268,10 +1268,7 @@ impl InnerWebView {
let width = rect.right - rect.left;
let height = rect.bottom - rect.top;

self.set_bounds(Rect {
size: dpi::Size::Logical((width, height).into()),
..Default::default()
})
self.set_bounds_inner((width, height).into(), (0, 0).into())
}

pub fn set_visible(&self, visible: bool) -> Result<()> {
Expand Down

0 comments on commit 2d43d62

Please sign in to comment.