You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies if this issue already exists, I saw a couple around this but none talking about this problem specifically.
It looks like sometime between 2.0.0 and 2.1.1, window sizing in from the tauri config and using set_size (from Rust or JS) is not working properly. Setting the window size in the config, the values seem to be off by a small amount (14px X and 37px Y on a 528x100px window). Using set_size seems to basically have no effect on the size.
Looking into the source, it appears the issue is in the Tao crate. Commenting out this section of code fixes the issue, initial window size is correct and set_size works again.
if window_flags.contains(WindowFlags::MARKER_UNDECORATED_SHADOW) && !is_decorated {
let mut pt: POINT = unsafe { mem::zeroed() };
if unsafe { ClientToScreen(self.hwnd(), &mut pt) }.as_bool() == true {
let mut window_rc: RECT = unsafe { mem::zeroed() };
if unsafe { GetWindowRect(self.hwnd(), &mut window_rc) }.is_ok() {
let left_b = pt.x - window_rc.left;
let right_b = pt.x + width - window_rc.right;
let top_b = pt.y - window_rc.top;
let bottom_b = pt.y + height - window_rc.bottom;
width = width + (left_b - right_b);
height = height + (top_b - bottom_b);
}
}
}
From this I was able to see it only happens for undecorated windows where shadows are enabled, disabling the shadows does work but that's not the style I am looking for in my application.
Describe the bug
Apologies if this issue already exists, I saw a couple around this but none talking about this problem specifically.
It looks like sometime between 2.0.0 and 2.1.1, window sizing in from the tauri config and using set_size (from Rust or JS) is not working properly. Setting the window size in the config, the values seem to be off by a small amount (14px X and 37px Y on a 528x100px window). Using set_size seems to basically have no effect on the size.
Looking into the source, it appears the issue is in the Tao crate. Commenting out this section of code fixes the issue, initial window size is correct and set_size works again.
From this I was able to see it only happens for undecorated windows where shadows are enabled, disabling the shadows does work but that's not the style I am looking for in my application.
Reproduction
No response
Expected behavior
Window resizes correctly.
Full
tauri info
outputStack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: