summaryrefslogtreecommitdiff
path: root/src/safe_x11/window.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/safe_x11/window.rs')
-rw-r--r--src/safe_x11/window.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/safe_x11/window.rs b/src/safe_x11/window.rs
index 34cce64..8a3bab4 100644
--- a/src/safe_x11/window.rs
+++ b/src/safe_x11/window.rs
@@ -20,6 +20,9 @@ use x11::xlib::{
ClientMessage,ClientMessageData, NoEventMask,
XChangeProperty,
+ XChangeWindowAttributes, XSetWindowAttributes,
+
+ XMapWindow, XUnmapWindow,
};
use std::ptr;
@@ -218,7 +221,6 @@ impl XWindow {
let fs_atom_slice: &[Atom; 1] = &[fs_atom];
let fs_atom_ptr: *const u8 = unsafe { transmute(fs_atom_slice) };
- println!("Changing property!");
unsafe {
XChangeProperty(self.display, self.inner, wm_state_atom,
XA_ATOM, 32, PropModeReplace, fs_atom_ptr,
@@ -227,11 +229,25 @@ impl XWindow {
}
if fullscreen {
- println!("resizing!");
self.move_resize(0, 0, dw, dh);
self.set_border_width(0);
} else {
self.set_border_width(1);
}
}
+
+ pub fn map(&self) {
+ unsafe { XMapWindow(self.display, self.inner); }
+ }
+
+ pub fn unmap(&self) {
+ unsafe { XUnmapWindow(self.display, self.inner); }
+ }
+}
+
+pub fn change_window_attributes(display: *mut xlib::Display, win: Window, mask: u64,
+ window_attribs: *mut XSetWindowAttributes) {
+ unsafe {
+ XChangeWindowAttributes(display, win, mask, window_attribs);
+ }
}