mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 14:51:30 +11:00
Merge pull request #576 from retep998/master
Cleanup unused import stuff
This commit is contained in:
commit
73e4a7d4b1
|
@ -57,6 +57,14 @@ user32-sys = "~0.1.1"
|
||||||
kernel32-sys = "0.1"
|
kernel32-sys = "0.1"
|
||||||
dwmapi-sys = "0.1"
|
dwmapi-sys = "0.1"
|
||||||
|
|
||||||
|
[target.i686-pc-windows-msvc.dependencies]
|
||||||
|
winapi = "0.2"
|
||||||
|
shell32-sys = "0.1"
|
||||||
|
gdi32-sys = "0.1"
|
||||||
|
user32-sys = "~0.1.1"
|
||||||
|
kernel32-sys = "0.1"
|
||||||
|
dwmapi-sys = "0.1"
|
||||||
|
|
||||||
[target.x86_64-pc-windows-gnu.dependencies]
|
[target.x86_64-pc-windows-gnu.dependencies]
|
||||||
winapi = "0.2"
|
winapi = "0.2"
|
||||||
shell32-sys = "0.1"
|
shell32-sys = "0.1"
|
||||||
|
|
|
@ -230,7 +230,7 @@ pub unsafe extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT,
|
||||||
let cstash = cstash.as_ref();
|
let cstash = cstash.as_ref();
|
||||||
// there's a very bizarre borrow checker bug
|
// there's a very bizarre borrow checker bug
|
||||||
// possibly related to rust-lang/rust/#23338
|
// possibly related to rust-lang/rust/#23338
|
||||||
let cursor_state = if let Some(cstash) = cstash {
|
let _cursor_state = if let Some(cstash) = cstash {
|
||||||
if let Ok(cursor_state) = cstash.cursor_state.lock() {
|
if let Ok(cursor_state) = cstash.cursor_state.lock() {
|
||||||
match *cursor_state {
|
match *cursor_state {
|
||||||
CursorState::Normal => {
|
CursorState::Normal => {
|
||||||
|
@ -256,7 +256,7 @@ pub unsafe extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT,
|
||||||
use events::Event::DroppedFile;
|
use events::Event::DroppedFile;
|
||||||
|
|
||||||
let hdrop = wparam as winapi::HDROP;
|
let hdrop = wparam as winapi::HDROP;
|
||||||
let mut pathbuf: [u16; winapi::MAX_PATH] = unsafe { mem::uninitialized() };
|
let mut pathbuf: [u16; winapi::MAX_PATH] = mem::uninitialized();
|
||||||
let num_drops = shell32::DragQueryFileW(hdrop, 0xFFFFFFFF, ptr::null_mut(), 0);
|
let num_drops = shell32::DragQueryFileW(hdrop, 0xFFFFFFFF, ptr::null_mut(), 0);
|
||||||
|
|
||||||
for i in 0..num_drops {
|
for i in 0..num_drops {
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
use std::sync::atomic::AtomicBool;
|
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use libc;
|
|
||||||
|
|
||||||
use super::callback;
|
use super::callback;
|
||||||
use super::Window;
|
use super::Window;
|
||||||
|
@ -19,7 +17,7 @@ use CreationError::OsError;
|
||||||
use CursorState;
|
use CursorState;
|
||||||
use GlRequest;
|
use GlRequest;
|
||||||
|
|
||||||
use std::ffi::{CString, OsStr};
|
use std::ffi::{OsStr};
|
||||||
use std::os::windows::ffi::OsStrExt;
|
use std::os::windows::ffi::OsStrExt;
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
|
|
||||||
|
@ -28,7 +26,6 @@ use kernel32;
|
||||||
use dwmapi;
|
use dwmapi;
|
||||||
use user32;
|
use user32;
|
||||||
|
|
||||||
use api::wgl;
|
|
||||||
use api::wgl::Context as WglContext;
|
use api::wgl::Context as WglContext;
|
||||||
use api::egl;
|
use api::egl;
|
||||||
use api::egl::Context as EglContext;
|
use api::egl::Context as EglContext;
|
||||||
|
@ -163,7 +160,7 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
|
||||||
|
|
||||||
// creating the OpenGL context
|
// creating the OpenGL context
|
||||||
let context = match builder.gl_version {
|
let context = match builder.gl_version {
|
||||||
GlRequest::Specific(Api::OpenGlEs, (major, minor)) => {
|
GlRequest::Specific(Api::OpenGlEs, (_major, _minor)) => {
|
||||||
if let Some(egl) = egl {
|
if let Some(egl) = egl {
|
||||||
if let Ok(c) = EglContext::new(egl, &builder,
|
if let Ok(c) = EglContext::new(egl, &builder,
|
||||||
egl::NativeDisplay::Other(Some(ptr::null())))
|
egl::NativeDisplay::Other(Some(ptr::null())))
|
||||||
|
@ -214,9 +211,7 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
|
||||||
fTransitionOnMaximized: 0,
|
fTransitionOnMaximized: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
unsafe {
|
dwmapi::DwmEnableBlurBehindWindow(real_window.0, &bb);
|
||||||
dwmapi::DwmEnableBlurBehindWindow(real_window.0, &bb);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// calling SetForegroundWindow if fullscreen
|
// calling SetForegroundWindow if fullscreen
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#![cfg(target_os = "windows")]
|
#![cfg(target_os = "windows")]
|
||||||
|
|
||||||
use std::sync::atomic::AtomicBool;
|
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
|
@ -26,7 +25,6 @@ use winapi;
|
||||||
use user32;
|
use user32;
|
||||||
use kernel32;
|
use kernel32;
|
||||||
|
|
||||||
use api::wgl;
|
|
||||||
use api::wgl::Context as WglContext;
|
use api::wgl::Context as WglContext;
|
||||||
use api::egl::Context as EglContext;
|
use api::egl::Context as EglContext;
|
||||||
use api::egl::ffi::egl::Egl;
|
use api::egl::ffi::egl::Egl;
|
||||||
|
|
Loading…
Reference in a new issue