aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2016-03-27 21:40:11 +0200
committertomaka <pierre.krieger1708@gmail.com>2016-03-27 21:40:11 +0200
commit89dd63b9ceac72a7ca274724d2b81033ddb5d4ed (patch)
tree3cb9607c207560325129c186942ded4c79d227ca
parent8ae2df68e19ca71453af5e11de9ca807ef7adcb4 (diff)
parent117069ef9023665085564c4c20a9525c9e139de2 (diff)
downloadglutin-89dd63b9ceac72a7ca274724d2b81033ddb5d4ed.zip
glutin-89dd63b9ceac72a7ca274724d2b81033ddb5d4ed.tar.gz
Merge pull request #752 from RichardlL/master
Changed MouseMoved((i32, i32)) to MouseMoved(i32, i32), breaking change
-rw-r--r--examples/grabbing.rs2
-rw-r--r--src/api/cocoa/mod.rs4
-rw-r--r--src/api/wayland/events.rs4
-rw-r--r--src/api/win32/callback.rs2
-rw-r--r--src/api/x11/input.rs2
-rw-r--r--src/events.rs2
6 files changed, 8 insertions, 8 deletions
diff --git a/examples/grabbing.rs b/examples/grabbing.rs
index 485be78..ad79f1b 100644
--- a/examples/grabbing.rs
+++ b/examples/grabbing.rs
@@ -35,7 +35,7 @@ fn main() {
Event::Closed => break,
- a @ Event::MouseMoved(_) => {
+ a @ Event::MouseMoved(_, _) => {
println!("{:?}", a);
},
diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs
index e935805..da7c1ec 100644
--- a/src/api/cocoa/mod.rs
+++ b/src/api/cocoa/mod.rs
@@ -848,8 +848,8 @@ unsafe fn NSEventToEvent(window: &Window, nsevent: id) -> Option<Event> {
let view_rect = NSView::frame(*window.view);
let scale_factor = window.hidpi_factor();
- Some(MouseMoved(((scale_factor * view_point.x as f32) as i32,
- (scale_factor * (view_rect.size.height - view_point.y) as f32) as i32)))
+ Some(MouseMoved((scale_factor * view_point.x as f32) as i32,
+ (scale_factor * (view_rect.size.height - view_point.y) as f32) as i32))
},
NSKeyDown => {
let mut events = VecDeque::new();
diff --git a/src/api/wayland/events.rs b/src/api/wayland/events.rs
index 5e0c3fd..92a0b95 100644
--- a/src/api/wayland/events.rs
+++ b/src/api/wayland/events.rs
@@ -52,7 +52,7 @@ pub fn translate_event(
if known_surfaces.contains(&surface) {
focuses.pointer_on = Some(surface);
focuses.pointer_at = Some((x, y));
- Some((GlutinEvent::MouseMoved((x as i32, y as i32)), surface))
+ Some((GlutinEvent::MouseMoved(x as i32, y as i32), surface))
} else {
None
}
@@ -65,7 +65,7 @@ pub fn translate_event(
WlPointerEvent::Motion(_, x, y) => {
if let Some(surface) = focuses.pointer_on {
focuses.pointer_at = Some((x, y));
- Some((GlutinEvent::MouseMoved((x as i32, y as i32)), surface))
+ Some((GlutinEvent::MouseMoved(x as i32, y as i32), surface))
} else {
None
}
diff --git a/src/api/win32/callback.rs b/src/api/win32/callback.rs
index 2d10699..337611b 100644
--- a/src/api/win32/callback.rs
+++ b/src/api/win32/callback.rs
@@ -126,7 +126,7 @@ pub unsafe extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT,
let x = winapi::GET_X_LPARAM(lparam) as i32;
let y = winapi::GET_Y_LPARAM(lparam) as i32;
- send_event(window, MouseMoved((x, y)));
+ send_event(window, MouseMoved(x, y));
0
},
diff --git a/src/api/x11/input.rs b/src/api/x11/input.rs
index a05b22e..310f1bc 100644
--- a/src/api/x11/input.rs
+++ b/src/api/x11/input.rs
@@ -241,7 +241,7 @@ impl XInputEventHandler {
let new_cursor_pos = (event_data.event_x, event_data.event_y);
if new_cursor_pos != self.current_state.cursor_pos {
self.current_state.cursor_pos = new_cursor_pos;
- Some(MouseMoved((new_cursor_pos.0 as i32, new_cursor_pos.1 as i32)))
+ Some(MouseMoved(new_cursor_pos.0 as i32, new_cursor_pos.1 as i32))
} else {
None
}
diff --git a/src/events.rs b/src/events.rs
index 9fff1fb..d13a0bf 100644
--- a/src/events.rs
+++ b/src/events.rs
@@ -28,7 +28,7 @@ pub enum Event {
/// The cursor has moved on the window.
///
/// The parameter are the (x,y) coords in pixels relative to the top-left corner of the window.
- MouseMoved((i32, i32)),
+ MouseMoved(i32, i32),
/// A mouse wheel movement or touchpad scroll occurred.
MouseWheel(MouseScrollDelta, TouchPhase),