parent
82d6ad4616
commit
d2501e8886
13 changed files with 164 additions and 90 deletions
|
@ -191,7 +191,7 @@ impl Platform for WindowsPlatform {
|
|||
match msg.message {
|
||||
WM_QUIT => break 'a,
|
||||
CLOSE_ONE_WINDOW => {
|
||||
if self.close_one_window(HWND(msg.lParam.0)) {
|
||||
if self.close_one_window(HWND(msg.lParam.0 as _)) {
|
||||
break 'a;
|
||||
}
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ impl Platform for WindowsPlatform {
|
|||
let hcursor = load_cursor(style);
|
||||
let mut lock = self.state.borrow_mut();
|
||||
if lock.current_cursor.0 != hcursor.0 {
|
||||
self.post_message(CURSOR_STYLE_CHANGED, WPARAM(0), LPARAM(hcursor.0));
|
||||
self.post_message(CURSOR_STYLE_CHANGED, WPARAM(0), LPARAM(hcursor.0 as isize));
|
||||
lock.current_cursor = hcursor;
|
||||
}
|
||||
}
|
||||
|
@ -595,7 +595,7 @@ fn open_target(target: &str) {
|
|||
None,
|
||||
SW_SHOWDEFAULT,
|
||||
);
|
||||
if ret.0 <= 32 {
|
||||
if ret.0 as isize <= 32 {
|
||||
log::error!("Unable to open target: {}", std::io::Error::last_os_error());
|
||||
}
|
||||
}
|
||||
|
@ -611,7 +611,7 @@ fn open_target_in_explorer(target: &str) {
|
|||
None,
|
||||
SW_SHOWDEFAULT,
|
||||
);
|
||||
if ret.0 <= 32 {
|
||||
if ret.0 as isize <= 32 {
|
||||
log::error!(
|
||||
"Unable to open target in explorer: {}",
|
||||
std::io::Error::last_os_error()
|
||||
|
@ -643,11 +643,12 @@ unsafe fn show_savefile_dialog(directory: PathBuf) -> Result<IFileSaveDialog> {
|
|||
Ok(dialog)
|
||||
}
|
||||
|
||||
fn begin_vsync(vsync_evnet: HANDLE) {
|
||||
fn begin_vsync(vsync_event: HANDLE) {
|
||||
let event: SafeHandle = vsync_event.into();
|
||||
std::thread::spawn(move || unsafe {
|
||||
loop {
|
||||
windows::Win32::Graphics::Dwm::DwmFlush().log_err();
|
||||
SetEvent(vsync_evnet).log_err();
|
||||
SetEvent(*event).log_err();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -723,7 +724,7 @@ fn set_data_to_clipboard(data: &[u16], format: u32) -> Result<()> {
|
|||
let handle = GlobalLock(global);
|
||||
u_memcpy(handle as _, data.as_ptr(), data.len() as _);
|
||||
let _ = GlobalUnlock(global);
|
||||
SetClipboardData(format, HANDLE(global.0 as isize))?;
|
||||
SetClipboardData(format, HANDLE(global.0))?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue