Skip to content

Commit d57fa50

Browse files
committed
fix(win): let windows-sys fallback methods
1 parent e0bb730 commit d57fa50

1 file changed

Lines changed: 9 additions & 17 deletions

File tree

src/ui/windows/window.rs

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ use windows_sys::{
1515
Input::KeyboardAndMouse::{EnableWindow, IsWindowEnabled},
1616
WindowsAndMessaging::{
1717
CW_USEDEFAULT, CloseWindow, CreateWindowExW, DestroyIcon, DestroyWindow, GWL_STYLE,
18-
GetClientRect, GetParent, GetWindowLongPtrW, GetWindowLongW, GetWindowRect,
19-
GetWindowTextLengthW, GetWindowTextW, HICON, HWND_DESKTOP, ICON_BIG, IDC_ARROW,
20-
IMAGE_ICON, IsWindowVisible, LR_DEFAULTCOLOR, LR_DEFAULTSIZE, LoadCursorW,
21-
LoadImageW, RegisterClassExW, SW_HIDE, SW_SHOW, SWP_NOMOVE, SWP_NOSIZE,
22-
SWP_NOZORDER, SendMessageW, SetWindowLongPtrW, SetWindowLongW, SetWindowPos,
23-
SetWindowTextW, ShowWindow, WM_CLOSE, WM_MOVE, WM_SETICON, WM_SIZE, WNDCLASSEXW,
24-
WS_CHILDWINDOW, WS_OVERLAPPEDWINDOW,
18+
GetClientRect, GetParent, GetWindowLongPtrW, GetWindowRect, GetWindowTextLengthW,
19+
GetWindowTextW, HICON, HWND_DESKTOP, ICON_BIG, IDC_ARROW, IMAGE_ICON,
20+
IsWindowVisible, LR_DEFAULTCOLOR, LR_DEFAULTSIZE, LoadCursorW, LoadImageW,
21+
RegisterClassExW, SW_HIDE, SW_SHOW, SWP_NOMOVE, SWP_NOSIZE, SWP_NOZORDER,
22+
SendMessageW, SetWindowLongPtrW, SetWindowPos, SetWindowTextW, ShowWindow,
23+
WM_CLOSE, WM_MOVE, WM_SETICON, WM_SIZE, WNDCLASSEXW, WS_CHILDWINDOW,
24+
WS_OVERLAPPEDWINDOW,
2525
},
2626
},
2727
},
@@ -263,11 +263,7 @@ impl Widget {
263263
pub fn style(&self) -> u32 {
264264
syscall!(
265265
BOOL,
266-
if cfg!(target_pointer_width = "64") {
267-
GetWindowLongPtrW(self.as_raw_window(), GWL_STYLE) as u32
268-
} else {
269-
GetWindowLongW(self.as_raw_window(), GWL_STYLE) as u32
270-
}
266+
GetWindowLongPtrW(self.as_raw_window(), GWL_STYLE) as u32
271267
)
272268
.unwrap()
273269
}
@@ -276,11 +272,7 @@ impl Widget {
276272
unsafe { SetLastError(0) };
277273
let res = syscall!(
278274
BOOL,
279-
if cfg!(target_pointer_width = "64") {
280-
SetWindowLongPtrW(self.as_raw_window(), GWL_STYLE, style as _) as i32
281-
} else {
282-
SetWindowLongW(self.as_raw_window(), GWL_STYLE, style as _)
283-
}
275+
SetWindowLongPtrW(self.as_raw_window(), GWL_STYLE, style as _) as i32
284276
);
285277
match res {
286278
Ok(_) => {}

0 commit comments

Comments
 (0)