diff options
author | Matias Linares <matiaslina@openmailbox.org> | 2015-12-07 16:19:36 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@openmailbox.org> | 2015-12-07 16:19:36 -0300 |
commit | 69f8194da778a692b6b0c14f43d9611c2072e8ba (patch) | |
tree | 8d9f252bf7a6db515a05800a73b35b21d1692cfb /src/safe_x11/window.rs | |
parent | 12faa87415d91820503b6b1c98ebabbddc50d665 (diff) | |
download | dotwm-69f8194da778a692b6b0c14f43d9611c2072e8ba.tar.gz |
Implement desktops.
It's somewhat buggy. But works :). There're 2 desktops only for now, maybe later
I will implement something more dynamic
Diffstat (limited to 'src/safe_x11/window.rs')
-rw-r--r-- | src/safe_x11/window.rs | 20 |
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); + } } |