mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-22 18:06:33 +11:00
Implement resize events on X11
This commit is contained in:
parent
07a53af952
commit
5764b9c243
2 changed files with 17 additions and 0 deletions
|
@ -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" {
|
||||
|
|
|
@ -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));
|
||||
},
|
||||
|
||||
_ => ()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue