From eee9e298babd8c67a9bba30ea47867471013230f Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Sat, 2 Aug 2014 12:47:32 +0200 Subject: Implement set_window_position for x11 --- src/x11/ffi.rs | 1 + src/x11/mod.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/x11/ffi.rs b/src/x11/ffi.rs index ec5b69c..a31b9c2 100644 --- a/src/x11/ffi.rs +++ b/src/x11/ffi.rs @@ -1356,6 +1356,7 @@ extern "C" { only_if_exists: Bool) -> Atom; pub fn XKeycodeToKeysym(display: *mut Display, keycode: KeyCode, index: libc::c_int) -> KeySym; + pub fn XMoveWindow(display: *mut Display, w: Window, x: libc::c_int, y: libc::c_int); pub fn XMapWindow(display: *mut Display, w: Window); pub fn XNextEvent(display: *mut Display, event_return: *mut XEvent); pub fn XOpenDisplay(display_name: *const libc::c_char) -> *mut Display; diff --git a/src/x11/mod.rs b/src/x11/mod.rs index 580a897..0311b9a 100644 --- a/src/x11/mod.rs +++ b/src/x11/mod.rs @@ -197,7 +197,7 @@ impl Window { } pub fn set_position(&self, x: uint, y: uint) { - unimplemented!() + unsafe { ffi::XMoveWindow(self.display, self.window, x as libc::c_int, y as libc::c_int) } } pub fn get_inner_size(&self) -> Option<(uint, uint)> { -- cgit v1.2.3