aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11/window/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/x11/window/mod.rs')
-rw-r--r--src/x11/window/mod.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs
index 64461a8..fd63d60 100644
--- a/src/x11/window/mod.rs
+++ b/src/x11/window/mod.rs
@@ -163,12 +163,19 @@ impl Window {
win
};
+ // set visibility
+ if builder.visible {
+ unsafe {
+ ffi::XMapRaised(display, window);
+ ffi::XFlush(display);
+ }
+ }
+
// creating window, step 2
let wm_delete_window = unsafe {
use std::c_str::ToCStr;
let delete_window = "WM_DELETE_WINDOW".to_c_str();
- ffi::XMapWindow(display, window);
let mut wm_delete_window = ffi::XInternAtom(display, delete_window.as_ptr(), 0);
ffi::XSetWMProtocols(display, window, &mut wm_delete_window, 1);
let c_title = builder.title.to_c_str();
@@ -287,9 +294,17 @@ impl Window {
}
pub fn show(&self) {
+ unsafe {
+ ffi::XMapRaised(self.display, self.window);
+ ffi::XFlush(self.display);
+ }
}
pub fn hide(&self) {
+ unsafe {
+ ffi::XUnmapWindow(self.display, self.window);
+ ffi::XFlush(self.display);
+ }
}
fn get_geometry(&self) -> Option<(int, int, uint, uint)> {