diff options
Diffstat (limited to 'src/x11/mod.rs')
-rw-r--r-- | src/x11/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/x11/mod.rs b/src/x11/mod.rs index 3f17ca4..9f773f4 100644 --- a/src/x11/mod.rs +++ b/src/x11/mod.rs @@ -61,7 +61,7 @@ impl Window { let mut swa: ffi::XSetWindowAttributes = unsafe { mem::zeroed() }; swa.colormap = cmap; swa.event_mask = ffi::ExposureMask | ffi::ResizeRedirectMask | - ffi::VisibilityChangeMask | ffi::KeyPressMask; + ffi::VisibilityChangeMask | ffi::KeyPressMask | ffi::PointerMotionMask; swa }; @@ -168,6 +168,12 @@ impl Window { events.push(SizeChanged(rs_event.width as uint, rs_event.height as uint)); }, + ffi::MotionNotify => { + use CursorPositionChanged; + let event: &ffi::XMotionEvent = unsafe { mem::transmute(&xev) }; + events.push(CursorPositionChanged(event.x as uint, event.y as uint)); + }, + _ => () } |