Skip to content

Commit da1514b

Browse files
fix(windows): gap in maximized undecorated window (#1150)
1 parent efc67fb commit da1514b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
tao: patch
3+
---
4+
5+
Fix maximized windows have empty edges when using auto hide task bar on Windows

src/platform_impl/windows/event_loop.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,31 +2164,26 @@ unsafe fn public_window_callback_inner<T: 'static>(
21642164
{
21652165
let mut rect = monitor_info.monitorInfo.rcWork;
21662166

2167-
let mut edges = 0;
2168-
for edge in [ABE_BOTTOM, ABE_LEFT, ABE_TOP, ABE_RIGHT] {
2167+
fn has_edge(edge: u32) -> bool {
21692168
let mut app_data = APPBARDATA {
21702169
cbSize: std::mem::size_of::<APPBARDATA>() as _,
21712170
uEdge: edge,
21722171
..Default::default()
21732172
};
2174-
if SHAppBarMessage(ABM_GETAUTOHIDEBAR, &mut app_data) != 0 {
2175-
edges |= edge;
2176-
}
2173+
unsafe { SHAppBarMessage(ABM_GETAUTOHIDEBAR, &mut app_data) != 0 }
21772174
}
21782175

21792176
// keep a 1px for taskbar auto-hide to work
2180-
if edges & ABE_BOTTOM != 0 {
2177+
if has_edge(ABE_BOTTOM) {
21812178
rect.bottom -= 1;
21822179
}
2183-
// FIXME:
2184-
#[allow(clippy::bad_bit_mask)]
2185-
if edges & ABE_LEFT != 0 {
2180+
if has_edge(ABE_LEFT) {
21862181
rect.left += 1;
21872182
}
2188-
if edges & ABE_TOP != 0 {
2183+
if has_edge(ABE_TOP) {
21892184
rect.top += 1;
21902185
}
2191-
if edges & ABE_RIGHT != 0 {
2186+
if has_edge(ABE_RIGHT) {
21922187
rect.right -= 1;
21932188
}
21942189

0 commit comments

Comments
 (0)