mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
Fix bad events
This commit is contained in:
parent
838cc2b325
commit
aa7d88dbda
|
@ -1,11 +1,8 @@
|
||||||
|
|
||||||
#[deriving(Clone,Show)]
|
#[deriving(Clone,Show)]
|
||||||
pub enum Event {
|
pub enum Event {
|
||||||
/// The position of the window has changed.
|
|
||||||
PositionChanged(uint, uint),
|
|
||||||
|
|
||||||
/// The size of the window has changed.
|
/// The size of the window has changed.
|
||||||
SizeChanged(uint, uint),
|
Resized(uint, uint),
|
||||||
|
|
||||||
/// The position of the window has changed.
|
/// The position of the window has changed.
|
||||||
Moved(int, int),
|
Moved(int, int),
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#![feature(unsafe_destructor)]
|
#![feature(unsafe_destructor)]
|
||||||
|
#![feature(globs)]
|
||||||
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
||||||
pub use events::{Event, Element, PositionChanged, SizeChanged, Closed, CursorPositionChanged, Focused};
|
pub use events::*;
|
||||||
pub use events::{Iconified, NeedRefresh, Pressed, Released};
|
|
||||||
pub use hints::{Hints, ClientAPI, Profile};
|
pub use hints::{Hints, ClientAPI, Profile};
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
|
|
@ -362,10 +362,10 @@ extern "stdcall" fn callback(window: ffi::HWND, msg: ffi::UINT,
|
||||||
},
|
},
|
||||||
|
|
||||||
ffi::WM_SIZE => {
|
ffi::WM_SIZE => {
|
||||||
use SizeChanged;
|
use Resized;
|
||||||
let w = ffi::LOWORD(lparam as ffi::DWORD) as uint;
|
let w = ffi::LOWORD(lparam as ffi::DWORD) as uint;
|
||||||
let h = ffi::HIWORD(lparam as ffi::DWORD) as uint;
|
let h = ffi::HIWORD(lparam as ffi::DWORD) as uint;
|
||||||
send_event(window, SizeChanged(w, h));
|
send_event(window, Resized(w, h));
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -173,9 +173,9 @@ impl Window {
|
||||||
},
|
},
|
||||||
|
|
||||||
ffi::ResizeRequest => {
|
ffi::ResizeRequest => {
|
||||||
use SizeChanged;
|
use Resized;
|
||||||
let rs_event: &ffi::XResizeRequestEvent = unsafe { mem::transmute(&xev) };
|
let rs_event: &ffi::XResizeRequestEvent = unsafe { mem::transmute(&xev) };
|
||||||
events.push(SizeChanged(rs_event.width as uint, rs_event.height as uint));
|
events.push(Resized(rs_event.width as uint, rs_event.height as uint));
|
||||||
},
|
},
|
||||||
|
|
||||||
ffi::MotionNotify => {
|
ffi::MotionNotify => {
|
||||||
|
|
Loading…
Reference in a new issue