aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2014-07-28 13:16:55 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2014-07-28 13:16:55 +0200
commit5764b9c243e0c1732fdce186e4de4e34540b95e3 (patch)
tree1ae5fcf57d6e6b5fb0b4b3712b3ca3a2da4bf8e6 /src/x11
parent07a53af9526a3583555fb22208abc1b3fa76abe4 (diff)
downloadglutin-5764b9c243e0c1732fdce186e4de4e34540b95e3.tar.gz
glutin-5764b9c243e0c1732fdce186e4de4e34540b95e3.zip
Implement resize events on X11
Diffstat (limited to 'src/x11')
-rw-r--r--src/x11/ffi.rs11
-rw-r--r--src/x11/mod.rs6
2 files changed, 17 insertions, 0 deletions
diff --git a/src/x11/ffi.rs b/src/x11/ffi.rs
index b636b99..5caabc5 100644
--- a/src/x11/ffi.rs
+++ b/src/x11/ffi.rs
@@ -241,6 +241,17 @@ pub struct XClientMessageEvent {
pub l: [libc::c_long, ..5],
}
+#[reprc(C)]
+pub struct XResizeRequestEvent {
+ pub type_: libc::c_int,
+ pub serial: libc::c_ulong,
+ pub send_event: Bool,
+ pub display: *mut Display,
+ pub window: Window,
+ pub width: libc::c_int,
+ pub height: libc::c_int,
+}
+
#[link(name = "GL")]
#[link(name = "X11")]
extern "C" {
diff --git a/src/x11/mod.rs b/src/x11/mod.rs
index 1c91e2d..3f17ca4 100644
--- a/src/x11/mod.rs
+++ b/src/x11/mod.rs
@@ -162,6 +162,12 @@ impl Window {
}
},
+ ffi::ResizeRequest => {
+ use SizeChanged;
+ let rs_event: &ffi::XResizeRequestEvent = unsafe { mem::transmute(&xev) };
+ events.push(SizeChanged(rs_event.width as uint, rs_event.height as uint));
+ },
+
_ => ()
}